Let us transform the equations of the recursive Newton-Euler algorithm into body coordinates. The quantities $v _i, a _i, S _i, I _i, f _i$ and $f _i^B$ are now all considered to be expressed in body $i$ coordinates. Note that the system model already supplies $S _i$ and $I _i$ in these coordinates. Expressed in body coordinates, Eqs. 7 and 8 become
Equation 14:
$$ v _i={ }^i X _{\lambda(i)} v _{\lambda(i)}+ S _i \dot{ q }_i \quad\left( v _0= 0 \right) $$
and
Equation 15:
$$ a _i={ }^i X _{\lambda(i)} a _{\lambda(i)}+ S _i \ddot{ q }_i+\stackrel{\circ}{ S }_i \dot{ q }_i+ v _i \times S _i \dot{ q }_i . \quad\left( a _0=- a _g\right) $$
Compared with the original equations, the following changes have been made: a coordinate transform has been inserted to transform $v _{\lambda(i)}$ and $a _{\lambda(i)}$ from body $\lambda(i)$ coordinates to body $i$ coordinates; and the matrix $\dot{ S }_i$ has been replaced with $\stackrel{\circ}{ S }_i+ v _i \times S _i$, where $\stackrel{\circ}{ S }_i$ is the apparent derivative of $S _i$ in body coordinates. We have also taken the opportunity to replace the original initial acceleration value with $a _0=- a _{ g }$ to simulate the effect of gravity.
The joint calculation routine, jcalc, is able to supply the quantities $S _i, v _{ J i}= S _i \dot{ q }_i$ and $c _{ J i}=\stackrel{\circ}{ S }_i \dot{ q }_i$, all in body $i$ coordinates. We therefore modify Eqs. 14 and 15 as follows, in order to exploit the available data:
Equation 16:
$$ v _{ J i}= S _i \dot{ q }_i $$
Equation 17:
$$ c_{ J i}=\dot{ S }_i \dot{ q }_i $$
Equation 18:
$$ v _i={ }^i X _{\lambda(i)} v _{\lambda(i)}+ v _{ J i} \quad\left( v _0= 0 \right) $$
Equation 19:
$$ a _i={ }^i X _{\lambda(i)} a _{\lambda(i)}+ S _i \ddot{ q }_i+ c _{ J i}+ v _i \times v _{ J i} . \quad\left( a _0=- a _g\right) $$
Equation 10:
$$ f _i= f _i^B- f i^x+\sum{j \in \mu(i)} f _j $$
Equations 9 and 11 remain unchanged in the body-coordinates version, but Eq. 10 becomes
Equation 20: