[ODE] Initial position
Don Burns
don at andesengineering.com
Thu Apr 22 12:32:37 MST 2004
Hi Martin,
Thanks for the quick reply.
On Thu, 22 Apr 2004, Martin C. Martin wrote:
> Hi Don,
>
> Well the nearCallback() you're using looks fine. Can you set a
> breakpoint in it and see what sort of geoms it's called with? Did you
> put the transform geom and/or the individual geoms in the correct space?
> There's an example of transform geoms in the boxstack demo, that'll
> show you how to set it up.
>
Actually, the example I posted used the test_buggy.cpp example and
modified it with the boxstack demo. I replaced the single box, used as
the body of the buggy with composite geometry, as written in the boxstack
demo (nearly cut and paste). (I used an example that I thought would be
familiar code to everyone on this list). The result is good behavior
between the wheels of the buggy and the composite geometry, and between
the wheels and the world, but the composite geometry would not interact
with the ground plane, penetrating it rather than colliding with it.
In my own application, I have a WWI tail dragger aircraft with only two
wheels (joints) at the front. When I drop it on the ground, the aircraft
swings on the wheels below the surface of the ground. The geometry of the
aircraft is a composite of spheres at each of the contact points, but
these don't collide with the ground.
> Are you using a debug build of ODE?
>
I'm not. I'll try this, I assume it will provide a great deal more of
information.
> > How do I translate and orient joints?
>
> Is this before or after the joint is created? If it's before, you need
> to transform the location (the "anchor") and any axes used. The slider
> has a single axis, the universal joint two, etc. You only need to
> rotate axes, not translate them, of course.
>
> If you've already attached the joints, and attached them to two bodies
> (rather than between one body and the world), I don't think you need to
> do anything. The should be relative to the bodies already.
>
This is the case. Ok.
> > The behavior is much better now, and works nicely if I leave the
> > orientation with the identity matrix. However, any other orientation
> > still seems to spin the model crazily upon reset.
>
> Hmm, you need to rotate all objects about the same point in the world,
> not about their individual centers. Can you draw your world just after
> you transform the bodies, but before you call dWorldStep(), to make sure
> that things are still connected? You'll want to draw the location of
> the joint, and maybe the joint axes as well.
>
Ok... this was an intersting exercize. This is indeed the problem as when
I translate/rotate my model to a location in space, the rotations seem to
occur only around the individual centers. This puts the joints at
disconnected positions relative to the model.
Aha. The solution, for my particular model, was to cache the offsets
(positions of the wheels relative to the main body) and rotate the
offsets, translating the wheels by the rotated offsets added to the new
translation position.
Thanks for this insight. So the only issue for me now is to solve the
composite geometry collision problem, although I can work around this for
now.
Thank you again!
-don
More information about the ODE
mailing list