bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.45k stars 2.86k forks source link

SPD controller seems only support 3D model #2716

Closed zeshiYang closed 4 years ago

zeshiYang commented 4 years ago

I tried to add spd controller into 2d biped environment. Firstly I used spd controller implemented by python and it works. Then I use the function p.setJointMotorControlMultiDofArray with p.STABLE_PD_CONTROL, but the simulation crashes and the biped model flies to the sky. Since the C++ spd controller are only tested in DeepMimic environment, where the character's root joint are fixed with base. However in biped's urdf file, the base is fixed and the torso are connected with two prismatic joint and a revolute joint. So I delete these joints and use a fixed joint to connect base with torso like DeepMimic, then I use the p.setJointMotorControlMultiDofArray with spd controller and it works again... I think may be there are somthings wrong with C++ spd controller implementation in bullet's source code, so the 2D biped models are not supported... codes.zip

erwincoumans commented 4 years ago

Yes, the stable PD was only implemented for DeepMimic and has some assumptions (floating base for example). There are no resources or plans to work on this anytime soon though. If someone has time to fix it, please reopen. Otherwise try explicit PD instead with a small timestep.