Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::IDNewtonEuler Class Reference
[Dynamics]

Inverse dynamics using Newton-Euler. More...

#include <IDNewtonEuler.h>

Inheritance diagram for OSCAR::IDNewtonEuler:

Inheritance graph
[legend]
List of all members.

Public Methods

 IDNewtonEuler (unsigned int dof, const String &linkCGandMassFile, const String &linkInertiaFile, const Vector3D &gravity=Vector3D(0.0, 0.0,-9.8))
 IDNewtonEuler (unsigned int dof, const MatrixData &linkCGandMass, const TensorData &linkInertia, const Vector3D &gravity=Vector3D(0.0, 0.0,-9.8))
virtual ~IDNewtonEuler ()
bool SetBaseJointType (char jointType)
bool SetLocalTransformations (const Xform *transformations)
const VectorGetJointTorques (const Vector &velocity, const Vector &acceleration, const HandPose &eefLoad=HandPose(0, 0, 0, 0, 0, 0))
bool GetGravityTorques (Vector &torques)
bool GetVelocityTorques (const Vector &velocity, Vector &torques)
bool GetAccelerationTorques (const Vector &acceleration, Vector &torques)
const MatrixGetInertiaMatrix ()
const MatrixGetJointLoads () const
void SetToolPoint (const Vector3D &tpVector)

Protected Methods

void crossProduct (Vector &x, const Vector &y, const Vector &z)
void crossProduct (Vector &result, unsigned int row_m1, const Matrix &matrix1, const Vector &vector2)
void crossProduct (Vector &result, unsigned int row_m1, const Matrix &matrix1, unsigned int row_m2, const Matrix &matrix2)

Protected Attributes

Matrixjoint_force
Matrixjoint_torque
Matrixrot_joint_vel
Matrixrot_joint_acc
Matrixtrans_joint_acc
Matrixinertial_force
Matrixinertial_torque
MatrixJointLoads
Xform tool_point
char baseJointType
const Xformtransformations
bool inertiaUpdated
bool gravityUpdated

Detailed Description

Author:
Chaten Kapoor


Constructor & Destructor Documentation

OSCAR::IDNewtonEuler::IDNewtonEuler unsigned int    dof,
const String   linkCGandMassFile,
const String   linkInertiaFile,
const Vector3D   gravity = Vector3D(0.0, 0.0,-9.8)
 

Constructor.

Parameters:
dof Degrees of freedom (number of joints) of the robot.
linkCGandMassFile Name of file containing link center of gravity and mass data. The format of the data is as follows. The number of rows is equal to DOF. The number of columns is 4, with the first three indicating the center of gravity of the link in the local frame and the last one being the mass of that link. The following example is for a 2-D planar robot.

# This file contains centers of gravity and masses for a 2-DOF planar robot.
# X Y Z mass
0.2 0.0 0.0 5 # link 1
0.1 0.0 0.0 3 # link 2

Parameters:
linkInertiaFile Name of file containing link inertia data. The inertia of each link is represented as a 3X3 matrix called inertia tensor written in the frame at the center of gravity of the link. This frame is a local frame so it's fixed relative to the link. The elements of this 3X3 matrix are in the following form.
Ixx Ixy Ixz
Ixy Iyy Iyz
Ixz Iyz Izz
where Ixx, Iyy, and Izz are the mass moments of inertia and Ixy, Ixz, and Iyz are the mass products of inertia.

The number of 3X3 matrices equals to DOF. The following example is for a 2-D planar robot.

# This file contains the inertia tensors for a 2-DOF planar robot.
# Link 1

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.001


# Link 2

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.001

Parameters:
gravity Vector3D object of the gravity constant in the DH frame. Default is Vector3D(0,0,-9.8), which is the gravity constant in SI unit in the Z-direction which is usually the case for spatial robots. For planar robots, it is typically Vector3D(0,-9.8,0).
Exceptions:
dofAndMassDataMismatch dofAndMassDataMismatch
dofAndInertiaDataMismatch dofAndInertiaDataMismatch

OSCAR::IDNewtonEuler::IDNewtonEuler unsigned int    dof,
const MatrixData   linkCGandMass,
const TensorData   linkInertia,
const Vector3D   gravity = Vector3D(0.0, 0.0,-9.8)
 

Constructor. Same as the above contructor except that the center of gravity and mass data and the inertia data are supplied through MatrixData and TensorData objects instead of data files.

Parameters:
dof Degrees of freedom (number of joints) of the robot.
linkCGandMass MatrixData object containing link center of gravity and mass data. The number of rows is equal to DOF, each corresponding to each link. The number of columns is 4, with the first three indicating the center of gravity of the link and the last one being the mass of that link.
linkInertia TensorData object containing the link inertia data. The inertia of each link is represented as a 3X3 matrix. The number of 3X3 matrices equals to DOF.
gravity Vector3D object of the gravity constant in the DH frame. Default is Vector3D(0,0,-9.8), which is the gravity constant in SI unit in the Z-direction which is usually the case for spatial robots. For planar robots, it is typically Vector3D(0,-9.8,0).
Exceptions:
dofAndMassDataMismatch dofAndMassDataMismatch
dofAndInertiaDataMismatch dofAndInertiaDataMismatch

