RobWorkProject  24.8.23-
Public Types | Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
Jacobian Class Reference

A Jacobian class. A jacobian with m rows and n columns. More...

#include <Jacobian.hpp>

Public Types

typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Base
 The type of the internal Eigen matrix implementation.
 

Public Member Functions

 Jacobian (size_t m, size_t n)
 Creates an empty \( m\times n \) (uninitialized) Jacobian matrix. More...
 
 Jacobian ()
 Default constructor.
 
 Jacobian (size_t n)
 Creates an empty \( 6\times n \) (uninitialized) Jacobian matrix. More...
 
template<class R >
 Jacobian (const Eigen::MatrixBase< R > &r)
 Creates a Jacobian from a Eigen::MatrixBase. More...
 
 Jacobian (const rw::math::Transform3D< double > &aTb)
 Creates the velocity transform jacobian \( \robabcdx{a}{b}{a}{b}{\bf{J_v}} \) for transforming both the reference frame and the velocity reference point from one frame b to another frame a. More...
 
 Jacobian (const rw::math::Rotation3D< double > &aRb)
 Creates the velocity transform jacobian \( \robabcdx{a}{b}{i}{i}{\bf{J_v}} \) for transforming a velocity screw from one frame of reference b to another frame a. More...
 
 Jacobian (const rw::math::Vector3D< double > &aPb)
 Creates the velocity transform jacobian \( \robabcdx{i}{i}{b}{a}{\bf{J}_v} \) for transforming the reference point of a velocity screw from one frame b to another frame a. More...
 
size_t size1 () const
 The number of rows.
 
size_t size2 () const
 The number of columns.
 
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & e ()
 Accessor for the internal Eigen matrix state.
 
const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & e () const
 Accessor for the internal Eigen matrix state.
 
double & operator() (size_t row, size_t column)
 Returns reference to matrix element. More...
 
const double & operator() (size_t row, size_t column) const
 Returns reference to matrix element. More...
 
double & elem (size_t row, size_t col)
 Get an element of the jacobian. More...
 
void addRotation (const rw::math::Vector3D<> &part, size_t row, size_t col)
 add rotation jacobian to a specific row and column in this jacobian More...
 
void addPosition (const rw::math::Vector3D<> &part, size_t row, size_t col)
 add position jacobian to a specific row and column in this jacobian More...
 

Static Public Member Functions

static Jacobian zero (size_t size1, size_t size2)
 Construct zero initialized Jacobian. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const Jacobian &v)
 Streaming operator.
 

Related Functions

(Note that these are not member functions.)

const rw::math::VelocityScrew6D operator* (const Jacobian &Jq, const rw::math::Q &dq)
 Calculates velocity vector. More...
 
const rw::math::Q operator* (const Jacobian &JqInv, const rw::math::VelocityScrew6D<> &v)
 Calculates joint velocities. More...
 
const Jacobian operator* (const Jacobian &j1, const Jacobian &j2)
 Multiplies jacobians \( \mathbf{J} = \mathbf{J}_1 * \mathbf{J}_2 \). More...
 
const Jacobian operator* (const rw::math::Rotation3D<> &r, const Jacobian &v)
 Rotates each column of v by r. More...
 
template<>
void write (const rw::math::Jacobian &sobject, rw::common::OutputArchive &oarchive, const std::string &id)
 
template<>
void read (rw::math::Jacobian &sobject, rw::common::InputArchive &iarchive, const std::string &id)
 

Detailed Description

A Jacobian class. A jacobian with m rows and n columns.

An ordinary robot jacobian defined over the joints 0 to n with configuration q is expressed as a \( 6\times n \) matrix:

\[ \robabx{0}{n}{\bf{J}}(\bf{q}) = [ \robabx{0}{1}{\bf{J}}(\bf{q}), \robabx{1}{2}{\bf{J}}(\bf{q}),..., \robabx{n-1}{n}{\bf{J}}(\bf{q}) ] \]

Constructor & Destructor Documentation

◆ Jacobian() [1/6]

Jacobian ( size_t  m,
size_t  n 
)
inline

Creates an empty \( m\times n \) (uninitialized) Jacobian matrix.

Parameters
m[in] number of rows
n[in] number of columns

◆ Jacobian() [2/6]

Jacobian ( size_t  n)
inlineexplicit

Creates an empty \( 6\times n \) (uninitialized) Jacobian matrix.

Parameters
n[in] number of columns

◆ Jacobian() [3/6]

Jacobian ( const Eigen::MatrixBase< R > &  r)
inlineexplicit

Creates a Jacobian from a Eigen::MatrixBase.

Parameters
r[in] an Eigen Matrix

◆ Jacobian() [4/6]

Jacobian ( const rw::math::Transform3D< double > &  aTb)
explicit

Creates the velocity transform jacobian \( \robabcdx{a}{b}{a}{b}{\bf{J_v}} \) for transforming both the reference frame and the velocity reference point from one frame b to another frame a.

Parameters
aTb[in] \( \robabx{a}{b}{\bf{T}} \)
Returns
\( \robabcdx{a}{b}{a}{b}{\bf{J_v}} \)

\[ \robabcdx{a}{b}{a}{b}{\bf{J_v}} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & S(\robabx{a}{b}{\mathbf{d}})\robabx{a}{b}{\mathbf{R}} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right] \]

