Explicit numerical constraint. More...
#include <hpp/constraints/explicit.hh>
Public Member Functions | |
virtual ImplicitPtr_t | copy () const |
Copy object and return shared pointer to copy. More... | |
virtual DifferentiableFunctionPtr_t | explicitFunction () const |
Function that maps input to output. More... | |
const segments_t & | outputConf () const |
Get output configuration variables. More... | |
const segments_t & | outputVelocity () const |
Get output degrees of freedom. More... | |
const segments_t & | inputConf () const |
Get input configuration variables. More... | |
const segments_t & | inputVelocity () const |
Get input degrees of freedom. More... | |
virtual void | implicitToExplicitRhs (vectorIn_t implicitRhs, vectorOut_t explicitRhs) |
Convert right hand side. More... | |
![]() | |
bool | operator== (const Implicit &other) const |
Operator equality. More... | |
virtual | ~Implicit () |
DifferentiableFunction & | function () const |
Return a reference to function \(h\). More... | |
const DifferentiableFunctionPtr_t & | functionPtr () const |
Return a reference to function \(h\). More... | |
void | rightHandSideFromConfig (ConfigurationIn_t config) |
Set the right hand side from a configuration. More... | |
void | rightHandSide (vectorIn_t rhs) |
Set the right hand side of the equation. More... | |
vectorIn_t | rightHandSide () const |
Return the right hand side of the equation. More... | |
size_type | rhsSize () const HPP_CONSTRAINTS_DEPRECATED |
Return the dimension of the left hand side function tangent output space. More... | |
size_type | parameterSize () const |
Get size of parameter defining the right hand side of the constraint. More... | |
size_type | rightHandSideSize () const |
Get size of right hand side of the constraint. More... | |
const ComparisonTypes_t & | comparisonType () const |
Return the ComparisonType. More... | |
void | comparisonType (const ComparisonTypes_t &comp) |
Set the comparison type. More... | |
bool | constantRightHandSide () const HPP_CONSTRAINTS_DEPRECATED |
Whether right hand side is constant. More... | |
vectorOut_t | rightHandSide () |
Return a modifiable reference to right hand side of equation. More... | |
vectorOut_t | nonConstRightHandSide () HPP_CONSTRAINTS_DEPRECATED |
Return a modifiable reference to right hand side of equation. More... | |
void | rightHandSideFunction (const DifferentiableFunctionPtr_t &rhsF) |
Set time-varying right hand side. More... | |
const DifferentiableFunctionPtr_t & | rightHandSideFunction () const |
Get time-varying right hand side. More... | |
vectorIn_t | rightHandSideAt (const value_type &s) |
Evaluate and set right hand side at given time. More... | |
Protected Attributes | |
DifferentiableFunctionPtr_t | inputToOutput_ |
segments_t | inputConf_ |
segments_t | outputConf_ |
segments_t | inputVelocity_ |
segments_t | outputVelocity_ |
Explicit numerical constraint.
An explicit numerical constraint is a constraint such that some configuration variables called output are function of the others called input.
Let
Recall that degrees of freedom refer to velocity vectors.
Let us notice that \(n_{ic} + n_{oc}\) is less than the robot configuration size, and \(n_{iv} + n_{ov}\) is less than the velocity size. Some degrees of freedom may indeed be neither input nor output.
Then the differential function is of the form
\begin{equation*} \left(\begin{array}{c} q_{oc_{1}} \\ \vdots \\ q_{oc_{n_{oc}}} \end{array}\right) - f \left((q_{ic_{1}} \cdots q_{ic_{n_{ic}}})^T\right) \end{equation*}
It is straightforward that an equality constraint with this function can solved explicitely:
\begin{align*} \left(\begin{array}{c} q_{oc_{1}} \\ \vdots \\ q_{oc_{n_{oc}}} \end{array}\right) &- f \left((q_{ic_{1}} \cdots q_{ic_{n_{ic}}})^T\right) = rhs \\ & \mbox {if and only if}\\ \left(\begin{array}{c} q_{oc_{1}} \\ \vdots \\ q_{oc_{n_{oc}}} \end{array}\right) &= f \left((q_{ic_{1}} \cdots q_{ic_{n_{ic}}})^T\right) + rhs \\ \end{align*}
If function \(f\) takes values in a Lie group (SO(2), SO(3)), the above "+" between a Lie group element and a tangent vector has to be undestood as the integration of the constant velocity from the Lie group element:
\begin{equation*} \mathbf{q} + \mathbf{v} = \mathbf{q}.\exp (\mathbf{v}) \end{equation*}
where \(\mathbf{q}\) is a Lie group element and \(\mathbf{v}\) is a tangent vector.
Considered as a Implicit instance, the expression of the Jacobian of the DifferentiableFunction above depends on the output space of function \(f\). The rows corresponding to values in a vector space are expressed as follows.
for any index \(i\) between 0 and the size of velocity vectors, either
\begin{equation*} J = \left(\begin{array}{cccccccccccc} \cdots & ov_1 & \cdots & iv_{1} & \cdots & ov_2 & \cdots & iv_2 & \cdots & ov_{n_{ov}} & \cdots \\ & 1 & & & & 0 & & & & & \\ & 0 & & & & 1 & & & & & \\ & & & -\frac{\partial f}{q_1} & & & & -\frac{\partial f}{q_2} \\ &&&&&\\ & 0 & & & & 0 & & & & 1 \end{array}\right) \end{equation*}
The rows corresponding to values in SO(3) have the following expression.\begin{equation*} J = \left(\begin{array}{cccccccccccc} ov_1 \ ov_2 \ ov_3 & iv_1 \cdots iv_{n_{iv}} \\ J_{log}(R_{f}^T R_{out}) & -J_{log}(R_{f}^T R_{out})R_{out}^T R_{f} \frac{\partial f}{\partial q_{in}} \end{array}\right) \end{equation*}
where\begin{equation*} R = \exp (\left[\omega\right]_{\times}) \end{equation*}
|
protected |
Constructor.
robot | Robot for which the constraint is defined. |
function | relation between input configuration variables and output configuration variables, |
inputConf | set of integer intervals defining indices \((ic_{1}, \cdots, ic_{n_{ic}})\), |
outputConf | set of integer intervals defining indices \((oc_{1}, \cdots, oc_{n_{oc}})\), |
inputVelocity | set of integer defining indices \((iv_{1}, \cdots, iv_{n_{iv}})\). |
outputVelocity | set of integer defining indices \((ov_{1}, \cdots, ov_{n_{ov}})\). |
|
protected |
Constructor.
configSpace | Configuration space on which the constraint is defined, |
function | relation between input configuration variables and output configuration variables, |
inputConf | set of integer intervals defining indices \((ic_{1}, \cdots, ic_{n_{ic}})\), |
outputConf | set of integer intervals defining indices \((oc_{1}, \cdots, oc_{n_{oc}})\), |
inputVelocity | set of integer defining indices \((iv_{1}, \cdots, iv_{n_{iv}})\). |
outputVelocity | set of integer defining indices \((ov_{1}, \cdots, ov_{n_{ov}})\). |
|
protected |
Copy constructor.
|
virtual |
Copy object and return shared pointer to copy.
Reimplemented from hpp::constraints::Implicit.
Reimplemented in hpp::constraints::LockedJoint, and hpp::constraints::explicit_::RelativePose.
|
static |
Create instance and return shared pointer.
robot | Robot for which the constraint is defined. |
function | relation between input configuration variables and output configuration variables, |
inputConf | set of integer intervals defining indices \((ic_{1}, \cdots, ic_{n_{ic}})\), |
outputConf | set of integer intervals defining indices \((oc_{1}, \cdots, oc_{n_{oc}})\), |
inputVelocity | set of integer defining indices \((iv_{1}, \cdots, iv_{n_{iv}})\). |
outputVelocity | set of integer defining indices \((ov_{1}, \cdots, ov_{n_{ov}})\). |
|
static |
Create instance and return shared pointer.
configSpace | Configuration space on which the constraint is defined, |
function | relation between input configuration variables and output configuration variables, |
inputConf | set of integer intervals defining indices \((ic_{1}, \cdots, ic_{n_{ic}})\), |
outputConf | set of integer intervals defining indices \((oc_{1}, \cdots, oc_{n_{oc}})\), |
inputVelocity | set of integer defining indices \((iv_{1}, \cdots, iv_{n_{iv}})\). |
outputVelocity | set of integer defining indices \((ov_{1}, \cdots, ov_{n_{ov}})\). |
|
static |
Create a copy and return shared pointer.
|
inlinevirtual |
Function that maps input to output.
|
inlinevirtual |
Convert right hand side.
implicitRhs | right hand side of implicit formulation, |
explicitRhs | right hand side of explicit formulation. |
When implicit formulation is different from explicit formulation,
When implicit formulation derives from explicit one, this method copies the first argument to the second one.
Reimplemented in hpp::constraints::explicit_::RelativePose.
|
protected |
|
inline |
Get input configuration variables.
|
inline |
Get input degrees of freedom.
|
inline |
Get output configuration variables.
|
inline |
Get output degrees of freedom.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |