Commit Graph

865 Commits

Author SHA1 Message Date
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
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
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