Change the frame of reference from b to frame a and reference point from frame a to frame b: \( \robabx{a}{b}{\bf{J}} = \robabcdx{a}{b}{a}{b}{\bf{J}_v} \cdot \robabx{b}{a}{\bf{J}} \)

◆ Jacobian() [5/6]

Jacobian ( const rw::math::Rotation3D< double > &  aRb)
explicit

Creates the velocity transform jacobian \( \robabcdx{a}{b}{i}{i}{\bf{J_v}} \) for transforming a velocity screw from one frame of reference b to another frame a.

Parameters
aRb[in] \( \robabx{a}{b}{\bf{R}} \)
Returns
\( \robabcdx{a}{b}{i}{i}{\bf{J}_v} \)

\[ \robabcdx{a}{b}{i}{i}{\bf{J_v}} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & \mathbf{0}^{3x3} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right] \]

Change the frame of reference from b to frame a : \( \robabx{a}{c}{\bf{J}} = \robabcdx{a}{b}{c}{c}{\bf{J}_v} \cdot \robabx{b}{c}{\bf{J}} \)

◆ Jacobian() [6/6]

Jacobian ( const rw::math::Vector3D< double > &  aPb)
explicit

Creates the velocity transform jacobian \( \robabcdx{i}{i}{b}{a}{\bf{J}_v} \) for transforming the reference point of a velocity screw from one frame b to another frame a.

Parameters
aPb[in] \( \robabx{a}{b}{\bf{P}} \)
Returns
\( \robabcdx{i}{i}{b}{a}{\bf{J}_v} \)

\[ \robabcdx{i}{i}{b}{a}{\bf{J}_v} = \left[ \begin{array}{cc} \bf{I}^{3x3} & S(\robabx{a}{b}{\bf{P}}) \\ \bf{0}^{3x3} & \bf{I}^{3x3} \end{array} \right] \]

transforming the reference point of a Jacobian from frame c to frame d : \( \robabx{a}{d}{\mathbf{J}} = \robabcdx{a}{a}{c}{d}{\mathbf{J_v}} \cdot \robabx{a}{c}{\mathbf{J}} \)

Member Function Documentation

◆ addPosition()

void addPosition ( const rw::math::Vector3D<> &  part,
size_t  row,
size_t  col 
)

add position jacobian to a specific row and column in this jacobian

Parameters
part
row
col

◆ addRotation()

void addRotation ( const rw::math::Vector3D<> &  part,
size_t  row,
size_t  col 
)

add rotation jacobian to a specific row and column in this jacobian

Parameters
part
row
col

◆ elem()

double& elem ( size_t  row,
size_t  col 
)
inline

Get an element of the jacobian.

Parameters
row[in] the row.
col[in] the column.
Returns
reference to the element.

◆ operator()() [1/2]

double& operator() ( size_t  row,
size_t  column 
)
inline

Returns reference to matrix element.

Parameters
row[in] row
column[in] column
Returns
reference to the element

◆ operator()() [2/2]

const double& operator() ( size_t  row,
size_t  column 
) const
inline

Returns reference to matrix element.

Parameters
row[in] row
column[in] column
Returns
reference to the element

◆ zero()

static Jacobian zero ( size_t  size1,
size_t  size2 
)
inlinestatic

Construct zero initialized Jacobian.

Parameters
size1[in] number of rows.
size2[in] number of columns.
Returns
zero-initialized jacobian.

Friends And Related Function Documentation

◆ operator*() [1/4]

const Jacobian operator* ( const Jacobian j1,
const Jacobian j2 
)
related

Multiplies jacobians \( \mathbf{J} = \mathbf{J}_1 * \mathbf{J}_2 \).

Parameters
j1[in] \( \mathbf{J}_1 \)
j2[in] \( \mathbf{J}_2 \)
Returns
\( \mathbf{J} \)

◆ operator*() [2/4]

const rw::math::VelocityScrew6D operator* ( const Jacobian Jq,
const rw::math::Q dq 
)
related

Calculates velocity vector.

Parameters
Jq[in] the jacobian \( \mathbf{J}_{\mathbf{q}} \)
dq[in] the joint velocity vector \( \dot{\mathbf{q}} \)
Returns
the velocity vector \( \mathbf{\nu} \)

◆ operator*() [3/4]

const rw::math::Q operator* ( const Jacobian JqInv,
const rw::math::VelocityScrew6D<> &  v 
)
related

Calculates joint velocities.

Parameters
JqInv[in] the inverse jacobian \( \mathbf{J}_{\mathbf{q}}^{-1} \)
v[in] the velocity vector \( \mathbf{\nu} \)
Returns
the joint velocity vector \( \dot{\mathbf{q}} \)

◆ operator*() [4/4]

const Jacobian operator* ( const rw::math::Rotation3D<> &  r,
const Jacobian v 
)
related

Rotates each column of v by r.

The Jacobian must be of height 6.

◆ read()

void read ( rw::math::Jacobian sobject,
rw::common::InputArchive iarchive,
const std::string &  id 
)
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
sobject[out] the object in which the data should be streamed into
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ write()

void write ( const rw::math::Jacobian sobject,
rw::common::OutputArchive oarchive,
const std::string &  id 
)
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
sobject[in] the object from which the data should be streamed.
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

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