|
wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
|
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>
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. | |
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)):
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.
| using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::QuantitiesT = Quantities<ValuesT, UnitsT> |
Definition at line 91 of file Jacobian.hpp.
| using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::UnitsT = TypeMatrix<DimensionToV_, DimensionFromV_, UnitsT_...> |
Definition at line 90 of file Jacobian.hpp.
| using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::ValuesT = ValuesT_<ValueT_, DimensionToV_, DimensionFromV_> |
Definition at line 89 of file Jacobian.hpp.
| using wuzp::Jacobian< ValuesT_, ValueT_, FromT_, ToT_, DimensionFromV_, DimensionToV_, UnitsT_ >::ValueT = ValueT_ |
Definition at line 88 of file Jacobian.hpp.
|
inlineexplicit |
Definition at line 96 of file Jacobian.hpp.
|
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.
|
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.
|
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.
|
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.
|
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.