virtual OSCAR::IDNewtonEuler::~IDNewtonEuler   [virtual]
 


Member Function Documentation

void OSCAR::IDNewtonEuler::crossProduct Vector   result,
unsigned int    row_m1,
const Matrix   matrix1,
unsigned int    row_m2,
const Matrix   matrix2
[protected]
 

void OSCAR::IDNewtonEuler::crossProduct Vector   result,
unsigned int    row_m1,
const Matrix   matrix1,
const Vector   vector2
[protected]
 

void OSCAR::IDNewtonEuler::crossProduct Vector   x,
const Vector   y,
const Vector   z
[protected]
 

bool OSCAR::IDNewtonEuler::GetAccelerationTorques const Vector   acceleration,
Vector   torques
[virtual]
 

A pure virtual function for calculating the joint torques due to acceleration.

Returns:
false if torques or acceleration is not of size DOF. Call GetError for more detailed error information. Otherwise, return true.
Parameters:
acceleration The vector of current joint accelerations.
torques Vector object of size DOF returning the acceleration torques.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

Implements OSCAR::InverseDynamics.

bool OSCAR::IDNewtonEuler::GetGravityTorques Vector   torques [virtual]
 

A pure virtual function for calculating the gravity torques.

Returns:
true if torques is of size DOF. If not, then false. Call GetError for more detailed error information.
Parameters:
torques Vector object of size DOF returning the gravity torques.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

Implements OSCAR::InverseDynamics.

const Matrix* OSCAR::IDNewtonEuler::GetInertiaMatrix   [virtual]
 

A pure virtual function for calculating the inertia matrix.

Returns:
A pointer to a constant Matrix object containing the inertia matrix.

Implements OSCAR::InverseDynamics.

const Matrix& OSCAR::IDNewtonEuler::GetJointLoads   const
 

const Vector& OSCAR::IDNewtonEuler::GetJointTorques const Vector   velocity,
const Vector   acceleration,
const HandPose   eefLoad = HandPose(0, 0, 0, 0, 0, 0)
[virtual]
 

A pure virtual function for calculating the total joint torques.

Returns:
an Vector object containing the joint torques.
Parameters:
velocity The vector of current joint velocities
acceleration The vector of current joint accelerations.
eefLoad The EEF load.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

Implements OSCAR::InverseDynamics.

bool OSCAR::IDNewtonEuler::GetVelocityTorques const Vector   velocity,
Vector   torques
[virtual]
 

A pure virtual function for calculating the joint torques due to velocity (Coriolis and centripetal effects).

Returns:
false if torques or velocity is not of size DOF. Call GetError for more detailed error information. Otherwise, return true.
Parameters:
velocity The vector of current joint velocities
torques Vector object of size DOF returning the velocity torques.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

Implements OSCAR::InverseDynamics.

bool OSCAR::IDNewtonEuler::SetBaseJointType char    jointType
 

Call this function to set the type of the base joint: Rotary ('R') or Prismatic ('P').

This is critical to the torque computation. The default is set to 'R'.

Returns:
true if jointType is either 'R' or 'P'. If not, return false.
Parameters:
jointType The type of the base joint. 'R' or 'P'.

bool OSCAR::IDNewtonEuler::SetLocalTransformations const Xform   transformations
 

MUST call this function before calling any GetXXX() method to set the local transformation matrices.

The transformation matrices are used in all calculations.

Returns:
true if transformations is of correct size. If not, return false.
Parameters:
transformations A pointer to a constant Xform object containing the local transformation matrices. These transformation matrices can be obtained from FKPosition::GetAllLocalTransformations().

void OSCAR::IDNewtonEuler::SetToolPoint const Vector3D   tpVector
 

This sets the tool point to as defined by the user. If this method is not called the tool point remains coincident with the last link.

Parameters:
tpVector Tool point vector. Can be obtained from RRKinematics::GetTool(Vector3D& toolPoint)


Member Data Documentation

char OSCAR::IDNewtonEuler::baseJointType [protected]
 

bool OSCAR::IDNewtonEuler::gravityUpdated [protected]
 

Matrix* OSCAR::IDNewtonEuler::inertial_force [protected]
 

Matrix* OSCAR::IDNewtonEuler::inertial_torque [protected]
 

bool OSCAR::IDNewtonEuler::inertiaUpdated [protected]
 

Matrix* OSCAR::IDNewtonEuler::joint_force [protected]
 

Matrix* OSCAR::IDNewtonEuler::joint_torque [protected]
 

Matrix* OSCAR::IDNewtonEuler::JointLoads [protected]
 

Matrix* OSCAR::IDNewtonEuler::rot_joint_acc [protected]
 

Matrix* OSCAR::IDNewtonEuler::rot_joint_vel [protected]
 

Xform OSCAR::IDNewtonEuler::tool_point [protected]
 

Matrix* OSCAR::IDNewtonEuler::trans_joint_acc [protected]
 

const Xform* OSCAR::IDNewtonEuler::transformations [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations