[ODE] ODE joint internals
Matthew D. Hancher
mdh at email.arc.nasa.gov
Thu Mar 18 15:01:36 MST 2004
Jon wrote:
> When the configuration changes, nuke the old ODE representation of
> the robot, and call a function that re-generates the ODE
> representation of the robot from scratch.
An interesting suggestion; I suppose it is true that for a complex
simulation the cost of blowing the whole thing away and rebuilding
it should be small compared to the cost of collision and stepping.
It seems to me that this presents its own set of problems though. The
only way to get things like the relative rotation (which translates
into joint angle) of all the joints to be identical is to build the
joints in the same position and orientation that they were built last
time (and thus the same position and orientation that they were built
the first time). This will be different from the position and
orientation that they are in at the current time. So I have to load
up all the bodies into their initial positions, build the joints, and
then relocate the bodies to their current positions. (Am I missing
something? Is this really what you have to go through right now to
reload ODE state completely, setting all the positions and
orientations twice?)
Assuming I'm not just confused, this gets even messier when I merge
bodies. Now some of the joints attached to the body were made with
the body in one position and others were made with it in another
position. So if I've merged many bodies into one I may have to move
that body around lots of times as I construct its joints, if I really
want to get the all the joints bitwise identical.
It seems like this whole mess (or at least much of it) could be
alleviated if the joints exposed their state in body-local
coordinates. That's how they're keeping it internally, after all.
I would only have to add a few more functions to the API, so
perhaps that the cleanest solution to my immediate problem: always
construct, save, and reload joint parameters in body-local
coordinates.
Maybe I should just relax and not care if things aren't quite bitwise
identical after the reconstruction; lord knows there are other sources
of numerical error kicking around already. But I don't like that,
especially since I worry that the error could build up over a long
string of connected bodies.
Or is there something I'm missing that makes rebuilding a world with
identical joint parameters easier?
mdh
> > ** I need to be able to switch out one of the Bodys connected to a
> > Joint while leaving the other joint parameters (such as anchor
> > and axis positions, relative rotations, etc.) unchanged as viewed
> > in global coordinates, even though the new Body's position and
> > orientation may be different. **
>
> I suggest tracking your configuration data separately from ODE. When
> the configuration changes, nuke the old ODE representation of the
> robot, and call a function that re-generates the ODE representation
> of the robot from scratch. This is much easier to implement, debug,
> and make robust. If you need to preserve joint angles, velocities,
> etc, th en give each of your piece joints an internal ID, extract
> parameters-per-ID before nuking, and re-apply whatever ID s are
> re-used after re-construction.
>
> Cheers,
> / h+
More information about the ODE
mailing list