Robotics Library
0.6.2
|
#include <Kinematics.h>
Public Member Functions | |
Kinematics () | |
virtual | ~Kinematics () |
bool | areColliding (const ::std::size_t &i, const ::std::size_t &j) const |
See if specified bodies should be tested for collisions with each other. More... | |
virtual void | clip (::rl::math::Vector &q) const |
Clip specified configuration to be within joint limits. More... | |
virtual Kinematics * | clone () const |
virtual ::rl::math::Real | distance (const ::rl::math::Vector &q1, const ::rl::math::Vector &q2) const |
Calculate distance measure between specified configuration. More... | |
virtual const ::rl::math::Transform & | forwardPosition (const ::std::size_t &i=0) const |
Get forward position kinematics. More... | |
virtual void | forwardForce (const ::rl::math::Vector &tau, ::rl::math::Vector &f) const |
Calculate forward force kinematics. More... | |
virtual void | forwardVelocity (const ::rl::math::Vector &qdot, ::rl::math::Vector &xdot) const |
Calculate forward velocity kinematics. More... | |
::std::size_t | getBodies () const |
Get number of links. More... | |
::std::size_t | getDof () const |
Get number of degrees of freedom (DOF). More... | |
const ::rl::math::Transform & | getFrame (const ::std::size_t &i) const |
Get link frame. More... | |
const ::rl::math::Matrix & | getJacobian () const |
Get Jacobian. More... | |
const ::rl::math::Matrix & | getJacobianInverse () const |
Get Jacobian-Inverse. More... | |
Joint * | getJoint (const ::std::size_t &i) const |
::rl::math::Real | getManipulabilityMeasure () const |
Get manipulability measure. More... | |
::std::string | getManufacturer () const |
::rl::math::Real | getMaximum (const ::std::size_t &i) const |
void | getMaximum (::rl::math::Vector &max) const |
::rl::math::Real | getMinimum (const ::std::size_t &i) const |
void | getMinimum (::rl::math::Vector &min) const |
::std::string | getName () const |
::std::size_t | getOperationalDof () const |
Get number of end effectors. More... | |
void | getPosition (::rl::math::Vector &q) const |
Get current joint position. More... | |
void | getPositionUnits (::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > &units) const |
void | getSpeed (::rl::math::Vector &speed) const |
void | getSpeedUnits (::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > &units) const |
virtual void | interpolate (const ::rl::math::Vector &q1, const ::rl::math::Vector &q2, const ::rl::math::Real &alpha, ::rl::math::Vector &q) const |
virtual void | inverseForce (const ::rl::math::Vector &f, ::rl::math::Vector &tau) const |
Calculate inverse force kinematics. More... | |
virtual ::rl::math::Real | inverseOfTransformedDistance (const ::rl::math::Real &d) const |
virtual bool | inversePosition (const ::rl::math::Transform &x, ::rl::math::Vector &q, const ::std::size_t &leaf=0, const ::rl::math::Real &delta=::std::numeric_limits< ::rl::math::Real >::infinity(), const ::rl::math::Real &epsilon=1.0e-3f, const ::std::size_t &iterations=1000) |
Calculate inverse position kinematics. More... | |
virtual void | inverseVelocity (const ::rl::math::Vector &xdot, ::rl::math::Vector &qdot) const |
Calculate inverse velocity kinematics. More... | |
bool | isColliding (const ::std::size_t &i) const |
See if specified body should be tested for collisions with the environment. More... | |
virtual bool | isSingular () const |
Check if current configuration is singular. More... | |
virtual bool | isValid (const ::rl::math::Vector &q) const |
Check if specified configuration is within joint limits. More... | |
virtual ::rl::math::Real | maxDistanceToRectangle (const ::rl::math::Vector &q, const ::rl::math::Vector &min, const ::rl::math::Vector &max) const |
virtual ::rl::math::Real | minDistanceToRectangle (const ::rl::math::Vector &q, const ::rl::math::Vector &min, const ::rl::math::Vector &max) const |
virtual ::rl::math::Real | minDistanceToRectangle (const ::rl::math::Real &q, const ::rl::math::Real &min, const ::rl::math::Real &max, const ::std::size_t &cuttingDimension) const |
virtual ::rl::math::Real | newDistance (const ::rl::math::Real &dist, const ::rl::math::Real &oldOff, const ::rl::math::Real &newOff, const int &cuttingDimension) const |
void | setColliding (const ::std::size_t &i, const bool &doesCollide) |
Set if specified body should be tested for collisions with the environment. More... | |
void | setColliding (const ::std::size_t &i, const ::std::size_t &j, const bool &doCollide) |
Set if specified bodies should be tested for collisions with each other. More... | |
void | setPosition (const ::rl::math::Vector &q) |
Update current joint position. More... | |
virtual void | step (const ::rl::math::Vector &q1, const ::rl::math::Vector &qdot, ::rl::math::Vector &q2) const |
::rl::math::Transform & | tool (const ::std::size_t &i=0) |
const ::rl::math::Transform & | tool (const ::std::size_t &i=0) const |
virtual ::rl::math::Real | transformedDistance (const ::rl::math::Real &d) const |
virtual ::rl::math::Real | transformedDistance (const ::rl::math::Vector &q1, const ::rl::math::Vector &q2) const |
virtual void | updateFrames () |
Update frames. More... | |
virtual void | updateJacobian () |
Update Jacobian. More... | |
virtual void | updateJacobianInverse (const ::rl::math::Real &lambda=0.0f, const bool &doSvd=true) |
Update Jacobian-Inverse. More... | |
::rl::math::Transform & | world () |
const ::rl::math::Transform & | world () const |
Static Public Member Functions | |
static Kinematics * | create (const ::std::string &filename) |
Protected Types | |
typedef ::boost::adjacency_list< ::boost::vecS, ::boost::vecS, ::boost::bidirectionalS, ::boost::shared_ptr< Frame >, ::boost::shared_ptr< Transform >, ::boost::no_property, ::boost::vecS > | Tree |
typedef ::boost::graph_traits< Tree >::edge_descriptor | Edge |
typedef ::boost::graph_traits< Tree >::edge_iterator | EdgeIterator |
typedef ::std::pair< EdgeIterator, EdgeIterator > | EdgeIteratorPair |
typedef ::boost::graph_traits< Tree >::in_edge_iterator | InEdgeIterator |
typedef ::std::pair< InEdgeIterator, InEdgeIterator > | InEdgeIteratorPair |
typedef ::boost::graph_traits< Tree >::out_edge_iterator | OutEdgeIterator |
typedef ::std::pair< OutEdgeIterator, OutEdgeIterator > | OutEdgeIteratorPair |
typedef ::boost::graph_traits< Tree >::vertex_descriptor | Vertex |
typedef ::boost::graph_traits< Tree >::vertex_iterator | VertexIterator |
typedef ::std::pair< VertexIterator, VertexIterator > | VertexIteratorPair |
Protected Member Functions | |
void | update () |
void | update (Vertex &u) |
Protected Attributes | |
::std::vector< Element * > | elements |
::std::vector< Frame * > | frames |
::std::vector< Vertex > | leaves |
::std::vector< Link * > | links |
::rl::math::Matrix | jacobian |
::rl::math::Matrix | jacobianInverse |
::std::vector< Joint * > | joints |
::std::string | manufacturer |
::std::string | name |
Vertex | root |
::std::vector< Edge > | tools |
::std::vector< Transform * > | transforms |
Tree | tree |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
rl::kin::Kinematics::Kinematics | ( | ) |
|
virtual |
bool rl::kin::Kinematics::areColliding | ( | const ::std::size_t & | i, |
const ::std::size_t & | j | ||
) | const |
See if specified bodies should be tested for collisions with each other.
|
virtual |
Clip specified configuration to be within joint limits.
q | \( q \) |
|
virtual |
Reimplemented in rl::kin::Rhino, and rl::kin::Puma.
|
static |
rl::math::Real rl::kin::Kinematics::distance | ( | const ::rl::math::Vector & | q1, |
const ::rl::math::Vector & | q2 | ||
) | const |
Calculate distance measure between specified configuration.
q1 | \( q_{1} \) |
q2 | \( q_{2} \) |
|
virtual |
Calculate forward force kinematics.
\[ F = J^{-T} \tau \]
tau | \( \tau \) |
f | \( F \) |
|
virtual |
|
virtual |
Calculate forward velocity kinematics.
\[ \dot{x} = J \dot{q} \]
qdot | \( \dot{q} \) |
xdot | \( \dot{x} \) |
std::size_t rl::kin::Kinematics::getBodies | ( | ) | const |
Get number of links.
std::size_t rl::kin::Kinematics::getDof | ( | ) | const |
Get number of degrees of freedom (DOF).
const ::rl::math::Transform & rl::kin::Kinematics::getFrame | ( | const ::std::size_t & | i | ) | const |
Get link frame.
const ::rl::math::Matrix & rl::kin::Kinematics::getJacobian | ( | ) | const |
Get Jacobian.
const ::rl::math::Matrix & rl::kin::Kinematics::getJacobianInverse | ( | ) | const |
Get Jacobian-Inverse.
Joint * rl::kin::Kinematics::getJoint | ( | const ::std::size_t & | i | ) | const |
rl::math::Real rl::kin::Kinematics::getManipulabilityMeasure | ( | ) | const |
Get manipulability measure.
std::string rl::kin::Kinematics::getManufacturer | ( | ) | const |
void rl::kin::Kinematics::getMaximum | ( | ::rl::math::Vector & | max | ) | const |
rl::math::Real rl::kin::Kinematics::getMaximum | ( | const ::std::size_t & | i | ) | const |
void rl::kin::Kinematics::getMinimum | ( | ::rl::math::Vector & | min | ) | const |
rl::math::Real rl::kin::Kinematics::getMinimum | ( | const ::std::size_t & | i | ) | const |
std::string rl::kin::Kinematics::getName | ( | ) | const |
std::size_t rl::kin::Kinematics::getOperationalDof | ( | ) | const |
Get number of end effectors.
void rl::kin::Kinematics::getPosition | ( | ::rl::math::Vector & | q | ) | const |
Get current joint position.
q | \( q \) |
void rl::kin::Kinematics::getPositionUnits | ( | ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & | units | ) | const |
void rl::kin::Kinematics::getSpeed | ( | ::rl::math::Vector & | speed | ) | const |
void rl::kin::Kinematics::getSpeedUnits | ( | ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & | units | ) | const |
|
virtual |
|
virtual |
Calculate inverse force kinematics.
\[ \tau = J^{T} F \]
f | \( F \) |
tau | \( \tau \) |
rl::math::Real rl::kin::Kinematics::inverseOfTransformedDistance | ( | const ::rl::math::Real & | d | ) | const |
|
virtual |
Calculate inverse position kinematics.
Reimplemented in rl::kin::Rhino, and rl::kin::Puma.
|
virtual |
Calculate inverse velocity kinematics.
\[ \dot{q} = J^{\dagger} \dot{x} \]
xdot | \( \dot{x} \) |
qdot | \( \dot{q} \) |
bool rl::kin::Kinematics::isColliding | ( | const ::std::size_t & | i | ) | const |
See if specified body should be tested for collisions with the environment.
|
virtual |
Check if current configuration is singular.
Reimplemented in rl::kin::Puma.
|
virtual |
Check if specified configuration is within joint limits.
q | \( q \) |
rl::math::Real rl::kin::Kinematics::maxDistanceToRectangle | ( | const ::rl::math::Vector & | q, |
const ::rl::math::Vector & | min, | ||
const ::rl::math::Vector & | max | ||
) | const |
rl::math::Real rl::kin::Kinematics::minDistanceToRectangle | ( | const ::rl::math::Real & | q, |
const ::rl::math::Real & | min, | ||
const ::rl::math::Real & | max, | ||
const ::std::size_t & | cuttingDimension | ||
) | const |
rl::math::Real rl::kin::Kinematics::minDistanceToRectangle | ( | const ::rl::math::Vector & | q, |
const ::rl::math::Vector & | min, | ||
const ::rl::math::Vector & | max | ||
) | const |
rl::math::Real rl::kin::Kinematics::newDistance | ( | const ::rl::math::Real & | dist, |
const ::rl::math::Real & | oldOff, | ||
const ::rl::math::Real & | newOff, | ||
const int & | cuttingDimension | ||
) | const |
void rl::kin::Kinematics::setColliding | ( | const ::std::size_t & | i, |
const ::std::size_t & | j, | ||
const bool & | doCollide | ||
) |
Set if specified bodies should be tested for collisions with each other.
void rl::kin::Kinematics::setColliding | ( | const ::std::size_t & | i, |
const bool & | doesCollide | ||
) |
Set if specified body should be tested for collisions with the environment.
void rl::kin::Kinematics::setPosition | ( | const ::rl::math::Vector & | q | ) |
Update current joint position.
q | \( q \) |
|
virtual |
rl::math::Transform & rl::kin::Kinematics::tool | ( | const ::std::size_t & | i = 0 | ) |
const ::rl::math::Transform & rl::kin::Kinematics::tool | ( | const ::std::size_t & | i = 0 | ) | const |
rl::math::Real rl::kin::Kinematics::transformedDistance | ( | const ::rl::math::Real & | d | ) | const |
rl::math::Real rl::kin::Kinematics::transformedDistance | ( | const ::rl::math::Vector & | q1, |
const ::rl::math::Vector & | q2 | ||
) | const |
|
protected |
|
protected |
|
virtual |
Update frames.
\[ {_{0}^{n}T} = {_{0}^{1}T} {_{0}^{1}T} \ldots {_{n-1}^{n}T} \]
|
virtual |
Update Jacobian.
\[ {^{0}J} = \begin{pmatrix} {^{0}J_{1}} & {^{0}J_{2}} & \cdots & {^{0}J_{n}} \end{pmatrix} \]
|
virtual |
Update Jacobian-Inverse.
Singular value decomposition:
\[ J^{\dagger} = \sum_{i = 1}^{r} \frac{ \sigma_{i} }{ \sigma_{i}^{2} + \lambda^{2} } v_{i} u_{i}^{T} \]
Damped least squares:
\[ J^{\dagger} = J^{T} \left( J J^{T} + \lambda^{2} I \right)^{-1} \]
lambda | damping factor |
svd | singular value decomposition |
rl::math::Transform & rl::kin::Kinematics::world | ( | ) |
const ::rl::math::Transform & rl::kin::Kinematics::world | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |