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

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
mcarr
Posts: 1
Joined: Sun Feb 02, 2020 9:33 pm
Location: Oxford, UK

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

Post by mcarr » Sun Feb 02, 2020 9:40 pm

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

bullet_team
Posts: 21
Joined: Mon Oct 28, 2013 12:18 am

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

Post by bullet_team » Fri Feb 21, 2020 9:05 pm

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)

Post Reply