Commit Graph

1071 Commits

Author SHA1 Message Date
erwincoumans
9408e4f2d0 Expose anisotropic friction, add snake demo. Simple snake slither locomotion from > 15 years ago, thanks to Michael Ewert @ Havok!
Visit http://www.snakerobots.com to see one of these in the wild
2019-03-07 21:13:00 -08:00
Erwin Coumans
bd0501d3fc fix example meshScale 2019-03-02 12:11:59 -08:00
Erwin Coumans
3997ac2b61 fix issue with retina scale and picking in createVisualShape.py example 2019-03-02 12:08:25 -08:00
erwincoumans
4d711ed411 Merge remote-tracking branch 'origin/physx' into physx_clean 2019-02-28 17:52:59 -08:00
erwincoumans
2ae03f50b1 revert to original humanoidMotionCapture.py example. Add a showJointMotorTorques variable (false by default) 2019-02-27 10:01:54 -08:00
erwincoumans
8e1c1448ab Expose motor drive torque reporting for motors in spherical joints in getJointStateMultiDof. 2019-02-27 09:54:12 -08:00
Erwin Coumans
03e897d1f5 replace deep_mimic policies by versions trained using PyBullet, backflip works better now. 2019-02-24 20:12:18 -08:00
erwincoumans
a9996088c8 Implement PyBullet.getCameraImage for PhysX backend.
PhysX backend, allow arbitrary plane normal, a few other fixes.
2019-02-24 14:09:42 -08:00
erwincoumans
9ecc1cc485 Implement CustomProfilerCallback, hooking up to Bullet profiling
test dominoes
2019-02-22 09:17:55 -08:00
erwincoumans
71b1191947 texture caching and geometry caching (PhysX) for much faster loading of many same objects, helps benchmarking/comparison.
add command-line args for PhysX (numCores=..., solver=tgs, )
2019-02-21 19:24:18 -08:00
erwincoumans
3bf27cf8f2 implement rudimentary contact callback. Does PhysX have a way to report ALL contact points, every frame, so we can update contact forces etc, and report all contacts? 2019-02-20 21:38:37 -08:00
erwincoumans
adf31c8f64 remove PhysXClient.*, it was not needed (use PhysicsDirect instead) 2019-02-20 19:57:10 -08:00
Erwin Coumans
6d2ed912f5 Merge remote-tracking branch 'bp/master' 2019-02-18 19:11:03 -08:00
erwincoumans
7e5ac33cf1
Merge pull request #2105 from Somedaywilldo/master
Add Human3.6M Support for deep_mimic Environment
2019-02-18 18:07:47 -08:00
erwincoumans
bdf9b10246 more work on pybullet_envs.deep_mimic.
allow btMultiBody to not wakeup (for some RL experiments)
move deep_mimic motion files to data/motions folder, so we can use the args files unmodified.
2019-02-18 17:57:02 -08:00
erwincoumans
79a273f644 deep_mimic: add option for spherical joint drive motor, next to stable PD control
(existing policies won't work with those motors, needs tuning and re-training)
2019-02-12 20:42:05 -08:00
erwincoumans
85ee4c2934 allow batch creation of objects through PyBullet.createMultiBody, see createMultiBodyBatch.py example.
expose minGraphicsUpdateTimeMs through PyBullet.connect(p.GUI, options="minGraphicsUpdateTimeMs=32000"), by default OpenGL rendering runs at 4000microseconds intervals.
allow a maximum of 128k objects
fix meshScale for PyBullet.createCollisionShape for custom mesh
expose Pybullet.setPhysicsEngineParameter(minimumSolverIslandSize=...), larger minimum batches group solver constraints together in the same island, to reduce calling overhead (even if they are not related)
2019-02-12 10:36:01 -08:00
Somedaywilldo
59d58ce430 add Human3.6M support for deep_mimic env 2019-02-13 00:13:56 +08:00
bla
a94a24959f add deep_mimic pre-trained policies 2019-02-11 11:06:15 -08:00
Erwin Coumans
aaae366a21 towards python 2.x support for deep_mimic (still issue with Logger.print2) 2019-02-11 10:03:26 -08:00
Erwin Coumans
786ddec076 disable GUI in deep_mimic, it slows down too much on Mac OSX 2019-02-11 09:44:59 -08:00
Erwin Coumans
30290dfba1 add missing __init__.py for pip 2019-02-11 09:20:44 -08:00
Erwin Coumans
2728294c53 more fixes in deep_mimic env 2019-02-11 09:15:42 -08:00
Erwin Coumans
1bd201eb43 fixes in PyBullet deep_mimic to allow running in pip version 2019-02-11 08:51:07 -08:00
erwincoumans
12e6478689
Merge pull request #2103 from erwincoumans/master
PyBullet deep_mimic backflip re-using original DeepMimic policy from Jason Peng
2019-02-11 05:45:21 -08:00
erwincoumans
d4292fdac3 PyBullet deep_mimic fix computeAngVelRel 2019-02-10 21:37:34 -08:00
erwincoumans
bb15800964 add pre-trained backflip policy thanks to Jason Peng from https://github.com/xbpeng/DeepMimic 2019-02-10 21:06:00 -08:00
erwincoumans
be20ed6aa2 remove obsolete deep_mimic files (use the one in deep_mimic/env)
add plane_implicit.urdf
2019-02-10 21:04:28 -08:00
erwincoumans
9bddca873c allow pybullet_envs.deep_mimic.testrl --arg_file run_humanoid3d_backflip_args.txt to perform a backflip. Can only backflip twice, then drops on ground.
this deepmimic is still very slow, due to slow mass matrix/inverse dynamics computation. once spherical motor drive is enabled, it should be fast(er)
move pd_controller_stable to pybullet_utils for easier re-use
add plane_transparent.urdf to pybullet_data
allow spacebar in keyboardEvents (Windows for now)
2019-02-10 20:56:31 -08:00
erwincoumans
b574a360f5
Merge pull request #2055 from xantares/pybullet
Pybullet enhancements
2019-02-10 20:25:47 -08:00
erwincoumans
28c9ea3aad PyBullet: add domino asset and example 2019-02-10 19:44:39 -08:00
erwincoumans
054c0b8e58 PyBullet+PhysX backend: expose getJointState reading link position/velocity 2019-02-05 10:24:41 -08:00
erwincoumans
42369aa47d PyBullet.changeDynamics: expose jointDamping
PyBullet: Implement a few more APIs of PhysX backend, resetJointState and setJointMotorControl2
allow useMaximalCoordinate=True for PhysX loadURDF (only for single rigid bodies, articulations require reduced coordinates at the moment)
2019-02-04 21:06:43 -08:00
Erwin Coumans
2eace2f715 update mpi usage 2019-02-01 19:20:08 -08:00
Erwin Coumans
176edeff1e add mpi_run version (not working yet) 2019-02-01 17:57:31 -08:00
Erwin Coumans
6c42cd3e1b add policy 2019-02-01 17:45:50 -08:00
Erwin Coumans
1cef924973 deepmimic fix: reference initialization wasn't spread over all frames 2019-02-01 17:18:13 -08:00
Erwin Coumans
7cc2685faf enable deepmimic training on mac 2019-02-01 16:24:48 -08:00
erwincoumans
63e781b88b PyBullet env for DeepMimic (preliminary work-in-progress) 2019-01-31 21:32:51 -08:00
erwincoumans
5d871806eb enable stable PD plugin in premake4.lua PyBullet
add a normalize in the setRotation axis/angle to be sure.
Add more code from the DeepMimic project, training doesn't work yet.
2019-01-31 21:31:26 -08:00
Erwin Coumans
b257bd731b PyBullet: allow createVisualShape to pass vertices, indices, normals and uv coordinates. This can be combined with changeVisualShape to set the texture. 2019-01-29 12:03:11 -08:00
Erwin Coumans
63683e8f02 fix Issue 2039 2019-01-28 16:24:44 -08:00
Erwin Coumans
0818112ede fix some gym envs 2019-01-28 16:21:52 -08:00
erwincoumans
c97d1041ed
Merge pull request #2037 from araffin/update-gym
Update gym envs
2019-01-28 10:14:09 -08:00
Erwin Coumans
0e4d6b0376 tweak premake files for ExampleBrowser, allow non-GUI mode for humanoidMotionCapture 2019-01-28 07:35:57 -08:00
erwincoumans
505cb15600 proto2csv 2019-01-27 12:11:40 -08:00
erwincoumans
6c2568bf5e PyBullet Minitaur: Fix Minitaur logging (binary file)
PyBullet Minitaur: Add minitaur_raibert_controller_example.py
2019-01-27 11:37:35 -08:00
erwincoumans
a6244d714e more PyBullet PhysX preliminary work. 2019-01-25 10:14:54 -08:00
erwincoumans
03549ca7c6 pass force as array instead of value 2019-01-23 17:24:10 -08:00
erwincoumans
225db2e385 Merge remote-tracking branch 'bp/master' 2019-01-23 08:55:38 -08:00
erwincoumans
e02f82f172 fix some memory leaks in PyBullet.resetJointStateMultiDof and setJointMotorControlMultiDof
Fixes Issue 2065
2019-01-23 08:54:17 -08:00
Maxime Busy
b4eca192fb Parse physicsClientId before calling getPhysicsClient 2019-01-23 12:02:17 +01:00
erwincoumans
ae8e83988b Add preliminary PhysX 4.0 backend for PyBullet
Add inverse dynamics / mass matrix code from DeepMimic, thanks to Xue Bin (Jason) Peng
Add example how to use stable PD control for humanoid with spherical joints (see humanoidMotionCapture.py)
Fix related to TinyRenderer object transforms not updating when using collision filtering
2019-01-22 21:08:37 -08:00
xantares
e793bd22bb
Cancel built time print changes 2019-01-15 10:24:11 +01:00
Michel Zou
fd40544637 On OSX link with dynamic_lookup 2019-01-12 11:36:28 +01:00
Michel Zou
46e2d280a8 Print build time only in debug mode 2019-01-11 21:57:41 +01:00
Michel Zou
ea515048e9 OSX Python extension is .so 2019-01-11 21:57:41 +01:00
Michel Zou
04d3b6aee7 Add pybullet install rule 2019-01-11 21:57:38 +01:00
erwincoumans
101429e6a3
Merge pull request #2041 from gsp-27/gsp-27-patch-1
Added code for issue #2036
2019-01-04 07:56:14 -08:00
Erwin Coumans
19aafd5221 PyBullet: handle the switch from fixed base to floating base when changing mass from zero to non-zero 2019-01-03 17:35:12 -08:00
Erwin Coumans
bf9efffa4b Increase mesh allocation for vertices/indices in PyBullet.createCollisionShape
See createMesh.py for an example.

The data has to fit in shared memory, hence the limit on Mac is lower than Windows and Linux:

#ifdef __APPLE__
#define B3_MAX_NUM_VERTICES 8192
#define B3_MAX_NUM_INDICES 32768
#else
#define B3_MAX_NUM_VERTICES 131072
#define B3_MAX_NUM_INDICES 524288
#endif
2019-01-03 16:19:28 -08:00
gaurav pathak
7f73081a89
Added code for issue #2036
Made necessary changes to ```humanoid_deep_mimic_env.py``` file, setting ```initial_frame``` to new position after simulation steps and setting ```SimTime``` using this new initial frame time
2019-01-03 18:17:08 -05:00
Antonin RAFFIN
f9fdf89c06 Fix indentation 2018-12-31 12:52:43 +01:00
Antonin RAFFIN
1c61b629e3 Fix formating issues 2018-12-31 12:48:42 +01:00
Antonin RAFFIN
0df3527884 Fix gym deprecation warnings 2018-12-28 14:30:05 +01:00
erwincoumans
78de1f070f add example comparing explicit PD control (Python), explicit PD control (plugin), position constraint and stable PD control (Python) 2018-12-19 20:12:19 -08:00
erwincoumans
192d27743a enable pybullet.calculateInverseDynamics for floating bodies
Using calculateInverseDynamics with zero target acceleration allows to compute the non-linear dynamics forces (coriolis/gyroscopic) and/or gravity force.
2018-11-27 08:49:56 -08:00
Erwin Coumans
2e30a9565b add humanoid_deepmimic_gym_env.py for HumanoidDeepMimicBulletEnv-v1 (still untested) 2018-11-25 15:33:28 -08:00
erwincoumans
bb6f4fb17c improve the ARS implementation: add multiprocessing Gym environment stepping, add command-line parameters to resume a policy, --render, --movie, --steps, --env 2018-11-24 11:54:36 -08:00
erwincoumans
ca36a82c62 add deepmimic args file (for testing)
implement deepmimic reward function (only joint angles/velocities for now)
fix an out-of-date comment, related to contactPoint.m_lateralFrictionInitialized in btSequentialImpulseConstraintSolver.cpp
2018-11-23 18:32:23 -08:00
erwincoumans
5f0dcb575f add DeepMimic helper utils 2018-11-23 18:01:39 -08:00
erwincoumans
7669fc92c5 add shiftCenterOfMass.py example. 2018-11-23 18:01:00 -08:00
erwincoumans
121cdc91b0 more work on PyBullet implementation of DeepMimic humanoid mimic of motion capture.
b3Quaternion, deal with zero-length axis (in axis,angle constructor)
2018-11-21 11:09:10 -08:00
erwincoumans
f93e4e4553 fix mjcf2urdf.py for Python 3 (utf) and don't export visuals (let it auto-convert from collision element) 2018-11-21 11:07:05 -08:00
erwincoumans
41e28e3587 Add link/joint names for DeepMimic humanoid urdf 2018-11-20 21:40:20 -08:00
Erwin Coumans
bded2968ea add PyBullet.rotateVector method
add missing walk humanoid3d_walk.txt
2018-11-19 10:10:33 -08:00
erwincoumans
f9f8d0fbb0 example for fileIOPlugin.py loading SDF and its assets from a single zipfile,
also show how to disable file caching (used in the fileIOPlugin)
2018-11-17 14:11:01 -08:00
erwincoumans
9e99f5cdbc Expose PyBullet.calculateVelocityQuaternion, getAxisAngleFromQuaternion, getQuaternionFromAxisAngle, getDifferenceQuaternion
Add preparation for DeepMimic humanoid environment, replicating parts of https://github.com/xbpeng/DeepMimic
Loading humanoid.urdf and applying motion action: examples/pybullet/gym/pybullet_envs/mimic/humanoid.py
Loading MotionCapture data: examples/pybullet/gym/pybullet_envs/mimic/motion_capture_data.py
Little test: examples/pybullet/gym/pybullet_envs/mimic/humanoid_test.py
2018-11-16 17:29:03 -08:00
erwincoumans
7dd524075c Implement btMultiBodySphericalJointMotor, able to track a quaternion position target.
Expose this btMultiBodySphericalJointMotor through PyBullet.setJointMotorControlMultiDof
Expose PyBullet.getQuaternionSlerp
Improve PyBullet.setJointMotorControlMultiDof
Improve humanoidMotionCapture.py with slerp and using setJointMotorControlMultiDof
Expose  btMultiBody::spatialTransform
Fix btMultiBody::setupPlanar from DeepMimic codebase
Add support for multidof joints in btMultiBody::compTreeLinkVelocities, thanks to DeepMimic codebase @xbpeng
2018-11-13 14:32:18 -08:00
erwincoumans
a06b5de7b6 add converted humanoid from DeepMimic (https://github.com/xbpeng/DeepMimic,
thanks to Jason Peng), and motion capture playback example.
See also https://www.youtube.com/watch?v=vw3EKnKrgqw
2018-11-11 20:15:47 -08:00
erwincoumans
0b2142414d fix usage of btMultiBody::setJointPosMultiDof/setJointVelMultiDof 2018-11-11 19:04:07 -08:00
erwincoumans
17219f84c6 make setJointPosMultiDof and setJointVelMultiDof argument const.
add PyBullet.resetJointStateMultiDof / getJointStateMultiDof, for preliminary support for spherical and planar joints
2018-11-10 14:26:31 -08:00
erwincoumans
49b098854e PyBullet: avoid calling syncBodies for each DOF in pdControl.
Allow PD_CONTROL in setJointMotorControlArray.
2018-11-07 09:29:19 -08:00
Erwin Coumans
8b53e47fe8 add simpler ARS implementation, thanks to Alexis Jacq and Hadelin de Ponteves
(will add save/restore of policy and rendering movies through command-line arguments soon)
2018-11-02 11:19:46 -07:00
Erwin Coumans
f6ea2a7379 fix a potential data race condition.
remove createObstacleCourse programmatic creation part until we can steam vertices/indices.
2018-11-01 10:20:54 -07:00
Erwin Coumans
131535a99f remove debug stats 2018-10-31 21:24:44 -07:00
Erwin Coumans
8e82de1b00 add rudimentary MuJoCo mjcf xml to ROS URDF file, based on
pybullet_utils.urdfEditor
2018-10-31 11:02:19 -07:00
Erwin Coumans
47b8b98a64 PyBullet: call the right method (although equivalent at the moment) 2018-10-30 22:16:13 -07:00
Erwin Coumans
44976780fa remove ARS files 2018-10-29 19:23:54 -07:00
Erwin Coumans
c2b9dc9361 update to CartPoleBulletEnv-v1 and check with latest baselines v0.1.5, works fine.
(make it more similar to classical control cartpole)
2018-10-29 16:44:12 -07:00
erwincoumans
df9b4fb005 remove printf from demo 2018-10-27 11:56:04 -07:00
Erwin Coumans
bebe12d6d8 tweak tensorflow humanoid_running.py demo to be more robust against mouse dragging
(mouse dragging adds energy in the system that can cause explosions/instability):
use solverResidualThreshold and increase number of sub steps, also clamp the max force.
2018-10-27 11:48:21 -07:00
Erwin Coumans
0511a36a67 add Laikago quadruped model, thanks to Unitree for the cad meshes.
If you use the Laikago URDF, please add a citation to PyBullet:

@MISC{coumans2018,
author =   {Erwin Coumans and Yunfei Bai},
title =    {PyBullet, a Python module for physics simulation for games, robotics and machine learning},
howpublished = {\url{http://pybullet.org}},
year = {2016--2018}
}
2018-10-26 18:49:58 -07:00
erwincoumans
a44df2b0a6 PyBullet: allow to pass vertices (for convex) and vertices+indices (for concave) to createCollisionShape
See createObstacleCourse.py for an example use. At the moment a limit of 1024 vertices and 1024 indices.
Will be lifted once we implement the streaming version (soon).
2018-10-26 10:18:51 -07:00
Erwin Coumans
2d224cf319 revert backward compabitility in API 2018-10-20 19:44:39 -07:00
erwincoumans
ed49edc1af PyBullet change API (since it was broken): pybullet_changeVisualShape with textureUniqueId ==-1 will clear the texture
b3InitUpdateVisualShape doesn't take textureUniqueId by default. new API b3UpdateVisualShapeTexture to change texture (-1 will clear texture)
PyBullet/BulletRobotics: allow to reset the textureUniqueId to -1, to clear a texture
PyBullet/BulletRobotics: save all texture handles
2018-10-20 15:56:56 -07:00
erwincoumans
b5e475aec3 enable planar reflection in MinitaurGymEnv
enable follow cam in other Gym locomotion environments
add testing assets for multi-material obj files -> sdf conversion.
Also use ER_NO_SEGMENTATION_MASK flag for TinyRenderer/EGL plugin renderer
2018-10-14 15:10:19 -07: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
erwincoumans
a24c1436af state 2 of FileIO plugin: adding/removing FileIO types, search through all registered FileIO types.
(not enabled by default yet)
Example:
fileIO = p.loadPlugin("fileIOPlugin")
print("fileIO=",fileIO)
p.executePluginCommand(fileIO,"e:/develop/bullet3/data/plane.zip", [p.AddFileIOAction,p.ZipFileIO])
p.executePluginCommand(fileIO,"e:/develop/bullet3/data/test2.zip", [p.AddFileIOAction,p.ZipFileIO])
planeId = p.loadURDF("plane.urdf")
duckId = p.loadURDF("duck_vhacd.urdf",[0,0,1])
2018-10-11 14:39:31 -07:00
erwincoumans
bb305c6ebc allow to provide rayCastBatch in local 'from'/'to' with a parent/link index, b3RaycastBatchSetParentObject
If parentObjectUniqueId provided, convert local from/to into world space coordinates
AddUserDebugLins: don't block when replacing an item
Fix examples/pybullet/examples/inverse_kinematics.py
2018-10-10 23:31:50 -07:00
erwincoumans
a1543714f1
Merge pull request #1919 from erwincoumans/master
btMultiBody: fix indexing issue causing wrong friction to be reported, remove obsolete BT_PYBULLET_GRPC and PYBULLET_EGL
2018-10-06 19:02:09 -07:00
erwincoumans
c2486bb1a6 add contactFriction.py example 2018-10-06 15:27:56 -07:00
erwincoumans
c0e38cd921
Merge pull request #1896 from jviereck/jviereck_add_lateral_contact_info
Adding support for lateral friction to getContactPoints()
2018-10-06 15:27:14 -07:00
Erwin Coumans
da2ee638ef remove obsolete BT_PYBULLET_GRPC and PYBULLET_EGL 2018-10-05 21:47:13 -07:00
Erwin Coumans
90f002e07d Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-10-05 19:41:10 -07:00
Erwin Coumans
8a0d96edce tweaks in pybullet/examples for Mac OSX 2018-10-05 19:40:52 -07:00
erwincoumans
9a7cc7bcd7 add getCameraImageTest.py to compare GUI (with OpenGL3 GLInstancingRenderer), TinyRenderer and DIRECT+eglPlugin (with OpenGL3 GLInstancingRenderer) 2018-10-05 19:31:03 -07:00
Erwin Coumans
24ca5afe95 reverse ER_SEGMENTATION_MASK to ER_NO_SEGMENTATION_MASK so segmentation
mask is rendered by default
2018-10-04 14:14:24 -07:00
erwincoumans
da37f1d559 add glViewport after call to startRendering (some renderers call glViewport) 2018-10-02 07:49:13 -07:00
erwincoumans
5bcd43711a PyBullet OpenGL/EGL hardware getCameraImage: use glViewport to reduce the glReadPixels calling cost dramatically for small images
PyBullet Allow OpenGL/EGL hardware to render segmentation mask. Use pybullet.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX or pybullet.ER_SEGMENTATION_MASK
PyBullet.removeBody fix indexing bug (use foundIndex, not i)
PyBullet bump up version to 2.2.3
2018-09-30 07:10:40 -07:00
Erwin Coumans
cd2f111a10 update pybullet version, include *.* from OpenGLWindow 2018-09-25 17:06:32 -07:00
Erwin Coumans
f20b7bb07c tweak pole IK demo 2018-09-25 06:22:06 +00:00
Julian Viereck
219dfc757a Adding support for lateral friction to getContactPoints() 2018-09-24 10:03:43 -04: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
b73b05e9fb add getClosestPoints.py example.
allow to perform a getClosestPoints query with a collisionShape and world transform (position, orientation) that isn't part of the world.
(use createCollisionShape to create it)
add optional removeCollisionShape, for collision shapes only used in a query (and not used to create a body)
2018-09-22 14:18:21 -07:00
erwincoumans
cdf8c908ad add getClosestPoints.py example.
allow to perform a getClosestPoints query with a collisionShape and world transform (position, orientation) that isn't part of the world.
(use createCollisionShape to create it)
2018-09-22 13:17:09 -07:00
erwincoumans
616192f80a use grpc port -1 by default in PyBullet. add grpcClient.py and grpcServer.py 2018-09-20 09:07:47 -07:00
erwincoumans
e6d74580c1 add single step rendering feature:
while (1):
    stepSimulation()
    pybullet.configureDebugVisualizer(pybullet.COV_ENABLE_SINGLE_STEP_RENDERING, 1)

disable single step using
pybullet.configureDebugVisualizer(pybullet.COV_ENABLE_SINGLE_STEP_RENDERING, 0)
2018-09-14 17:17:11 -07:00
Erwin Coumans
d909448ee3 bump up pybullet version again 2018-09-12 21:03:07 -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
1efee29c27 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-09-12 08:20:03 -07:00
Erwin Coumans
c83fa30daa use numpy to reshape image data to matplotlib compatible format
fixes issue #1871
2018-09-12 08:19:30 -07:00
Erwin Coumans
23ecbab7b3 fix setup.py and pybullet to work better with eglPlugin on Linux 2018-09-11 13:24:35 -07:00
Erwin Coumans
9fa3e44539 fixes related to egl plugin 2018-09-10 23:31:54 -07:00
erwincoumans
684a9f6a99 move stb_image/stb_image_write.cpp into a cpp file instead of random files with the magic 'STB_IMAGE_WRITE_IMPLEMENTATION' define
move setup.py back to eglRenderer extension, use pkgutil.get_loader('eglRenderer').get_filename()
disable dlmopen by default, unless B3_USE_DLMOPEN is defined.
2018-09-10 23:18:34 -07:00
bla
6992195ba8 add pybullet example for eglRendererPlugin, will use EGL in a plugin on Linux, Win32OpenGLWindow in a plugin on Windows 2018-09-09 23:03:07 -07:00
bla
8f711462e0 fix setup.py to work better on Windows and Linux (with default eglPlugin static built-in,
just use pybullet.loadPlugin("eglRendererPlugin") before loading/creating any objects.
use end/startRendering (swap buffers) before the rendering in the eglPlugin
2018-09-09 22:58:08 -07:00
erwincoumans
dc7feb9027 Merge remote-tracking branch 'bp/master' 2018-09-09 10:48:58 -07:00
erwincoumans
233a7083d1
Merge pull request #1790 from BlGene/egl-plugin
OpenGL render plugin
2018-09-09 09:27:15 -07:00
Joshua Aduol
cc4c02edc7 Fixed bugs mistaking forearm_roll_joint for upper_arm_roll_joint 2018-09-09 00:17:06 +01:00
erwincoumans
63f4a63e15 since parent collision is always disabled by default for self-collision, we add a new flag
URDF_USE_SELF_COLLISION_INCLUDE_PARENT, to force self-collision between direct parent/child (not recommended in general)
2018-09-08 14:46:43 -07:00
erwincoumans
5164f2f9a7 remove pre-build proto/grpc files (they differ for each platform and proto/grpc version) 2018-09-07 15:44:33 -07:00
erwincoumans
0efc67841d allow pybullet to connect to GRPC server. (need to use flag --enable_grpc in premake build system)
add grpcPlugin, it can work in GUI, SHARED_MEMORY_SERVER, DIRECT and other modes.
example script to start server from pybullet:
import pybullet as p
p.connect(p.GUI)
#if statically linked plugin
id = p.loadPlugin("grpcPlugin")
#dynamics loading the plugin
#id = p.loadPlugin("E:/develop/bullet3/bin/pybullet_grpcPlugin_vs2010_x64_debug.dll", postFix="_grpcPlugin")

#start the GRPC server at hostname, port
if (id>=0):
	p.executePluginCommand(id, "localhost:1234")

Only in DIRECT mode, since there is no 'ping' you need to call to handle RCPs:
numRPC = 10
while (1):
	p.executePluginCommand(id, intArgs=[numRPC])
2018-09-05 17:58:14 -07:00
erwincoumans
710e660763
Merge pull request #1855 from erwincoumans/master
more work on grpc/proto/pybullet.proto
2018-09-04 12:11:03 -07:00
erwincoumans
9b66074949 add some missing GRPC files 2018-09-04 09:10:57 -07:00
erwincoumans
9e2f6c7935 more GRPC work 2018-09-03 23:13:15 -07:00
Tigran Gasparian
a670041793 Small fix in executePluginCommand, now you can pass int arguments while keeping floats null without errors. 2018-09-03 10:41:38 +02:00
Max Argus
c1d6c6b07d clean test scripts 2018-08-30 13:24:25 +02:00
Max Argus
bdc0f82a8b added syncronized render test script 2018-08-30 13:24:25 +02:00
Max Argus
e15fb0866c rendertest + parallel pip + no debug for plugin 2018-08-30 13:24:25 +02:00
Max Argus
6e828688e7 activate EGL + add rendertest.py 2018-08-30 13:24:25 +02:00
Erwin Coumans
186ddb81d8 fix tab/space issue in Python file
fix determinism issue introduced in previous commit
2018-08-26 17:17:42 -07:00
Erwin Coumans
ff43cea263 Fix some deactivation issues with btMultiBodyDynamicsWorld, should also improve performance for PyBullet with larger worlds
(even when sleeping is disabled, islands are split)
2018-08-26 16:14:36 -07:00
Erwin Coumans
61b7591b8e expose choice of contraint solver in PyBullet, with switchConstraintSolver example 2018-08-23 23:04:17 -07:00
Erwin Coumans
90e08b41a5 bump up pybullet version 2018-08-09 16:53:11 -07:00
Erwin Coumans
08b5e6d766 add collisionFilterPlugin to pybullet plugin, also apply quat->euler fix for singular cases 2018-07-30 17:53:37 +02:00
Erwin Coumans
2cab56d6ef prepare build system(s) for collisionFilterPlugin 2018-07-27 15:48:24 +02:00
erwincoumans
3d5c921495
Merge pull request #1782 from RanTig/userdata
Changes UserData to use global identifiers and makes linkIndex optional.
2018-07-09 11:36:51 +02:00
Erwin Coumans
f8cc33f3a3 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-07-08 11:24:37 +02:00
Erwin Coumans
127b82ec1b expose texture unique id after loading URD file, so you can restore to the original texture after changing it to a custom texture. See also getTextureUid.py example. 2018-07-08 11:23:12 +02:00
Tigran Gasparian
9c7aa3a863 Changes UserData to use global identifiers and makes linkIndex optional.
This removes the need to specify the body id/link index when retrieving a user data entry.
Additionally, user data can now optionally be set to visual shapes as well.

The following public pybullet APIs have changed (backwards incompatible)
addUserData and getUserDataId
  Makes linkIndex parameter optional (default value is -1)
  Adds optional visualShapeIndex parameter (default value is -1)

getUserData and removeUserData
  Removes required parameters bodyUniqueId and linkIndex

getNumUserData
  Removes required bodyUniqueId parameter

getUserDataInfo
  Removes required linkIndex parameter
  Changes returned tuple from (userDataId, key) to (userDataId, key, bodyUniqueId, linkIndex, visualShapeIndex)
2018-07-03 17:45:19 +02:00
erwincoumans
23f235e449 PyBullet: add example to enable another physics engine backend (DART, MuJoCo) 2018-07-01 14:49:34 -07:00
erwincoumans
0d8564db22 PyBullet: added preliminary DART and MuJoCo backend files, MuJoCo can loadMJCF, stepSimulation and getBasePositionAndOrientation, DART is empty.
PyBullet: add 2d biped example.,
2018-07-01 14:42:32 -07:00
erwincoumans
49b0ec08e1 PyBullet: allow to replace existing debug lines in addUserDebugLine through the replaceItemUniqueId argument
See batchRayCast.py for example usage
2018-06-22 16:47:20 -07:00
Erwin Coumans
092e39a9e5 PyBullet urdfEditor example, use the pybullet_utils version (more up-to-date) 2018-06-22 09:18:55 -07:00
Erwin Coumans
fcde193d52 PyBullet.setPhysicsEngineParameter: only update solverResidualThreshold if valid values is given 2018-06-20 13:18:08 -07:00
erwincoumans
7924d51665 PyBullet: deal with backward compatibility of b3RaycastBatchAddRay:
use b3RaycastBatchAddRays API to enable MAX_RAY_INTERSECTION_BATCH_SIZE_STREAMING num rays.
Old API (b3RaycastBatchAddRay) sticks to 256 rays, MAX_RAY_INTERSECTION_BATCH_SIZE.
2018-06-16 12:28:21 -07:00
erwincoumans
cb1fce7899 revert exposing getSharedMemoryStreamBuffer / adding to command structure
use 16k rays by default
add uploadRaysToSharedMemory method
2018-06-16 08:14:00 -07:00
erwincoumans
23f9250e04 Merge remote-tracking branch 'bp/master' 2018-06-16 06:58:10 -07:00
erwincoumans
d660042d76
Merge pull request #1763 from YunfeiBai/master
Add the pdControlPlugin to the joint control C API, and add the PD co…
2018-06-16 06:57:50 -07:00
erwincoumans
75ec8f3fd9 PyBullet: add batchRayCast.py example 2018-06-16 06:20:15 -07:00
erwincoumans
f517b03534 Expose pushProfileTimer / pop ProfileTimer in PhysicsClient API to benchmark Python parts of PyBullet.
reduce 'm_cooldownTime' from 1000 microseconds to 100 microseconds (overhead in raycast is too large)
If needed, we can expose this cooldown time.
Replace malloc by btAlignedObjectArray (going through Bullet's memory allocator)
2018-06-16 06:19:49 -07:00
erwincoumans
bb8cbcdaae Merge remote-tracking branch 'bp/master' 2018-06-16 06:06:18 -07:00
erwincoumans
5b3e43d4d8
Merge pull request #1760 from RanTig/ParallelRaycasts
Adds multithreading support for batch ray casts.
2018-06-16 05:54:34 -07:00
Alexis David Jacq
6adea4964f
forgot one "isAlive" to change 2018-06-16 14:00:05 +02:00
Alexis David Jacq
50b5edd7b5
isDone instead of isAlive 2018-06-16 13:53:05 +02:00
Erwin Coumans
fbbd675ed6 expose PyBullet API to wakeup/put objects to sleep, enable/disable deactivation
fix wakeup -> reset deactivation clock
2018-06-15 21:26:26 -07:00
YunfeiBai
1c0de3c4cb Add the pdControlPlugin to the joint control C API, and add the PD control mode (also available in pybullet). Modify the pdControl pybullet example to use the PD control mode with setJointMotorControl API. 2018-06-15 17:59:26 -07:00
Alexis David Jacq
292a3f1cf6
methode isAlive
Method def isAlive(self), which defaults to return self._alive < 0, and each environment can override this method (Half Cheetah would implement return False)

(In response to bea468fb93)
2018-06-15 17:55:20 +02:00
Tigran Gasparian
54986593c5 . 2018-06-15 17:46:31 +02:00
Tigran Gasparian
0b1dca3d9c Updates the documentation for the pybullet function rayTestBatch to include the numThreads parameter. 2018-06-15 17:46:12 +02:00
Alexis David Jacq
a57c480f28
Update gym_locomotion_envs.py
As suggested in https://github.com/bulletphysics/bullet3/pull/1759. The default isDone lets done = alive<0, and a special case is made for halfcheetah, forcing done=False. 
I had to pass the 'alive' condition as an additive parameter of WalkerBaseBulletEnv.
2018-06-15 17:38:35 +02:00
Erwin Coumans
976fea4eca fix saveRestoreState.py example 2018-06-15 08:31:39 -07:00
Tigran Gasparian
08409cae9f Adds multithreading support for batch ray casts.
To enable the feature, enable the BULLET2_MULTITHREADING option.

Increases the number of rays that can go in a batch request by storing
them in the shared memory stream instead of the shared memory command.
Adds the API b3RaycastBatchSetNumThreads to specify the number of
threads to use for the raycast batch, also adds the argument numThreads
to the pybullet function rayTestBatch.
Rays are distributed among the threads in a greedy fashion there's a shared
queue of work, once a thread finishes its task, it picks the next
available ray from the task. This works better than pre-distributing the
rays among threads, since there's a large variance in computation time per ray.

Some controversial changes:
- Added a pointer to PhysicsClient to the SharedMemoryCommand struct, this
was necessary to keep the C-API the same for b3RaycastBatchAddRay, while
adding the ray to the shared memory stream instead of the command
struct. I think this may be useful to simplify other APIs as well, that
take both a client handle and a command handle.
- Moved #define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE to
SharedMemoryPublic. This was necessary for the definition of
MAX_RAY_INTERSECTION_BATCH_SIZE.
2018-06-15 16:47:04 +02:00
erwincoumans
25c5e87dc2 PyBullet.loadURDF, expose flags=URDF_INITIALIZE_SAT_FEATURES 2018-06-13 15:35:56 -07:00
Erwin Coumans
e24da97140 revert GJK change yet again, some degenerate case / regression 2018-06-12 19:52:38 -07:00
erwincoumans
4d6741f5cd PyBullet: expose STATE_LOGGING_ALL_COMMANDS and STATE_REPLAY_ALL_COMMANDS
See examples/pybullet/examples/commandLogAndPlayback.py for an example.
2018-06-12 16:56:45 -07:00
erwincoumans
459d07a302 add example for enableSAT, using separating axis test (instead of GJK) for contact between polyhedral convex hull shapes (and convex hull vs triangle in a concave triangle mesh) 2018-06-12 16:10:49 -07:00
erwincoumans
97c6937388 Simplify GJK. Still needs double precision for large differences of feature scales.
Extract faces directly from btConvexHullComputer (in initializePolyhedralFeatures), instead of reconstructing them, thanks to Josh Klint in #1654
PyBullet: use initializePolyhedralFeatures for convex hulls and boxes (to allow SAT)
PyBullet: expose setPhysicsEngineParameter(enableSAT=0 or 1) to enable Separating Axis Test based collision detection for convex vs convex/box and convex versus concave triangles (in a triangle mesh).
2018-06-12 16:08:46 -07:00
Erwin Coumans
e74f86d148 remove ANYmal meshes 2018-06-11 07:44:05 -07:00
erwincoumans
0cec85626f enable more unit tests in PyBullet.
return Py_None if no user data found, to pass the test.
enable m_deterministicOverlappingPairs by default.
if m_deterministicOverlappingPairs, sort the collision pairs.
2018-06-09 12:19:29 -07:00
erwincoumans
72d3f45b05 use new API b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect3 (not 2) 2018-06-05 19:54:08 -07:00
erwincoumans
5ede227e94
Update robot_bases.py
remove print
2018-06-05 19:33:28 -07:00
erwincoumans
b6f5cb4c34 enable pdControlPlugin by default (requires pdControlPlugin.cpp and b3RobotSimulatorClientAPI_NoDirect.cpp)
add pdControl.py example, make pdControlPlugin functional
reduce memory usage
fix examples/pybullet/gym/pybullet_data/random_urdfs/948/948.urdf, fixes issue #1704
2018-06-05 15:59:01 -07:00
erwincoumans
fa648a028e fix a few problems introduced in #1730
https://github.com/bulletphysics/bullet3/pull/1730
2018-06-05 09:16:00 -07:00
erwincoumans
d7cbe8dd26 Merge remote-tracking branch 'bp/master' 2018-06-05 08:15:11 -07:00
Tigran Gasparian
aefd5a9d66 Uses SHARED_MEMORY_SERVER instead of GUI_SERVER when starting a bullet server in the unit test. 2018-06-05 09:28:38 +02:00
Erwin Coumans
7bd84740d7 PyBullet / BulletRobotics: prepare for pdControlPlugin and collisionFilterPlugin
Split examples/SharedMemory/b3RobotSimulatorClientAPI_NoGUI.* and move to examples/SharedMemory/b3RobotSimulatorClientAPI_NoGUI.cpp and examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.cpp
2018-06-05 11:41:41 +10:00
Erwin Coumans
e4cd88e24f PyBullet: allow to choose the shared memory key when starting SHARED_MEMORY_SERVER 2018-06-05 11:36:54 +10:00
Tigran Gasparian
c49e060e81 Starts bullet server when testsuite is ran, uses pybullet_utils to manage clients. 2018-06-04 19:40:16 +02:00
Tigran Gasparian
bb72a91080 Clears the user data cache when syncUserData is called.
Adds unit test for the UserData functons.
Changes the char pointer in btHashString to std::string. There were
problems where the object owning the string memory would deallocate the
string, making the btHashString object invalid.
2018-06-04 15:10:48 +02:00
erwincoumans
b6120e760a PyBullet.addUserData / getUserData / removeUserData / getUserDataId / getNumUserData / getUserDataInfo
See examples/pybullet/examples/userData.py how to use it. TODO: add to PyBullet Quickstart Guide.
Thanks to Tigran Gasparian for the contribution!
2018-06-02 13:40:08 -07:00
erwincoumans
cb6b7a7c38 PyBullet: expose flags to createMultiBody 2018-06-02 11:37:14 -07:00
Erwin Coumans
39c9ffa4c3 PyBullet IK: backward compatible changes related to joint damping 2018-06-01 23:25:47 -07:00
Erwin Coumans
e74cd05e37 add space 2018-05-31 21:21:50 -07:00
erwincoumans
4c75e022c8 Use dofCount and not numJoints in PyBullet.calculateInverseKinematics, fixes null space demo
See baxter_ik_demo at https://github.com/erwincoumans/pybullet_robots
2018-05-31 21:07:04 -07:00
Erwin Coumans
76e88dddc5 add space to make conversion work 2018-05-31 18:16:40 -07:00
erwincoumans
3463d0a879 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-05-31 16:06:33 -07:00
erwincoumans
edc70582dd implement accurate inverse kinematics in C++. PyBullet.calculateInverseKinematics gets "maxNumIterations=20", "residualThreshold=1.04" to tune
allow to provide current joint positions in IK, overriding the body joint positions, also IK target will be in local coordinates.
expose b3ComputeDofCount in C-API
2018-05-31 16:06:15 -07:00
erwincoumans
8567f6bb7c PyBullet: rename sleepObjectAutoDeactivation -> sleeping.py
PyBullet: allow maximal coordinate rigid bodies to sleep/deactivate
2018-05-30 21:14:35 -07:00