Commit Graph

82 Commits

Author SHA1 Message Date
Erwin Coumans
87293e835c implement specular, URDF non-standard specular part (see sphere2.urdf) and SDF specular support.
pybullet.changeVisualShape(obUid,linkIndex,specularColor=[R,G,B]) and Bullet C-API b3UpdateVisualShapeSpecularColor
Bug fixes in b3ResourcePath::findResourcePath resolution.
add stadium.sdf and roboschool/models_outdoor/stadium assets https://github.com/openai/roboschool/tree/master/roboschool/models_outdoor/stadium
minor fixes to obj2sdf
2017-06-01 12:32:44 -07:00
erwincoumans
83f910711a Prepare/allow for non-Bullet2-based physics command processor in pybullet/Bullet-C-API
!!! Make sure to add examples/SharedMemory/PhysicsServerExampleBullet2.cpp to your build system, if needed
Bump up pybullet to version 1.0.9
2017-05-30 19:54:55 -07:00
Erwin Coumans
9743bb387c give some pure-virtual methods default empty implementation, avoid breaking some internal research code 2017-05-24 19:30:06 -07:00
Erwin Coumans
84d09cc18f Split CommonGfxVertex3D into two different ones, GfxVertexFormat0 and GfxVertexFormat1
Rewrite  GLInstancingRenderer::drawTexturedTriangleMesh
2017-05-24 13:05:16 -07:00
Erwin Coumans
9f7d7fecd5 more rendering fixes 2017-05-23 23:34:55 -07:00
Erwin Coumans
db008ab3c2 Improve debug text/line rendering, can be use to draw frames and text in local coordinate of an object / link.
example:
kuka = p.loadURDF("kuka_iiwa/model.urdf")
p.getNumJoints(kuka)
pybullet.addUserDebugLine([0,0,0],[0,0,0.1],[0,0,1],trackObjectUniqueId=2,trackLinkIndex=6)
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],trackObjectUniqueId=2,trackLinkIndex=6)
Also allow to render text using a given orientation (instead of pointing to the camera), example:
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],textOrientation=[0,0,0,1], trackObjectUniqueId=2,trackLinkIndex=6)
Add drawTexturedTriangleMesh, for drawing 3d text.
Expose readSingleInstanceTransformToCPU, to extract position/orientation from graphics index.
updateTexture: allow to not flip texels around up axis
2017-05-23 22:05:26 -07:00
Erwin Coumans
f80838e989 expose the changeVisualShape RGBA color for TinyRenderer, OpenGL3 renderer. 2017-05-13 09:18:36 -07:00
Erwin Coumans
1e443edc55 minor change in API for CommonGUIHelperInterface 2017-05-05 07:48:05 -07:00
Erwin Coumans
152e3da3e4 Implementation of virtual void CommonRenderInterface::removeGraphicsInstance(int instanceUid)
for GLInstancingRenderer (OpenGL3+) and SimpleOpenGL2Renderer (OpenGL2)
Refactored the add/remove object pool in Bullet3Common/b3ResizablePool.h
Added CommonRigidBodyBase::deleteRigidBody, also removing its graphics instance.
2017-05-03 17:05:05 -07:00
Erwin Coumans
4759e5a590 tinyrenderer: disable triangle backface culling (doesn't work well, cull triangles that should be visible)
GLInstancingRenderer: allow to set the light position
2017-04-23 07:35:13 -07:00
Erwin Coumans
bdf366b045 implement pybullet.getDebugVisualizerCamera, width, height, providing viewmatrix, projection matrix 2017-04-10 11:03:41 -07:00
Erwin Coumans
440d445a02 also report VR events for HMD and generic tracked devices. Also expose those VR events to pybullet: expose a deviceTypeFilter, that defaults to VR_DEVICE_CONTROLLER 2017-04-07 22:53:36 -07:00
Erwin Coumans
e487bc360b add support for setuptools setup.py pybullet for 'pip install pybullet'
rewrite MacOpenGLWindow.mm into .m version, so that setup.py can handle it.
See also test at https://pypi.python.org/pypi/pybullet/0.1.0
2017-04-02 23:00:06 -07:00
Erwin Coumans
59d16b2c42 expose video capture as logging command in b3RobotSimulatorClientAPI (C++) and pybullet (use STATE_LOGGING_VIDEO_MP4) 2017-03-16 09:13:33 -07:00
Erwin Coumans
bf5f78f35a decouple some dependency using a callback. 2017-02-21 19:28:49 -08:00
Erwin Coumans
37890e5a4d allow to enable/disable GUI, shadows, wireframe of OpenGL Visualizer from API
(pybullet.configureDebugVisualizer)
2017-02-21 17:36:54 -08:00
Erwin Coumans
63486a712c VR video recording, use command-line --mp4=videoname.mp4
tune gripper grasp example with tefal pan, 800Newton force.
URDF importer: if using single transform 1 child shape, don't use compound shape.
if renderGUI is false, don't intercept mouse clicks
add manyspheres.py example (performance is pretty bad, will look into it)
[pybullet] expose contactBreakingThreshold
2017-02-16 14:19:09 -08:00
yunfeibai
ce69f27f32 Modify the depth buffer value in TinyRenderer to be consistent as in OpenGL. 2017-02-08 11:34:38 -08:00
erwincoumans
fc59a40127 Merge pull request #905 from lunkhound/pr-sel-solver-type
example browser: add controls for changing the solver type and solver flags
2017-01-30 10:22:31 -08:00
Erwin Coumans
52761f5578 [pybullet] implement addUserDebugParameter / readUserDebugParameter
fix inertial frame for door.urdf
allow picking of links of multi-bodies with a fixed base
2017-01-17 15:42:32 -08:00
Erwin Coumans
8e9181f85c [MJCF import] add custom broadphase collision filter, for MJCF/MuJoCo compatibility
[MJCF import] improve MuJoCo importer, support collision filters
fixed a few more warnings
2017-01-16 08:23:49 -08:00
Erwin Coumans
a93704889c add a default empty implementation for a few pure virtual calls
(in interface classes) for backward compatibility in some code base
2017-01-12 11:40:43 -08:00
Lunkhound
ea0df70c77 example browser: fix for GUI button toggle state 2017-01-02 23:01:22 -08:00
Lunkhound
49b27f30bd example browser: slider widget improvements 2016-11-20 16:38:11 -08:00
Erwin Coumans
c521d816c6 add user debug line/text features in pybullet + shared memory API:
addUserDebugLine,
addUserDebugText
removeUserDebugItem
removeAllUserDebugItems
2016-11-14 07:39:34 -08:00
erwincoumans
4235c61fcf move CommonRigidBodyMTBase out of interfaces, into MultiThreadedDemo. 2016-11-07 12:08:02 -08:00
Lunkhound
1c3686ca51 MultiThreaded Demo:
- fixing various race conditions throughout (usage of static vars, etc)
 - addition of a few lightweight mutexes (which are compiled out by default)
 - slight code rearrangement in discreteDynamicsWorld to facilitate multithreading
 - PoolAllocator::allocate() can now be called when pool is full without
     crashing (null pointer returned)
 - PoolAllocator allocate and freeMemory, are OPTIONALLY threadsafe
     (default is un-threadsafe)
 - CollisionDispatcher no longer checks if the pool allocator is full
     before calling allocate(), instead it just calls allocate() and
     checks if the return is null -- this avoids a race condition
 - SequentialImpulseConstraintSolver OPTIONALLY uses different logic in
     getOrInitSolverBody() to avoid a race condition with kinematic bodies
 - addition of 2 classes which together allow simulation islands to be run
   in parallel:
    - btSimulationIslandManagerMt
    - btDiscreteDynamicsWorldMt
 - MultiThreadedDemo example in the example browser demonstrating use of
   OpenMP, Microsoft PPL, and Intel TBB
 - use multithreading for other demos
 - benchmark demo: add parallel raycasting
2016-10-30 12:47:27 -07:00
erwincoumans
79d9e6b15e move CommonTimeWarpBase.h to Evolution/NN3DWalkersTimeWarpBase, it is not a common interface. 2016-10-22 13:50:08 -07:00
erwincoumans
c481662938 Merge pull request #723 from benelot/3D-NN-walkers-example
Simple Neural Network 3D Walkers example
2016-10-21 08:47:35 -07:00
Erwin Coumans
0ca1cee6f0 add a few virtual destructors, remove physics client from server 2016-10-20 14:08:55 -07:00
erwin coumans
29f3afe2a4 don't use GL_LINEAR_MIPMAP_LINEAR for shadow maps
optimize gpu upload (use glBufferSubData instead of glMapBuffer
Avoid checking char array against zero.
2016-10-14 15:06:09 -07:00
erwincoumans
bbb2fac940 App_SharedMemoryPhysics_VR: Add a command-line flag (--emptyworld) to disable the Samurai/KUKA robot creation in the VR demo, and use pybullet to populate the VR world. Note that either way, you can use pybullet to interact and control the world. 2016-10-08 18:40:09 -07:00
Benelot
062236af70 Fix running headless to be nearly completely headless. 2016-09-18 01:03:41 +02:00
Benelot
51e51ca848 Print out effective speedup. Reduce application tick to 60/s. 2016-09-18 00:52:08 +02:00
Benelot
7cf4a2352c Simplify the parameter interface for NNWalkers. Keys 1-9 cause speedup. 2016-09-18 00:42:34 +02:00
Benelot
f0f694145d Implement TimeWarpBase.
-------------------------------------
This commit implements speeding up and slowing down examples. The
example can be influenced by the parameters. A separate example will be
added to show off the capabilities of the TimeWarpBase for other
examples. 

The walkers work quite well, a successful evolution was run over night
and reached a walker distance of 7.2m.
2016-09-16 09:49:18 +02:00
Erwin Coumans
567b003654 separate spinning and rolling friction coefficients, exposed in URDF as spinning_friction / m_rolling_friction
improvements in VR demo, add grasper etc.
2016-09-16 00:57:00 +01:00
erwin coumans
32eccdff61 Create project file for BussIK inverse kinematics library (premake, cmake)
URDF/SDF: add a flag to force concave mesh collisiofor static objects. <collision concave="yes" name="pod_collision">
VR: support teleporting using buttong, allow multiple controllers to be used, fast wireframe rendering,
Turn off warnings about deprecated C routine in btScalar.h/b3Scalar.h
Add a dummy return to stop a warning
Expose defaultContactERP in shared memory api/pybullet.
First start to expose IK in shared memory api/pybullet (not working yet)
2016-09-08 15:15:58 -07:00
erwin coumans
62d5b7c5c0 add single step simulation, using 'o' key. use 'i' key to suspend simulation first
default background color a bit darker, to show debug lines
tweaked contact point rendering a bit
2016-08-19 10:30:02 -07:00
Erwin Coumans
ceceaa16be make some changes to make the previous example code changes backward compatible 2016-08-12 14:18:46 -07:00
Erwin Coumans
3c30e2f821 add segmentation mask rendering to TinyRenderer and shared memory API
similar to the zbuffer, but storing the object index (int) instead of float depth
2016-08-11 14:55:30 -07:00
erwin coumans
c28cd03fbd OpenVR controller can pick/drag objects. Instructions, Windows only:
Compile using premake+visual studio, and compile App_SharedMemoryPhysics_VR
Compile pybullet using cmake using cmake -DBUILD_PYBULLET=OFF -DCMAKE_BUILD_TYPE=Release ..
Create a symbolic link from c:\python\dlls\pybullet.pyd to C:\develop\bullet3\cmp\lib\Release\pybullet.dll
App_SharedMemoryPhysics_VR
Run Python. Here are some Python lines to get going:
import pybullet as p
p.connect(p.SHARED_MEMORY)
p.loadURDF("cube.urdf")
p.setGravity(0,0,-10)
p.setRealTimeSimulation(1)

Allow real-time simulation in physics server, add pybullet command setRealTimeSimulation to control it
Mesh decimation (reduce number of triangles/vertices) using a Blender modifier for Kuka IIWA and Husky
Disabled the 'glFlush' commands in GLInstancingRenderer.
Add VR controller methods to examples\CommonInterfaces\CommonExampleInterface.h
Use the ANSI version in Windows file/string operations instead of unicode, hope this doesn't break builds.
2016-07-17 23:50:11 -07:00
Erwin Coumans
e2bdd7dbb1 fix more memory leaks, ImportURDFExample is now leak-free
eliminate all run-time memory allocation (except for mouse-pick/ray-intersection) in ImportURDFExample
2016-07-16 17:40:44 -07:00
Erwin Coumans
10cc6f14cb add option to use hardware OpenGL renderer for synthetic camera 2016-07-12 18:16:13 -07:00
erwin coumans
02582e3a78 shrink down cube size of BasicDemo 10 times (it looked ginormous in VR) from 2x2x2 meter to 0.2
add test for VR HUD/sub-titles
fix issue in previous commit, partial string use %.8s not %8.s
use long long int in b3Clock
fix warning/error in pointer alignment in serialization
Fix pybullet Windows compilation.
(thanks to bkeys/https://github.com/bulletphysics/bullet3/pull/687)
2016-07-09 15:09:09 -07:00
erwin coumans
60d2b99151 Physics runs in a separate thread from rendering in PhysicsServerExample (preliminary)
Improve rendering performance. OpenVR experience is smooth now.
commit needs a bit more testing before pushing in main repo.
2016-07-07 19:24:44 -07:00
erwin coumans
14aa666c6f preparation to receive camera image data from physics server
increase shadowmap world size default to 50 units (meter), 10 units (meter) was too small for most examples.
2016-05-31 10:23:04 -07:00
erwin coumans
f4775c360f Merge branch 'master' of https://github.com/erwincoumans/bullet3 2016-05-19 09:19:44 -07:00
erwin coumans
b961545292 prepare support for VR 2016-05-19 09:19:36 -07:00
Erwin Coumans
fb2134f15f add combobox to select software/opengl rendering to compare 2016-05-18 17:57:13 -07:00