KDL::JntSpaceInertiaMatrix Class Reference

This class represents an fixed size matrix containing the Joint-Space Inertia Matrix of a KDL::Chain. More...

#include <jntspaceinertiamatrix.hpp>

List of all members.

Public Member Functions

unsigned int columns () const
 Returns the number of columns of the matrix.
 JntSpaceInertiaMatrix (const JntSpaceInertiaMatrix &arg)
 Copy constructor.
 JntSpaceInertiaMatrix (int size)
 Constructor of the Joint-Space Inertia Matrix.
 JntSpaceInertiaMatrix ()
 Construct with _no_ data array.
double & operator() (unsigned int i, unsigned int j)
 set_item operator
double operator() (unsigned int i, unsigned int j) const
 get_item operator for the joint matrix
JntSpaceInertiaMatrixoperator= (const JntSpaceInertiaMatrix &arg)
void resize (unsigned int newSize)
 Resize the array.
unsigned int rows () const
 Returns the number of rows and columns of the matrix.
 ~JntSpaceInertiaMatrix ()

Public Attributes

Eigen::MatrixXd data

Friends

void Add (const JntSpaceInertiaMatrix &src1, const JntSpaceInertiaMatrix &src2, JntSpaceInertiaMatrix &dest)
 Function to add two joint matrix, all the arguments must have the same size: A + B = C.
void Divide (const JntSpaceInertiaMatrix &src, const double &factor, JntSpaceInertiaMatrix &dest)
 Function to divide all the array values with a scalar factor: A/b=C.
bool Equal (const JntSpaceInertiaMatrix &src1, const JntSpaceInertiaMatrix &src2, double eps=epsilon)
 Function to check if two matrices are the same with a precision of eps.
void Multiply (const JntSpaceInertiaMatrix &src, const JntArray &vec, JntArray &dest)
 Function to multiply a KDL::Jacobian with a KDL::JntSpaceInertiaMatrix to get a KDL::Twist, it should not be used to calculate the forward velocity kinematics, the solver classes are built for this purpose.
void Multiply (const JntSpaceInertiaMatrix &src, const double &factor, JntSpaceInertiaMatrix &dest)
 Function to multiply all the array values with a scalar factor: A*b=C.
bool operator== (const JntSpaceInertiaMatrix &src1, const JntSpaceInertiaMatrix &src2)
void SetToZero (JntSpaceInertiaMatrix &mat)
 Function to set all the values of the array to 0.
void Subtract (const JntSpaceInertiaMatrix &src1, const JntSpaceInertiaMatrix &src2, JntSpaceInertiaMatrix &dest)
 Function to subtract two joint matrix, all the arguments must have the same size: A - B = C.

Detailed Description

This class represents an fixed size matrix containing the Joint-Space Inertia Matrix of a KDL::Chain.

Warning:
An object constructed with the default constructor provides a valid, but inert, object. Many of the member functions will do the correct thing and have no affect on this object, but some member functions can _NOT_ deal with an inert/empty object. These functions will assert() and exit the program instead. The intended use case for the default constructor (in an RTT/OCL setting) is outlined in code below - the default constructor plus the resize() function allow use of JntSpaceInertiaMatrix objects whose size is set within a configureHook() call (typically based on a size determined from a property).
class MyTask : public RTT::TaskContext
{
   JntSpaceInertiaMatrix                j;
   MyTask() 
   {}                   // invokes j's default constructor

   bool configureHook()
   {
       unsigned int size = some_property.rvalue();
           j.resize(size)
           ...
   }

   void updateHook()
   {
 use j here
   }
};

Definition at line 70 of file jntspaceinertiamatrix.hpp.


Constructor & Destructor Documentation

USING_PART_OF_NAMESPACE_EIGEN KDL::JntSpaceInertiaMatrix::JntSpaceInertiaMatrix (  ) 

Construct with _no_ data array.

Postcondition:
NULL == data
0 == rows()
Warning:
use of an object constructed like this, without a resize() first, may result in program exit! See class documentation.

Definition at line 28 of file jntspaceinertiamatrix.cpp.

KDL::JntSpaceInertiaMatrix::JntSpaceInertiaMatrix ( int  size  ) 

Constructor of the Joint-Space Inertia Matrix.

Parameters:
size of the matrix, this cannot be changed afterwards. Size rows and size columns.
Precondition:
0 < size
Postcondition:
NULL != data
0 < rows()
all elements in data have 0 value

Definition at line 32 of file jntspaceinertiamatrix.cpp.

References data.

KDL::JntSpaceInertiaMatrix::JntSpaceInertiaMatrix ( const JntSpaceInertiaMatrix arg  ) 

Copy constructor.

Note:
Will correctly copy an empty object

