Commit Graph

45 Commits

Author SHA1 Message Date
Chuyuan Fu
3c46e6a584 load deformable object from URDF files 2020-03-31 20:55:47 -07:00
Tigran Gasparian
68d3fb28e0 Adds support for loading user data from URDF files. 2020-01-17 11:55:42 +01:00
erwincoumans
c1e20c448f Implement InMemoryFile for memory caching for fileIO plugin.
Support SDF loading through fileIO plugin.
Replace strcspn by C code (not crossplatform)
Add flag for loadURDF to use color from MTL file (instead from URDF link material)
pybullet.URDF_USE_MATERIAL_COLORS_FROM_MTL and pybullet.URDF_USE_MATERIAL_TRANSPARANCY_FROM_MTL
2018-10-14 12:54:34 -07:00
Erwin Coumans
5f954e2496 backward compatibility fix 2018-10-09 16:25:32 -07:00
erwincoumans
dba239fe8d First pass of load files through an interface (to allow loading from memory, zip file etc). So instead of posix fopen/fread, using CommonFileIOInterface.
A fileIO plugin can override custom file IO operations. As a small test, load files from a zipfile in memory.
Default fileIO implementation is in examples/Utils/b3BulletDefaultFileIO.h
Affects URDF, SDF, MJCF, Wavefront OBJ, STL, DAE, images.
2018-10-08 21:27:08 -07:00
erwincoumans
8aff1fbd49 removed flags from loadURDF command. The flags are already available in m_data->m_flags in BulletUrdfImporter.cpp 2018-10-02 08:39:47 -07:00
mbennice
30d4c4136a Piping through the flag to parse sensors 2018-09-27 09:49:59 -07:00
erwincoumans
ab8f16961e Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
2018-09-23 14:17:31 -07:00
erwincoumans
9553892770 PyBullet / BulletRobotics:
Implement collisionFilterPlugin, use setCollisionFilterPair to enable or disable collision detection between specific pairs of objects.
Also, expose setCollisionFilterGroupMask as PyBullet API and in urdf using the tag <collision group="1" mask="2"/>.
See examples/pybullet/examples/collisionFilter.py for an example.
PyBullet default: Lower the warmstarting factor, for maximal coordinates rigid bodies for more stable simulation.
Add btCollisionWorld::refreshBroadphaseProxy to easier recreate the broadphase proxy without adding/removing objects to the world.
2018-09-12 19:30:49 -07:00
Erwin Coumans
77c332bd88 PyBullet: add option to cache graphics shapes for URDF files, handy for benchmarks with many duplicate robots
See https://github.com/erwincoumans/pybullet_robots ANYmal.py for an example.
PyBullet: Expose p.setPhysicsEngineParameter(solverResidualThreshold=1e-2) (b3PhysicsParamSetSolverResidualThreshold), increases solver performance a lot
PyBullet: Expose p.setPhysicsEngineParameter(contactSlop) Set it to zero, to avoid issues with restitution.
PyBullet: Expose isNumpyEnabled, return True is PyBullet was compiled with NUMPY support for 'getCameraImage'.
PyBullet: Expose p.ChangeDynamics(objectUid, linkIndex, contactProcessingThreshold), to avoid issues of speculative/predictive contacts with restitution.
See also http://twvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming%20Track/Vincent_ROBERT_Track_ADifferentApproach.pdf
2018-05-23 13:26:00 +10:00
Erwin Coumans
84b20bda80 don't use the URDF inertia element, unless flag CUF_USE_URDF_INERTIA is set, not for the diagonal and also not for the inertial frame shift. 2018-05-03 14:24:16 -07:00
erwincoumans
73a4334e30 explicitly remove textures during resetSimulation
move glViewport to Win32Window
2018-02-21 23:22:16 -08:00
erwincoumans
329a1f5a74 PyBullet: move TinyRenderer into a plugin, default statically loaded. You can also dynamically load a render plugin, as shown in renderPlugin.py example. premake has a way to compile the tinyRendererPlugin. 2018-01-17 12:48:48 -08:00
erwincoumans
15a429f1bf premake build system fixes 2018-01-09 12:23:25 -08:00
erwincoumans
e138e85bca allow to enable/disable implicit cylinder conversion through an API
p.loadURDF("r2d2.urdf", flags=p.URDF_USE_IMPLICIT_CYLINDER)
allow to enable/disable deterministicOverlappingPairs through an API
p.setPhysicsEngineParameter(deterministicOverlappingPairs = False)
2018-01-09 10:10:36 -08:00
Erwin Coumans
e97b751781 further work on urdfEditor.py, fix some serialization issues 2018-01-08 12:25:56 -08:00
erwincoumans
ed8de36ffa pybullet: allow to replace existing text, to avoid flickering (remove/add)
allow texture caching (disable using the disable file caching)
2017-10-25 08:15:01 -07:00
erwincoumans
cec8da3d85 Implement first draft of pybullet.createVisualShape and add createVisualShape.py example
add normals to duck.obj for nicer appearance
fix plane100.urdf (so collision shape matches visual shape size)
2017-10-07 18:50:23 -07:00
Erwin Coumans
26d32f2aa8 improve loading performance of large textures:
option to disable tinyrenderer, use p.configureDebugVisualizer(p.COV_ENABLE_TINY_RENDERER,0)
also make sure to use p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0) before loadURDF, and enable rendering afterwards using p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1)
reorder 2 loops, making the flip texels twice as fast (cache coherency),
single memcpy of entire texture in tinyrenderer, instead of per-pixel copy (memory layout is the same)
add lots of B3_PROFILE timings, to see where time is going
2017-10-06 13:46:24 -07:00
Erwin Coumans
5c5993edcb fix potential memory leaks for concave triangle meshes (<concave=true> or createCollisionShape with flags=1) 2017-08-24 09:16:11 -07:00
Erwin Coumans
226aaedc46 bump up pybullet setup.py version, make B3_NO_PYTHON_FRAMEWORK default on Mac
minor fixes (arg name in header/cpp the same)
2017-08-18 08:53:46 -07:00
Erwin Coumans
a66576f034 revert API to be backward compatible, add b3CreateInProcessPhysicsServerAndConnectSharedMemory
same for BulletURDFImporter constructor
2017-08-16 12:33:25 -07:00
Erwin Coumans
99beb44625 fix build issues in previous commit 2017-08-15 10:46:09 -07:00
Erwin Coumans
aafaa7e33e Expose optional "globalScaling" factor to pybullet.loadURDF and pybullet.loadSDF. This will scale the visual, collision shapes and transform locations.
Fix two_cubes.sdf (was lacking collision shape for second cube)
2017-08-14 14:59:41 -07:00
Erwin Coumans
b23cb1dd2c pybullet.createCollisionShape, createVisualShape, createMultiBody, programmatic creation using ProgrammaticUrdfInterface
(still preliminary, not ready for commit yet, see examples\pybullet\examples\createSphereMultiBodies.py)
2017-06-03 10:57:56 -07:00
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
Erwin Coumans
af6bf8ddc8 plumb URDF/SDF audio_source into PhysicsServerCommandProcessor, allow to play sounds on collision !
See also https://youtu.be/eppOjTfx5Jg for a first test, and this modified URDF how to add sounds:
https://github.com/bulletphysics/bullet3/blob/master/data/plane_with_collision_audio.urdf
Add the --audio flag to enable sound in pybullet/Bullet-C-API
2017-05-01 11:14:09 -07:00
yunfeibai
f062847038 Replace spaces with tabs. 2017-03-29 15:37:33 -07:00
yunfeibai
66a8685816 Merge remote-tracking branch 'upstream/master' 2017-03-29 15:06:15 -07:00
Erwin Coumans
7503418c72 Split Bullet/src/LinearMath/btSerializer.cpp into btSerializer64.cpp to make it easier to rebuild serialization structure.
Add several MSVC optimization flags to cmake.
Bump up VERSION because serialization format changed
Expose btScalar& jointMaxForce, btScalar& jointMaxVelocity to 'getJointInfo2' API, add backwards compatibility to examples\Importers\ImportURDFDemo\URDFImporterInterface::getJointInfo.

