Page 1 of 1

Load File from URDF and convert to Rigidbody (RobotSimulator)

Posted: Thu Apr 11, 2019 12:30 pm
by SorryAmNoob
Hi y'all
First, I wanna apologize for the (probably) stupid question. But I'm a beginner with the Bullet Engine.
What I want to do is the following: In my project I am using b3RobotSimulatorClientAPI.h to set up a world, visualize it and load some objects into it (A plane and the humanoid.urdf, located in the data folder of bullet). As seen in the RobotSimulator App.

Now I need to find a way to constrain movement along one axis for the humanoid character.
I googled around and the solution I stumbled upon the most is to use a Rigidbody and set the setLinearFactor property accordingly. But it seems like I can't create a RB by doing the file import. As in, there is no function or method or anything. Can someone tell me if what I want is even possible?
Thank you.

Re: Load File from URDF and convert to Rigidbody (RobotSimulator)

Posted: Fri Apr 12, 2019 1:38 am
by Erwin Coumans
There is a better way to limit motion for reduced coordinate (btMultiBody):

instead of using a free base, use a fixed base and add additional degrees of freedom to enable motion along the axis you want.

See the biped2d example how this is done: ...

You can also load the URDF as btRigidBody and btTypedConstraints. Just pass the 'useMaximalCoordinates=true' to the loadURDF command. This works in PyBullet and should be easy to expose/enable in the underlying C++ binding. Again, this isn't the best way anymore, using btMultiBody is easier.

Re: Load File from URDF and convert to Rigidbody (RobotSimulator)

Posted: Sat Apr 13, 2019 1:42 pm
by SorryAmNoob
Thank you Erwin Coumans! I will give it a try that way :)
e: ok, sorry. I looked at the biped2d example, but it is not clear to me where this happens in the code. (the "unlocking" of the Y-axis movement).
And this confuses me, since it is pretty short.. Is this set in the .urdf file itself?