next up previous contents
Next: Robot and mRobot object Up: Reference manual Previous: Squad_prime   Contents

The Robot and mRobot classes

The Robot and mRobot classes are composed of the following data elements:

and the member functions providing the different algorithms implementation (see tables 2.2-2.17).

The Link class (see table 2.1) encapsulates all the data and functionality required to characterize a single ``link'' as it is defined by Denavit and Hartenberg (standard notation [3], or modified notation [4]). It is initialized by providing the joint type (int joint_type: revolute=0, prismatic=1) and the parameters $\theta$, $d$, $a$, $\alpha$ ( Real theta, d, a, alpha) and a boolean value Bool DH (true=standard false=modified) It also contains the inertial parameters data: mass $m$ (Real m), center of mass position vector $\mbox{\boldmath$ r $}$ (ColumnVector r) and inertia tensor matrix $\mbox{\boldmath$ I $}_c$ (Matrix I). In this case, $\mbox{\boldmath$ r $}$ is given with respect to the link coordinate frame and $\mbox{\boldmath$ I $}_{c}$ is with respect to a coordinate frame parallel to the link coordinate frame and located at the center of mass of $m$. The dynamic model takes into account the motors inertia, gear ratio and frictions. The values Im and Gr representing respectively the motors rotor inertia $I_m$ and gear ratio $G_r$; B and Cf representing respectively the motors viscous $B$ and Coulomb friction $C_f$ coefficients:

\begin{eqnarray*}
\tau_{f}& = & B \dot{q} + C_f \mbox{sign}(\dot{q})
\end{eqnarray*}


Table 2.1: The Link class data parameters
Kinematic Inertial Motor
int joint_type Real m Real Im
Real theta, d, a, alpha ColumnVector r Real Gr
Real joint_offset Matrix I Real B
ColumnVector p     Real Cf
Matrix R,        
Bool DH        

On initialization, the constructor sets up the matrices $\mbox{\boldmath$ R $}$ and $\mbox{\boldmath$ p $}$ such that

$\displaystyle \mbox{\boldmath$ R $}$ $\textstyle =$ $\displaystyle \left[\begin{array}{ccc}
\cos \theta & -\cos \alpha \sin \theta &...
...& -\sin \alpha \cos \theta \\
0 & \sin \alpha & \cos \alpha \end{array}\right]$ (2.28)
$\displaystyle \mbox{\boldmath$ p $}$ $\textstyle =$ $\displaystyle \left[\begin{array}{c} a \cos \theta   a \sin \theta   d \end{array}\right]$ (2.29)

for the standard D-H notation and
$\displaystyle \mbox{\boldmath$ R $}$ $\textstyle =$ $\displaystyle \left[\begin{array}{ccc}
\cos \theta & -\sin \theta & 0 \\
\cos ...
...n \alpha \sin \theta & \sin \alpha \cos \theta & \cos \alpha \end{array}\right]$ (2.30)
$\displaystyle \mbox{\boldmath$ p $}$ $\textstyle =$ $\displaystyle \left[\begin{array}{c} a   - d \sin \alpha   d \cos \alpha \end{array}\right]$ (2.31)

for the modified D-H notation.

If the link corresponds to a revolute (prismatic) joint, then only $\theta$ ($d$) can be changed after the link definition. This is done through the member function transform which sets the new value of $q$ ($\theta$ or $d$) and updates the matrices $\mbox{\boldmath$ R $}$ and $\mbox{\boldmath$ p $}$ which compose the link homogeneous transform:

$\displaystyle \mbox{\boldmath$ T $}$ $\textstyle =$ $\displaystyle \left[\begin{array}{cc}
\mbox{\boldmath$ R $} & \mbox{\boldmath$ p $} \\
0 & 1 \end{array}\right]$ (2.32)

Only the changing elements are computed since the data of an instance of a class is persistent throughout the scope of definition of the instance (see [5]). In standard notation, the elements (3,2) and (3,3) of $\mbox{\boldmath$ R $}$ provide storage for $\cos \alpha$ and $\sin
\alpha$ which are computed only once. In modified notation, the elements (3,3) and (2,3) of $\mbox{\boldmath$ R $}$ provide storage for $\cos \alpha$ and $\sin
\alpha$. So as to make the implementation faster, only the elements of $\mbox{\boldmath$ R $}$ and $\mbox{\boldmath$ p $}$ involving $\theta$ ($d$) are updated with a revolute (prismatic) joint.



Subsections
next up previous contents
Next: Robot and mRobot object Up: Reference manual Previous: Squad_prime   Contents
Richard Gourdeau 2004-07-06