wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ > Class Template Reference

The Jacobian J = d(To)/d(From) of a change of coordinates from the coordinate system From to the coordinate system To, possibly of another dimension, at one point, e.g. of the task space coordinates of a robot with respect to its joint coordinates: J_ij = dx_i / dq_j for the coordinates q of From and x of To, with the units [x_i] / [q_j]. More...

#include <wuzp/trafo/Jacobian.hpp>

Inherits wuzp::PassiveTransformation< Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_... >, FromT_, ToT_ >.

Public Types

using ValueT = ValueT_
using ValuesT = ValuesT_<ValueT_, DimensionToV_, DimensionFromV_>
using UnitsT = TypeMatrix<DimensionToV_, DimensionFromV_, UnitsT_...>
using QuantitiesT = Quantities<ValuesT, UnitsT>
Public Types inherited from wuzp::PassiveTransformation< Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_... >, FromT_, ToT_ >
using From
using To

Public Member Functions

template<typename... Args>
requires (!CopiesOrMoves<Jacobian, Args...>)
 Jacobian (Args &&... args)
const QuantitiesT & getQuantities () const
 The matrix J, whose element J_ij is the derivative of the coordinate x_i of To with respect to the coordinate q_j of From.
template<typename ObjectT_>
auto pullback (const ObjectT_ &object) const
 The pullback of a covector w in To, w J, e.g. of a force into joint torques, or of a tensor M in To with two lower indices, J^T M J, e.g. of a mass matrix into the joint space inertia, into From (see internal::pullBack()).
auto inverse () const
 The inverse Jacobian, from To to From, the Jacobian of the inverse change of coordinates, whose matrix is the matrix inverse J^-1 (see Quantities::inverse()).
auto pseudoInverse () const
 The pseudo-inverse J^+, from To to From, of a Jacobian of full rank (see Quantities::pseudoInverse()), like kindr's pseudoInverse(): e.g. for a redundant robot, whose joint space From has more dimensions than its task space To, J^+ x' are the joint velocities of the smallest norm for a task space velocity x', and the pullback by J^+ of the joint torques tau = J^T F of a force F at the end effector, J^+T tau, is F.
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionFromOtherV_, int DimensionToOtherV_, typename... UnitsOtherT_>
bool isApprox (const Jacobian< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionFromOtherV_, DimensionToOtherV_, UnitsOtherT_... > &other, const ValueT precision=Precision< ValueT >::value()) const
 Whether both Jacobians, which must transform between the same coordinate systems, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()), also those that are not square.
Public Member Functions inherited from wuzp::PassiveTransformation< Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_... >, FromT_, ToT_ >
auto transform (ObjectT_ &&object) const
 The object in To.

Detailed Description

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
requires AnyValueMatrix<ValuesT_>
class wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >

The Jacobian J = d(To)/d(From) of a change of coordinates from the coordinate system From to the coordinate system To, possibly of another dimension, at one point, e.g. of the task space coordinates of a robot with respect to its joint coordinates: J_ij = dx_i / dq_j for the coordinates q of From and x of To, with the units [x_i] / [q_j].