pybullet: expose 4 more fields to getJointInfo: jointLowerLimit/jointUpperLimit/jointMaxForce/jointMaxVelocity
fix performance issue in CMD_ACTUAL_STATE_UPDATE_COMPLETED
2017-03-26 13:06:46 -07:00
yunfeibai
50f0cfca9e Add body name when loading urdf. 2017-03-23 10:16:39 -07:00
Oleg Klimov
e8da7bb6f8 URDF loader: fix MuJoCo xml load, also closes #993 2017-03-17 02:11:47 +03:00
erwin coumans
f97cb7002d first version of 'getVisualShapeData' to get visual shape information to allow external renderer with pybullet and shared memory robotics API
b3InitRequestVisualShapeInformation/b3GetVisualShapeInformation in shared memory API
2016-10-18 22:05:28 -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
7633cfb800 prepare robotics learning examples, see examples/RoboticsLearning/b3RobotSimAPI.h
prepare compliant contact work, urdf loading of parameters (see data/cube.urdf)
2016-07-11 00:26:40 -07:00
erwin coumans
f469a2cb49 update to tinyrenderer synthetic camera 2016-05-31 22:55:13 -07:00
Erwin Coumans
b1adc0d9ef avoid API change in URDFImporterInterface
fix .obj texture loading issue
2016-05-24 09:01:03 -07:00
erwin coumans
2fc0358750 Expose a better API to allow any render engine to be used for the physics simulation when loading URDF/SDF files.
See bullet3/examples/Importers/ImportURDFDemo/DefaultVisualShapeConverter.h
Give the kuka_iiwa/model.urdf some blue color, not just orange, to mimick the original a bit better
Preparation for the CMD_CAMERA_IMAGE_COMPLETED command, to expose a virtual camera to the robotics API
2016-05-19 18:37:15 -07:00
yunfeibai
7929bee128 parse root transformation and test loading two robots 2016-05-11 15:52:50 -07:00
Erwin Coumans
e9c6abff47 add initial SDF importer, work-in-progress (still too incomplete to be useful) 2016-05-09 17:25:07 -07:00
Erwin Coumans
f3c7f30684 fix some memory leaks in ImportURDF / PhysicsServerCommandProcessor 2016-04-11 16:42:02 -07:00
erwincoumans
fe92de3e50 add infrastructure float btMultiBodyLink m_jointDamping, m_jointFriction (actual damping/friction is in a separate commit)
add door.urdf for testing damping/friction
2016-03-17 14:54:46 -07:00
erwincoumans
3b9b803683 b3CreateBoxCommandSetColorRGBA: allow to specify color when creating bodies through shared memory API
Parse and use colors from URDF file (single rgba color per link, not per visual)
Rename btMultiBody 'stepVelocities' to 'computeAccelerationsArticulatedBodyAlgorithmMultiDof'
btHashMap, add const Value* operator[]
remove a few more obsolete btMultiBody methods (on the non-multi-dof path)
fix spelling typo in fillConstraintJacobianMultiDof (fil -> fill)
Add mention to Jakub Stepien for his work on btMultiBody
2015-11-06 17:11:15 -08:00
Erwin Coumans
7f4beba7ee add forceFixedBase option for URDF import example 2015-07-07 15:39:36 -07:00
Erwin Coumans
039174a809 add alternative URDF parser that doens't use ROS urdf 2015-06-28 14:09:21 -07:00