hpp-constraints
6.0.0
Definition of basic geometric constraints for motion planning
|
#include <hpp/constraints/generic-transformation.hh>
Public Types | |
enum | { IsRelative = _Options & RelativeBit , ComputeOrientation = _Options & OrientationBit , ComputePosition = _Options & PositionBit , OutputR3xSO3 = _Options & OutputR3xSO3Bit , IsPosition = ComputePosition && !ComputeOrientation , IsOrientation = !ComputePosition && ComputeOrientation , IsTransform = ComputePosition && ComputeOrientation , ValueSize , DerSize = (ComputePosition ? 3 : 0) + (ComputeOrientation ? 3 : 0) } |
typedef shared_ptr< GenericTransformation > | Ptr_t |
typedef weak_ptr< GenericTransformation > | WkPtr_t |
Public Member Functions | |
virtual | ~GenericTransformation () |
void | reference (const Transform3s &reference) |
Transform3s | reference () const |
Get desired relative orientation. More... | |
void | joint1 (const JointConstPtr_t &joint) |
Set joint 1. More... | |
JointConstPtr_t | joint1 () const |
Get joint 1. More... | |
void | joint2 (const JointConstPtr_t &joint) |
Set joint 2. More... | |
JointConstPtr_t | joint2 () const |
Get joint 2. More... | |
void | frame1InJoint1 (const Transform3s &M) |
Set position of frame 1 in joint 1. More... | |
const Transform3s & | frame1InJoint1 () const |
Get position of frame 1 in joint 1. More... | |
void | frame2InJoint2 (const Transform3s &M) |
Set position of frame 2 in joint 2. More... | |
const Transform3s & | frame2InJoint2 () const |
Get position of frame 2 in joint 2. More... | |
std::pair< JointConstPtr_t, JointConstPtr_t > | dependsOnRelPoseBetween (DeviceConstPtr_t) const |
virtual std::ostream & | print (std::ostream &o) const |
Display object in a stream. More... | |
GenericTransformation (const std::string &name, const DevicePtr_t &robot, std::vector< bool > mask) | |
![]() | |
virtual | ~DifferentiableFunction () |
LiegroupElement | operator() (vectorIn_t argument) const |
void | value (LiegroupElementRef result, vectorIn_t argument) const |
void | jacobian (matrixOut_t jacobian, vectorIn_t argument) const |
const ArrayXb & | activeParameters () const |
const ArrayXb & | activeDerivativeParameters () const |
size_type | inputSize () const |
Get dimension of input vector. More... | |
size_type | inputDerivativeSize () const |
LiegroupSpacePtr_t | outputSpace () const |
Get output space. More... | |
size_type | outputSize () const |
Get dimension of output vector. More... | |
size_type | outputDerivativeSize () const |
Get dimension of output derivative vector. More... | |
const std::string & | name () const |
Get function name. More... | |
std::string | context () const |
void | context (const std::string &c) |
void | finiteDifferenceForward (matrixOut_t jacobian, vectorIn_t arg, DevicePtr_t robot=DevicePtr_t(), value_type eps=std::sqrt(Eigen::NumTraits< value_type >::epsilon())) const |
void | finiteDifferenceCentral (matrixOut_t jacobian, vectorIn_t arg, DevicePtr_t robot=DevicePtr_t(), value_type eps=std::sqrt(Eigen::NumTraits< value_type >::epsilon())) const |
bool | operator== (DifferentiableFunction const &other) const |
bool | operator!= (DifferentiableFunction const &b) const |
Static Public Member Functions | |
static Ptr_t | create (const std::string &name, const DevicePtr_t &robot, const JointConstPtr_t &joint2, const Transform3s &reference, std::vector< bool > mask=std::vector< bool >(DerSize, true)) |
static Ptr_t | create (const std::string &name, const DevicePtr_t &robot, const JointConstPtr_t &joint2, const Transform3s &frame2, const Transform3s &frame1, std::vector< bool > mask=std::vector< bool >(DerSize, true)) |
static Ptr_t | create (const std::string &name, const DevicePtr_t &robot, const JointConstPtr_t &joint1, const JointConstPtr_t &joint2, const Transform3s &reference, std::vector< bool > mask=std::vector< bool >(DerSize, true)) |
static Ptr_t | create (const std::string &name, const DevicePtr_t &robot, const JointConstPtr_t &joint1, const JointConstPtr_t &joint2, const Transform3s &frame1, const Transform3s &frame2, std::vector< bool > mask=std::vector< bool >(DerSize, true)) |
Protected Member Functions | |
void | init (const WkPtr_t &self) |
virtual void | impl_compute (LiegroupElementRef result, ConfigurationIn_t argument) const |
virtual void | impl_jacobian (matrixOut_t jacobian, ConfigurationIn_t arg) const |
bool | isEqual (const DifferentiableFunction &other) const |
![]() | |
DifferentiableFunction (size_type sizeInput, size_type sizeInputDerivative, size_type sizeOutput, std::string name=std::string()) | |
Concrete class constructor should call this constructor. More... | |
DifferentiableFunction (size_type sizeInput, size_type sizeInputDerivative, const LiegroupSpacePtr_t &outputSpace, std::string name=std::string()) | |
Concrete class constructor should call this constructor. More... | |
virtual void | impl_compute (LiegroupElementRef result, vectorIn_t argument) const =0 |
User implementation of function evaluation. More... | |
virtual void | impl_jacobian (matrixOut_t jacobian, vectorIn_t arg) const =0 |
DifferentiableFunction () | |
Additional Inherited Members | |
![]() | |
size_type | inputSize_ |
Dimension of input vector. More... | |
size_type | inputDerivativeSize_ |
Dimension of input derivative. More... | |
LiegroupSpacePtr_t | outputSpace_ |
Dimension of output vector. More... | |
ArrayXb | activeParameters_ |
ArrayXb | activeDerivativeParameters_ |
GenericTransformation class encapsulates 10 possible differentiable functions: Position, Orientation, OrientationSO3, Transformation, TransformationR3xSO3 and their relative versions RelativeTransformationR3xSO3, RelativePosition, RelativeOrientation, RelativeOrientationSO3, RelativeTransformation.
These functions compute the position of frame GenericTransformation::frame2InJoint2 in joint GenericTransformation::joint2 frame, in the frame GenericTransformation::frame1InJoint1 in GenericTransformation::joint1 frame. For absolute functions, GenericTransformation::joint1 is NULL and joint1 frame is the world frame.
The value of the RelativeTransformation function is a 6-dimensional vector. The 3 first coordinates are the position of the center of the second frame expressed in the first frame. The 3 last coordinates are the log of the orientation of frame 2 in frame 1. The values of RelativePosition and RelativeOrientation are respectively the 3 first and the 3 last components of the above 6 dimensional vector.
\begin{equation*} f (\mathbf{q}) = \left(\begin{array}{c} \mathbf{translation}\left(T_{1/J_1}^T T_1^T T_2 T_{2/J_2}\right)\\ \log \left((R_1 R_{1/J_1})^T R_2 R_{2/J_2}\right) \end{array}\right) \end{equation*}
The Jacobian is given by
\begin{equation*} \left(\begin{array}{c} (R_1 R_{1/J_1})^T \left(\left[R_2 t_{2/J_2} + t_2 - t_1\right]_{\times} R_1 J_{1\,\omega} - \left[R_2 t_{2/J_2}\right]_{\times} R_2 J_{2\,\omega} + R_2 J_{2\,\mathbf{v}} - R_1 J_{1\,\mathbf{v}}\right) \\ J_{log}\left((R_1 R_{1/J_1})^T R_2 R_{2/J_2}\right)(R_1 R_{1/J_1})^T (R_2 J_{2\,\omega} - R_1 J_{1\,\omega}) \end{array}\right) \end{equation*}
For RelativeTransformationR3xSO3, OrientationSO3, the 3 last components are replaced by a quaternion.
typedef shared_ptr<GenericTransformation> hpp::constraints::GenericTransformation< _Options >::Ptr_t |
typedef weak_ptr<GenericTransformation> hpp::constraints::GenericTransformation< _Options >::WkPtr_t |
anonymous enum |
|
inlinevirtual |
hpp::constraints::GenericTransformation< _Options >::GenericTransformation | ( | const std::string & | name, |
const DevicePtr_t & | robot, | ||
std::vector< bool > | mask | ||
) |
Constructor
name | the name of the constraints, |
robot | the robot the constraints is applied to, \(T_1(\mathbf{q})^{-1} T_2(\mathbf{q})\) between the joints. |
mask | vector of 6 boolean defining which coordinates of the error vector to take into account. |
|
static |
Object builder for relative functions.
name | the name of the constraints, |
robot | the robot the constraints is applied to, |
joint1 | the first joint the transformation of which is constrained, |
joint2 | the second joint the transformation of which is constrained, |
frame1 | position of a fixed frame in joint 1, |
frame2 | position of a fixed frame in joint 2, |
mask | vector of 6 boolean defining which coordinates of the error vector to take into account. |
|
static |
Object builder for relative functions.
name | the name of the constraints, |
robot | the robot the constraints is applied to, |
joint1 | the first joint the transformation of which is constrained, |
joint2 | the second joint the transformation of which is constrained, |
reference | desired relative transformation \(T_1(\mathbf{q})^{-1} T_2(\mathbf{q})\) between the joints. |
mask | which component of the error vector to take into account. |
|
static |
Object builder for absolute functions.
name | the name of the constraints, |
robot | the robot the constraints is applied to, |
joint2 | the second joint the transformation of which is constrained, |
frame2 | position of a fixed frame in joint 2, |
frame1 | position of a fixed frame in the world, |
mask | vector of 6 boolean defining which coordinates of the error vector to take into account. |
|
static |
Object builder for absolute functions.
name | the name of the constraints, |
robot | the robot the constraints is applied to, |
joint2 | the second joint the transformation of which is constrained, |
reference | desired relative transformation \(T_2(\mathbf{q})\) between the joints. |
mask | which component of the error vector to take into account. |
|
inlinevirtual |
Return pair of joints the relative pose between which modifies the function value if any
This method is useful to know whether an instance of Implicit constrains the relative pose between two joints.
Reimplemented from hpp::constraints::DifferentiableFunction.
|
inline |
Get position of frame 1 in joint 1.
|
inline |
Set position of frame 1 in joint 1.
|
inline |
Get position of frame 2 in joint 2.
|
inline |
Set position of frame 2 in joint 2.
|
protectedvirtual |
Compute value of error
argument | configuration of the robot, |
result | error vector |
|
protectedvirtual |
|
inlineprotected |
|
inlineprotectedvirtual |
Reimplemented from hpp::constraints::DifferentiableFunction.
|
inline |
Get joint 1.
|
inline |
Set joint 1.
|
inline |
Get joint 2.
|
inline |
Set joint 2.
|
virtual |
Display object in a stream.
Reimplemented from hpp::constraints::DifferentiableFunction.
|
inline |
Get desired relative orientation.
|
inline |
Set desired relative transformation of joint2 in joint1