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

OSCAR::IDLagrange Class Reference
[Dynamics]

Inverse dynamics using Lagrange. More...

#include <IDLagrange.h>

Inheritance diagram for OSCAR::IDLagrange:

Inheritance graph
[legend]
List of all members.

Public Methods

 IDLagrange (unsigned int DOF, const String &linkCGandMassFile, const String &linkInertiaFile, const Vector3D &gravity=Vector3D(0.0, 0.0,-9.8))
 IDLagrange (unsigned int DOF, const MatrixData &linkCGandMass, const TensorData &linkInertia, const Vector3D &gravity=Vector3D(0.0, 0.0,-9.8))
virtual ~IDLagrange ()
bool SetGfunctions (const Tensor *tg, const Tensor *rg=0)
bool SetHfunctions (const TensorP *th, const TensorP *rh)
bool GetGravityTorques (Vector &gravityTorques)
bool GetVelocityTorques (const Vector &velocity, Vector &torques)
bool GetAccelerationTorques (const Vector &acceleration, Vector &torques)
const VectorGetJointTorques (const Vector &velocity, const Vector &acceleration, const HandPose &eefLoad=HandPose(0, 0, 0, 0, 0, 0))
const MatrixGetInertiaMatrix ()
const Rot3by3GetGlobalInertiaMatrices (const Xform *global_ts)
const MatrixGetIstar (const Xform *global_ts)
const TensorGetIstarForEachLink (const Xform *global_ts)
const TensorGetPstar ()
const TensorGetPstar (const Xform *global_ts)
bool GetAppliedLoadTorques (unsigned int linkNumber, const Tensor &gr, const Tensor &gt, const Vector &link_load, Vector &jnt_torques)

Protected Methods

void fillRotationMatrices (const Xform *global_ts)
bool calculateGlobalInertiaMatrices (const Xform *global_ts)
bool calculateIstar ()
bool calculateIstarForEachLink ()
bool calculatePstar ()

Protected Attributes

Rot3by3rotations
Rot3by3rotations_trans
Tensorglobal_inertia
MatrixIstar
TensorlinkIstars
TensorPstar
const Tensortrans_g
const Tensorrot_g
const TensorPtrans_h
const TensorProt_h
bool IstarUpdated
bool PstarUpdated
bool gravityUpdated

Private Methods

 IDLagrange (const IDLagrange &)
IDLagrange & operator= (const IDLagrange &)

Detailed Description

Author:
Chaten Kapoor


Constructor & Destructor Documentation

OSCAR::IDLagrange::IDLagrange 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::IDLagrange::IDLagrange unsigned int    DOF,
const MatrixData   linkCGandMass,
const TensorData   linkInertia,
const Vector3D   gravity = Vector3D(0.0, 0.0,-9.8)
 

Constructor.

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::IDLagrange::~IDLagrange   [virtual]
 

OSCAR::IDLagrange::IDLagrange const IDLagrange &    [private]
 


Member Function Documentation

bool OSCAR::IDLagrange::calculateGlobalInertiaMatrices const Xform   global_ts [protected]
 

bool OSCAR::IDLagrange::calculateIstar   [protected]
 

bool OSCAR::IDLagrange::calculateIstarForEachLink   [protected]
 

bool OSCAR::IDLagrange::calculatePstar   [protected]
 

void OSCAR::IDLagrange::fillRotationMatrices const Xform   global_ts [protected]
 

bool OSCAR::IDLagrange::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::IDLagrange::GetAppliedLoadTorques unsigned int    linkNumber,
const Tensor   gr,
const Tensor   gt,
const Vector   link_load,
Vector   jnt_torques
 

const Rot3by3* OSCAR::IDLagrange::GetGlobalInertiaMatrices const Xform   global_ts
 

bool OSCAR::IDLagrange::GetGravityTorques Vector   gravityTorques [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:
gravityTorques Vector object of size DOF returning the gravity torques.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

Implements OSCAR::InverseDynamics.

const Matrix* OSCAR::IDLagrange::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::IDLagrange::GetIstar const Xform   global_ts
 

A function for calculating the inertia matrix. Before this can be calculated the G functions must have been set by calling SetGfunctions. SetLinkPoints must be called in FKVelocity to move the G functions to the cgs before calling SetGfunctions.

Returns:
A pointer to a constant Matrix object containing the inertia matrix.
Parameters:
global_ts A pointer to a Xform object containing the global transformations. These global transformations are created in the FKVelocity object by calling GetAllGlobalTransformations.

const Tensor* OSCAR::IDLagrange::GetIstarForEachLink const Xform   global_ts
 

const Vector& OSCAR::IDLagrange::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.

const Tensor* OSCAR::IDLagrange::GetPstar const Xform   global_ts
 

const Tensor* OSCAR::IDLagrange::GetPstar  
 

bool OSCAR::IDLagrange::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.

IDLagrange& OSCAR::IDLagrange::operator= const IDLagrange &    [private]
 

bool OSCAR::IDLagrange::SetGfunctions const Tensor   tg,
const Tensor   rg = 0
 

MUST call this function before calling any GetXXX() method to set the G functions. The G functions must be at the centers of gravity for all links. These cgs are set by calling SetLinkPoints in the FKVelocity object.

Returns:
true if tg and rg are of correct sizes. If not, return false.
Parameters:
tg A pointer to a constant Tensor containing the translational G functions of the links.
rg A pointer to a constant Tensor containing the rotational G functions of the links. These G functions can be obtained using the FKVelocity class

bool OSCAR::IDLagrange::SetHfunctions const TensorP   th,
const TensorP   rh
 

MUST call this function before calling any GetAccelerationTorques() method to set the H functions. The H functions must be at the centers of gravity for all links. These cgs are set by calling SetLinkPoints in the FKVelocity object.

Returns:
true if th and rh are of correct sizes. If not, return false.
Parameters:
th A pointer to a constant Tensor containing the translational H functions of the links.
rh A pointer to a constant Tensor containing the rotational H functions of the links. These H functions can be obtained using the FKAcceleration class


Member Data Documentation

Tensor* OSCAR::IDLagrange::global_inertia [protected]
 

bool OSCAR::IDLagrange::gravityUpdated [protected]
 

Matrix* OSCAR::IDLagrange::Istar [protected]
 

bool OSCAR::IDLagrange::IstarUpdated [protected]
 

Tensor* OSCAR::IDLagrange::linkIstars [protected]
 

Tensor* OSCAR::IDLagrange::Pstar [protected]
 

bool OSCAR::IDLagrange::PstarUpdated [protected]
 

const Tensor* OSCAR::IDLagrange::rot_g [protected]
 

const TensorP* OSCAR::IDLagrange::rot_h [protected]
 

Rot3by3* OSCAR::IDLagrange::rotations [protected]
 

Rot3by3* OSCAR::IDLagrange::rotations_trans [protected]
 

const Tensor* OSCAR::IDLagrange::trans_g [protected]
 

const TensorP* OSCAR::IDLagrange::trans_h [protected]
 


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