[ODE] Arbitrarily positioning bodies connected by joints

Beau Albiston albiston at cynergy.com
Wed Jul 25 20:08:05 MST 2007

I wrap ODE in a way similar to what Jon Watte has mentioned in another thread.  My wrapper objects are translated into the ODE equivalent when the simulation starts or when something major changes during the simulation.  With that system in place, I added a "structure" object that manages collections of bodies, shapes (geoms), and joints, and allows me to move and rotate these collections arbitrarily.  Of course, since I have a wrapper over ODE, I can handle the nuances of ODE setup internally.  In fact, I can completely exchange the ODE back-end for anything else, Bullet, PhysX, and so on, and retain the same behavior on my side.

BTW: You just need to move the joint anchor with the bodies and geoms.  I think some joints will also require that you set the axes parameters again.


Ignacio García Fernández wrote:
> I have done something similar. Here's what I would do:
> 1. Detach all joints by dJointAttach(jointID,0,0);
> 2. Move all bodies to an ideal position, where the joints are perfectly 
> satisfied, and close to the new position;
> 3. Attach again all joints;
> 4. Place all bodies in the new position, and also adapt velocities (rotating 
> them).
> The tricky point is (2) as a position 'close to the new position' has many 
> possibilities, and each election can give different results. Here it comes 
> your knowledge about the problem.
> I've used this for situations where velocities were low. If you succeed, I'll 
> be happy to know about it.
> Best regards.
> Ignacio
> El Saturday 21 July 2007 00:01:45 Shamyl Zakariya escribió:
>> Have I asked the question poorly?
>> I can't imagine that nobody here has ever tried to *move* a
>> collection of bodies connected by joints.
>> In the past, I've just assembled things on the fly at the position
>> and orientation I want them to start at, but it seems very useful to
>> me to be able to build something at one place, and then arbitrarily
>> transform it later.
>> shamyl at zakariya.net
>>      "obviously, you're not a golfer"
>>          -- the Dude
>> On Jul 17, 2007, at 10:44 AM, Shamyl Zakariya wrote:
>>> I'm interested in being able to move a set of bodies connected by
>>> arbitrary joints. That is to say, I want to be able to assemble them
>>> at, for example the origin, and then move the whole thing to some
>>> arbitrary position and orientation later. For example I might
>>> assemble a "car" and then move it to where I want it to go.
>>> I'm able to move all the bodies retaining their positions in relation
>>> to one another. But, unfortunately, the joints go bonkers to varying
>>> degrees. The best behaved is the ball joint, which ( I guess )
>>> considers its position to be relative to the parent. But other
>>> joints, such as hinge and slider seem to freak out a little.
>>> Just to clarify, when I move the bodies I zero out all forces on
>>> them. I've verified that if I move a bunch of bodies that aren't
>>> connected by any joints they *do* retain their relative positions
>>> correctly. So the issue is that the joints don't seem to enjoy being
>>> suddenly moved/oriented.
>>> My current approach is simply to not do anything to the joints, and
>>> assume (hope) that ode considers their attachment points in the
>>> coordinate systems of the bodies they connect. But as I've described,
>>> this doesn't really work. I've considered destroying the joints,
>>> performing the move, and the re-creating them, but this may change
>>> their zero-points since a connected system ( two bodies connected by
>>> a "servo", for example ) may have moved before I positioned it.
>>> Any suggestions for me?
>>> Shamyl Zakariya
>>> 	- hobo-raconteur
>>> _______________________________________________
>>> ODE mailing list
>>> ODE at ode.org
>>> http://ode.org/mailman/listinfo/ode
>> _______________________________________________
>> ODE mailing list
>> ODE at ode.org
>> http://ode.org/mailman/listinfo/ode

More information about the ODE mailing list