It is the linearization of the change of coordinates, so it maps the tangent objects at that point, not the points themselves (Lee, Introduction to Smooth Manifolds, 2nd ed., Springer, 2013, chapters 3, 11 and 12, and https://en.wikipedia.org/wiki/Pullback_(differential_geometry)):

  • transform() pushes forward relative vectors, v' = J v, e.g. velocities, and tensors with two upper indices, T' = J T J^T, e.g. covariances, from From to To. Points, covectors and tensors with lower indices are rejected.
  • pullback() pulls covectors, w' = w J, e.g. forces, and tensors with two lower indices, M' = J^T M J, e.g. mass matrices, back from To to From. It needs no inverse, so it also works for a Jacobian that is not square, e.g. for the joint torques tau = J^T F that balance a force F at the end effector, or for the joint space inertia J^T M J of a mass matrix M in Cartesian coordinates. A force is a covector (see ForceCovector): a force vector, e.g. a ForceVector, is pulled back as its transpose, jacobian.pullback(force.transpose()), which the Euclidean metric of To allows (see Metric).

The operational space inertia of Khatib, Lambda = (J M^-1 J^T)^-1 for the joint space inertia M and a Jacobian J of full row rank ("A unified approach for motion and force control of robot manipulators: The operational space formulation", IEEE Journal on Robotics and Automation 3(1), 1987, https://doi.org/10.1109/JRA.1987.1087068; Featherstone and Orin, "Dynamics", in Siciliano and Khatib (eds.), Springer Handbook of Robotics, Springer, 2008, section 2.5.4, "Operational-Space Inertia Matrix"), is the inverse of the pushforward of the inverse of M, which has two upper indices: jacobian.transform(massMatrix.inverse()).inverse(). Jacobians compose by the chain rule, J_AC = J_AB * J_BC, in the order of the monogram notation of Drake (see PassiveTransformation), also with changes of basis, i.e. passive linear transformations, rotations and Lorentz transformations, which are the Jacobians of the identity map between two coordinate systems: e.g. R_EW * J_W expresses a task space Jacobian J_W in E instead of W. Only a square Jacobian has an inverse, the Jacobian of the inverse change of coordinates. The matrix maps one coordinate system into another, so it is not a tensor in one coordinate system: getQuantities() returns it, and there is no getTensor().

Definition at line 85 of file Jacobian.hpp.

Member Typedef Documentation

◆ QuantitiesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::QuantitiesT = Quantities<ValuesT, UnitsT>

Definition at line 91 of file Jacobian.hpp.

◆ UnitsT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::UnitsT = TypeMatrix<DimensionToV_, DimensionFromV_, UnitsT_...>

Definition at line 90 of file Jacobian.hpp.

◆ ValuesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::ValuesT = ValuesT_<ValueT_, DimensionToV_, DimensionFromV_>

Definition at line 89 of file Jacobian.hpp.

◆ ValueT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::ValueT = ValueT_

Definition at line 88 of file Jacobian.hpp.

Constructor & Destructor Documentation

◆ Jacobian()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
template<typename... Args>
requires (!CopiesOrMoves<Jacobian, Args...>)
wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::Jacobian ( Args &&... args)
inlineexplicit

Definition at line 96 of file Jacobian.hpp.

Member Function Documentation

◆ getQuantities()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
const QuantitiesT & wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::getQuantities ( ) const
inline

The matrix J, whose element J_ij is the derivative of the coordinate x_i of To with respect to the coordinate q_j of From.

Definition at line 99 of file Jacobian.hpp.

◆ inverse()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
auto wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::inverse ( ) const
inline

The inverse Jacobian, from To to From, the Jacobian of the inverse change of coordinates, whose matrix is the matrix inverse J^-1 (see Quantities::inverse()).

Only a square Jacobian has one, and its units describe a linear map. This needs a value matrix backend with matrix inverses (InvertibleValueMatrixBackend).

Definition at line 117 of file Jacobian.hpp.

◆ isApprox()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionFromOtherV_, int DimensionToOtherV_, typename... UnitsOtherT_>
bool wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::isApprox ( const Jacobian< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionFromOtherV_, DimensionToOtherV_, UnitsOtherT_... > & other,
const ValueT precision = Precision<ValueT>::value() ) const
inline

Whether both Jacobians, which must transform between the same coordinate systems, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()), also those that are not square.

Definition at line 138 of file Jacobian.hpp.

◆ pseudoInverse()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
auto wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::pseudoInverse ( ) const
inline

The pseudo-inverse J^+, from To to From, of a Jacobian of full rank (see Quantities::pseudoInverse()), like kindr's pseudoInverse(): e.g. for a redundant robot, whose joint space From has more dimensions than its task space To, J^+ x' are the joint velocities of the smallest norm for a task space velocity x', and the pullback by J^+ of the joint torques tau = J^T F of a force F at the end effector, J^+T tau, is F.

The coordinates of From must have the same unit if it has more dimensions, e.g. all joints revolute, and those of To if it has fewer, otherwise it fails with "Units do not match.": the pseudo-inverse of other units depends on the choice of units. It is not the Jacobian of an inverse change of coordinates, but it pushes vectors forward from To to From and pulls covectors back like one.

Definition at line 132 of file Jacobian.hpp.

◆ pullback()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionFromV_, int DimensionToV_, typename... UnitsT_>
template<typename ObjectT_>
auto wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::pullback ( const ObjectT_ & object) const
inline

The pullback of a covector w in To, w J, e.g. of a force into joint torques, or of a tensor M in To with two lower indices, J^T M J, e.g. of a mass matrix into the joint space inertia, into From (see internal::pullBack()).

Other tensors are rejected: transform() pushes forward vectors and tensors with two upper indices.

Definition at line 107 of file Jacobian.hpp.


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