What's the best way to pin a rigid body to another rigid body?

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
catwong
Posts: 1
Joined: Tue Aug 20, 2019 4:40 pm

What's the best way to pin a rigid body to another rigid body?

Post by catwong »

A similar question was asked in the Bullet forums - what's the best way to pin a rigid body to another base so that the base can be moved freely, and the rigid body will just move relative to that one (but can still apply forces to other objects.)
I'm trying to implement a basic agent as a spherical mass, with arms 'floating' next to it as base is moved around the world by external forces.
(Occasionally, we'll need to 'magically' move the arms separately by their positions, so we didn't want to use joints directly connecting the arms to the base.)

I've implemented constraints on the arms w.r.t the world (but relative to the base sphere's base position), but these seem to be applying forces that restrict the base itself from moving.

Thanks, new PyBullet user here. :)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: What's the best way to pin a rigid body to another rigid body?

Post by Erwin Coumans »

The best way is to create a new URDF and attach them as a fixed joint. You can use the URDF editor to do this.

See this example how to combine a car and a kuka:
https://github.com/bulletphysics/bullet ... ineUrdf.py

Alternatively, you get some loose coupling (not stiff) using addUserConstraint, which is not recommended in general.
Post Reply