tinyrobotics
Loading...
Searching...
No Matches
Math.hpp File Reference

Contains various math related functions. More...

#include <Eigen/Core>
#include <Eigen/Geometry>

Go to the source code of this file.

Functions

template<typename Scalar >
Eigen::Matrix< Scalar, 3, 3 > tinyrobotics::skew (const Eigen::Matrix< Scalar, 3, 3 > &input)
 Computes the skew of a 3x3 vector.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 3, 3 > tinyrobotics::skew (const Eigen::Matrix< Scalar, 3, 1 > &input)
 Computes the skew matrix for a 3x1 vector.
 
template<typename Scalar >
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > tinyrobotics::null (const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &A)
 Computes an orthonormal basis for the null space of a matrix.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::cross_spatial (const Eigen::Matrix< Scalar, 6, 1 > &v)
 Computes the 6x6 cross-product matrix for a 6D spatial vector.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::cross_motion (const Eigen::Matrix< Scalar, 6, 1 > &v)
 Computes the 6x6 cross-product matrix for a motion vector and a force vector.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::translation_to_spatial (const Eigen::Matrix< Scalar, 3, 1 > &xyz)
 Spatial coordinate transform from a xyz translation.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::rpy_to_spatial (const Eigen::Matrix< Scalar, 3, 1 > &rpy)
 Spatial coordinate transform from roll-pitch-yaw angles.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::homogeneous_to_spatial (const Eigen::Transform< Scalar, 3, Eigen::Isometry > &H)
 Spatial coordinate transform from homogeneous transformation matrix.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::inertia_to_spatial (const Scalar m, const Eigen::Matrix< Scalar, 3, 1 > &c, const Eigen::Matrix< Scalar, 3, 3 > &I)
 Spatial inertia matrix from inertia parameters.
 

Detailed Description

Contains various math related functions.

Function Documentation

◆ cross_motion()

template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::cross_motion ( const Eigen::Matrix< Scalar, 6, 1 > &  v)

Computes the 6x6 cross-product matrix for a motion vector and a force vector.

Parameters
vThe motion and force vector.
Template Parameters
ScalarScalar type.
Returns
6x6 cross-product matrix.

◆ cross_spatial()

template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::cross_spatial ( const Eigen::Matrix< Scalar, 6, 1 > &  v)

Computes the 6x6 cross-product matrix for a 6D spatial vector.

Parameters
vThe 6D spatial vector.
Template Parameters
ScalarScalar type.
Returns
6x6 cross-product matrix.

◆ homogeneous_to_spatial()

template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::homogeneous_to_spatial ( const Eigen::Transform< Scalar, 3, Eigen::Isometry > &  H)

Spatial coordinate transform from homogeneous transformation matrix.

Parameters
HThe homogeneous transformation matrix.
Template Parameters
ScalarScalar type.
Returns
Spatial coordinate transform matrix.

◆ inertia_to_spatial()

template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::inertia_to_spatial ( const Scalar  m,
const Eigen::Matrix< Scalar, 3, 1 > &  c,
const Eigen::Matrix< Scalar, 3, 3 > &  I 
)

Spatial inertia matrix from inertia parameters.

Parameters
mMass of link.
CVector from the origin of the link to the center of mass.
IInertia of link.
Template Parameters
ScalarScalar type.
Returns
Spatial inertia matrix.

◆ null()

template<typename Scalar >
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > tinyrobotics::null ( const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &  A)

Computes an orthonormal basis for the null space of a matrix.

Parameters
AInput matrix.
Template Parameters
ScalarScalar type.
Returns
The orthonormal basis for the null space of A.

◆ rpy_to_spatial()

template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::rpy_to_spatial ( const Eigen::Matrix< Scalar, 3, 1 > &  rpy)

Spatial coordinate transform from roll-pitch-yaw angles.

Parameters
rpyThe roll-pitch-yaw angles.
Template Parameters
ScalarScalar type.
Returns
Spatial coordinate transform matrix.

◆ skew() [1/2]

template<typename Scalar >
Eigen::Matrix< Scalar, 3, 3 > tinyrobotics::skew ( const Eigen::Matrix< Scalar, 3, 1 > &  input)

Computes the skew matrix for a 3x1 vector.

Parameters
inputThe 3x1 vector.
Template Parameters
ScalarScalar type.
Returns
The skew of input.

◆ skew() [2/2]

template<typename Scalar >
Eigen::Matrix< Scalar, 3, 3 > tinyrobotics::skew ( const Eigen::Matrix< Scalar, 3, 3 > &  input)

Computes the skew of a 3x3 vector.

Parameters
inputThe 3x3 vector.
Template Parameters
ScalarScalar type.
Returns
The skew of input.

◆ translation_to_spatial()

template<typename Scalar >
Eigen::Matrix< Scalar, 6, 6 > tinyrobotics::translation_to_spatial ( const Eigen::Matrix< Scalar, 3, 1 > &  xyz)

Spatial coordinate transform from a xyz translation.

Parameters
vThe spatial vector
Returns
Spatial coordinate transform matrix