[ODE] Arbitrarily positioning bodies connected by joints
STenyaK (Bruno González)
stenyak at gmail.com
Mon Jul 23 07:46:37 MST 2007
I'm not sure about this, but IIRC joints need not be moved nor
rotated. As long as you move and rotate the bodies correctly, so that
relative positions/rotations stay the same, joints would behave
properly after that. I don't know what happens when the body is static
(#0), never tried it, but in the case of moving vehicles you'll not be
using static bodies anyway.
I coded it in my car sim long ago; only tried it for initial positions
(before any physic step was computed, that is). The code is prolly
abstracted a bit too much, but maybe it can help you. See lines 695
and below here:
http://motorsport.svn.sourceforge.net/viewvc/motorsport/trunk/src/common/worldObject.cpp?revision=468&view=markup
On 7/17/07, Shamyl Zakariya <shamyl at zakariya.net> 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
>
--
Saludos,
STenyaK
_______________________________________________
Msn/Jabber: stenyak AT gmail.com
ICQ: 153709484
Webs: http://1ksurvivor.homeip.net 1kSurvivor
http://motorsport-sim.org Motorsport
http://emuletutorial.info EmuleTutorial
More information about the ODE
mailing list