# [ODE] rotation matrices

Doron Tal dtal at email.arc.nasa.gov
Sat Oct 15 14:30:46 MST 2005

```Hi,

Do not use angular velocity.  Use only the body's
translation and rotation in world frame, given by the ODE
access functions, and the point's translation relative to
the body, which is assumed fixed.

If your system is of points only (no lines, planes or volumes),
then:

For each point, you need to know its translation relative to
the body, T_pb = (x, y, z) -- this value is fixed, assuming that
the points do not change in time with respect to the body.  The
notation 'T_pb' above is meant to show that you're dealing with
the translation of point 'p' relative to body 'b'.

At each timestep, grab the body's world-frame (inertial frame)
rotation and translation {R_bw, T_bw}, using the ODE functions
dBodyGetPosition/Rotation().  Now loop over all points of your
system and for each point, compute the new point's location in
the world as:

T_pw = R_bw*T_pb + T_bw

which is one matrix-vector multiplication and one vector-vector

-Doron

ps. a good reference on all this stuff is Pennec's IJCV
article around 2002-3 (this should be sufficient info to look
it up)

Floris van Breugel wrote:
> Hi,
>
> I'm trying to attach a system of points (specifically not ODE
> constructs) to an ODE body by means of updating the system's position
> at each time such that any changes in position of the ODE body cause
> the system to move accordingly. In order to completely constrain the
> system I also need to update its rotation relative to the ODE body  such
> that it appears to be fully 'attached'. I was wondering what the
> easiest way would be to update the position of these points so they
> stay the same relative the ODE body. I've tried using the angular
> velocity of the body to calculate necessary velocities for the  points,
> but could not get that too work. Is there an easy way of  using the
> rotation matrices to accomplish this?
>
> Thanks,
>
> - Floris
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

--
Best Regards,

-Doron

Doron Tal, USRA/RIACS Research Scientist
NASA Ames Research Center, Mailstop 269-3
Moffett Field, CA 94035-1000, USA
email: dtal at email.arc.nasa.gov
Tel: 650-604-4530
```