Definition at line 39 of file jntspaceinertiamatrix.cpp.

KDL::JntSpaceInertiaMatrix::~JntSpaceInertiaMatrix (  ) 

Definition at line 51 of file jntspaceinertiamatrix.cpp.


Member Function Documentation

unsigned int KDL::JntSpaceInertiaMatrix::columns (  )  const

Returns the number of columns of the matrix.

Definition at line 75 of file jntspaceinertiamatrix.cpp.

References data.

Referenced by KDL::Equal(), and KDL::ChainDynParam::JntToMass().

double & KDL::JntSpaceInertiaMatrix::operator() ( unsigned int  i,
unsigned int  j 
)

set_item operator

Returns:
reference to the joint value at position i,starting from zero.
Precondition:
0 != size (ie non-default constructor or resize() called)

Definition at line 65 of file jntspaceinertiamatrix.cpp.

References data.

double KDL::JntSpaceInertiaMatrix::operator() ( unsigned int  i,
unsigned int  j 
) const

get_item operator for the joint matrix

Returns:
the joint value at position i, starting from 0
Precondition:
0 != size (ie non-default constructor or resize() called)

Definition at line 60 of file jntspaceinertiamatrix.cpp.

References data.

JntSpaceInertiaMatrix & KDL::JntSpaceInertiaMatrix::operator= ( const JntSpaceInertiaMatrix arg  ) 

Definition at line 44 of file jntspaceinertiamatrix.cpp.

References data.

void KDL::JntSpaceInertiaMatrix::resize ( unsigned int  newSize  ) 

Resize the array.

Warning:
This causes a dynamic allocation (and potentially also a dynamic deallocation). This _will_ negatively affect real-time performance!
Postcondition:
newSize == rows()
NULL != data
all elements in data have 0 value

Definition at line 55 of file jntspaceinertiamatrix.cpp.

References data.

unsigned int KDL::JntSpaceInertiaMatrix::rows (  )  const

Returns the number of rows and columns of the matrix.

Definition at line 70 of file jntspaceinertiamatrix.cpp.

References data.

Referenced by KDL::Equal(), and KDL::ChainDynParam::JntToMass().


Friends And Related Function Documentation

void Add ( const JntSpaceInertiaMatrix src1,
const JntSpaceInertiaMatrix src2,
JntSpaceInertiaMatrix dest 
) [friend]

Function to add two joint matrix, all the arguments must have the same size: A + B = C.

This function is aliasing-safe, A or B can be the same array as C.

Parameters:
src1 A
src2 B
dest C
void Divide ( const JntSpaceInertiaMatrix src,
const double &  factor,
JntSpaceInertiaMatrix dest 
) [friend]

Function to divide all the array values with a scalar factor: A/b=C.

This function is aliasing-safe, A can be the same array as C.

Parameters:
src A
factor b
dest C
bool Equal ( const JntSpaceInertiaMatrix src1,
const JntSpaceInertiaMatrix src2,
double  eps = epsilon 
) [friend]

Function to check if two matrices are the same with a precision of eps.

Parameters:
src1 
src2 
eps default: epsilon
Returns:
true if each element of src1 is within eps of the same element in src2, or if both src1 and src2 have no data (ie 0==rows())
void Multiply ( const JntSpaceInertiaMatrix src,
const JntArray vec,
JntArray dest 
) [friend]

Function to multiply a KDL::Jacobian with a KDL::JntSpaceInertiaMatrix to get a KDL::Twist, it should not be used to calculate the forward velocity kinematics, the solver classes are built for this purpose.

J*q = t

Parameters:
src J: Inertia Matrix (6x6)
vec q: Jacobian (6x1)
dest t: Twist (6x1)
Postcondition:
dest==TwistZero() if 0==src.rows() (ie src is empty)
void Multiply ( const JntSpaceInertiaMatrix src,
const double &  factor,
JntSpaceInertiaMatrix dest 
) [friend]

Function to multiply all the array values with a scalar factor: A*b=C.

This function is aliasing-safe, A can be the same array as C.

Parameters:
src A
factor b
dest C
bool operator== ( const JntSpaceInertiaMatrix src1,
const JntSpaceInertiaMatrix src2 
) [friend]
void SetToZero ( JntSpaceInertiaMatrix mat  )  [friend]

Function to set all the values of the array to 0.

Parameters:
mat 
void Subtract ( const JntSpaceInertiaMatrix src1,
const JntSpaceInertiaMatrix src2,
JntSpaceInertiaMatrix dest 
) [friend]

Function to subtract two joint matrix, all the arguments must have the same size: A - B = C.

This function is aliasing-safe, A or B can be the same array as C.

Parameters:
src1 A
src2 B
dest C

Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:18 2011 for FreeCAD by  doxygen 1.6.1