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.63k stars 2.88k forks source link

Simulating a ballbot robot #3284

Closed rshum19 closed 3 years ago

rshum19 commented 3 years ago

Hello,

This is more a question about the capabilities of the physics simulator than an issue with it. I'm trying to simulate a "ballbot" type robot. This is a robot that has a cylindrical body that balances on top of a single spherical wheel [see video]. The two issues that we have faced with other simulators are:

  1. Simulating the connection between the body and the ball
  2. Actuating the ball

    I'm wondering if you think it would be within pyBullet capabilities to simulate such a robot?

Thank you,

erwincoumans commented 3 years ago

Hi, you could attach the ball to the robot torso using a spherical joint. This spherical joint can be actuated in various ways, for example explicit PD control, implicit (stable) PD control or using a spherical joint motor. See this example how to configure this: https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/examples/humanoidMotionCapture.py An example of a URDF with spherical joint is here: https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_data/humanoid/humanoid.urdf

rshum19 commented 3 years ago

Thank you for the prompt response. This is very helpful, the actuation of the spherical joint may be the part I was missing.

rshum19 commented 3 years ago

I was under the impression that URDF did to have the spherical joint type according to http://wiki.ros.org/urdf/XML/joint. Does pyBullet have a special interpreter for this type of joints?

erwincoumans commented 3 years ago

Yes, we reimplemented the URDF parser and added additional features (and not all URDF tags are used). We use Python to enable actuators. Please just check the example I send in previous post.