Page 1 of 1

How to set joint origin when using pb.createMultiBody()

Posted: Sun Feb 02, 2020 9:40 pm
by mcarr
Hey, thanks for this library.

I'm trying to use the pb.createMultiBody() function to create a basic robot system. As an example I'm trying to recreate the cartpole example from the cartpole.urdf file in some of the examples. I can get the prismatic joint working fine, but I can't get the pole to rotate around the block. Instead it rotates around its centre of mass, a bit like a propeller.

I've been looking through the docs for the Quickstart guide and the pb.createMultiBody() function but I can't see how you pass in the joint origin. In the urdf its the variable in bold:

<joint name="cart_to_pole" type="continuous">
<axis xyz="0 1 0"/>
<origin xyz="0.0 0.0 0"/>
<parent link="cart"/>
<child link="pole"/>
</joint>

Any advice?

Regards, Matt

Re: How to set joint origin when using pb.createMultiBody()

Posted: Fri Feb 21, 2020 9:05 pm
by bullet_team
You can use linkPositions and linkOrientations for this. The naming is confusing, it is the joint origin/orientation with respect to the parent.
(usually the 'link frame' adds the rotation of its own joint, if any)