Programmatically set the revolute (hinge) joint limits?

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

Programmatically set the revolute (hinge) joint limits?

Post by mcarr »

Hey, thanks again for this great module. There are a number of robotics examples featuring a hinge joint with limits. In the URDF files these are easily implemented, like for example:

<joint axis="0 0 1" name="hip_1" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>

Here, the hinge joint in implemented in Bullet as a revolute joint with a restricted angular range of (-40, 40) degrees. When I make similar joints programmatically with pb.createMultiBody(), I can't see any way to specify the limits on the revolute. You can query them with pb.getJointInfo(), with these settings mapping to the jointLowerLimit, and jointUpperLimit variables. But there doesn't appear to be an equivalent pb.setJointInfo() function.

Is there a way to programmatically set the revolute (hinge) joint limits when creating a robot with pb.createMultiBody()?
adipandas
Posts: 2
Joined: Sun Nov 03, 2019 11:29 pm

Re: Programmatically set the revolute (hinge) joint limits?

Post by adipandas »

Hello @mcar,
Were you able to find solution to this? Is it possible to set joint limits using createMultiBody?
Thanks.
beichun
Posts: 1
Joined: Sun May 31, 2020 8:03 am

Re: Programmatically set the revolute (hinge) joint limits?

Post by beichun »

I'm looking for a solution to this as well. Has anyone been able to solve it?
mcarr
Posts: 4
Joined: Sun Feb 02, 2020 9:33 pm
Location: Oxford, UK

Re: Programmatically set the revolute (hinge) joint limits?

Post by mcarr »

Unfortunately I haven't found a solution yet. From what I can see the functionality we need is in the C API but not exported to pyBullet. It is however supported through the URDF interface. So as long as you are prepared to monkey around with URDF files, you can get around this issue.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Programmatically set the revolute (hinge) joint limits?

Post by Erwin Coumans »

This is currently not exposed/supported.
See https://github.com/bulletphysics/bullet3/issues/2810 for progress/updates.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Programmatically set the revolute (hinge) joint limits?

Post by Erwin Coumans »

adipandas
Posts: 2
Joined: Sun Nov 03, 2019 11:29 pm

Re: Programmatically set the revolute (hinge) joint limits?

Post by adipandas »

Erwin Coumans wrote: Wed Jul 08, 2020 6:06 pm I implemented it now: See https://github.com/bulletphysics/bullet3/pull/2919
Awesome.
Thank you.
mcarr
Posts: 4
Joined: Sun Feb 02, 2020 9:33 pm
Location: Oxford, UK

Re: Programmatically set the revolute (hinge) joint limits?

Post by mcarr »

Erwin Coumans wrote: Wed Jul 08, 2020 6:06 pm I implemented it now: See https://github.com/bulletphysics/bullet3/pull/2919
Thank you!
Post Reply