hpp::constraints::RelativePosition Class Reference

Constraint on the relative position of two robot joints. More...

#include <hpp/constraints/relative-position.hh>

Inheritance diagram for hpp::constraints::RelativePosition:
Collaboration diagram for hpp::constraints::RelativePosition:

Public Member Functions

virtual ~RelativePosition () throw ()
 
 RelativePosition (const std::string &name, const DevicePtr_t &robot, const JointPtr_t &joint1, const JointPtr_t &joint2, const vector3_t &point1, const vector3_t &point2, std::vector< bool > mask=boost::assign::list_of(true)(true)(true).convert_to_container< std::vector< bool > >())
 Constructor. More...
 
const vector3_tpointInJoint1 () const
 Get reference point in joint 1. More...
 
void pointInJoint1 (const vector3_t &reference)
 Set reference point in joint 1. More...
 
const vector3_tpointInJoint2 () const
 Get reference point in joint 2. More...
 
void pointInJoint2 (const vector3_t &reference)
 Set reference point in joint 2. More...
 
- Public Member Functions inherited from hpp::constraints::DifferentiableFunction
virtual ~DifferentiableFunction ()
 
void operator() (vectorOut_t result, vectorIn_t argument) const
 Evaluate the function at a given parameter. More...
 
void jacobian (matrixOut_t jacobian, vectorIn_t argument) const
 Computes the jacobian. More...
 
size_type inputSize () const
 Get dimension of input vector. More...
 
size_type inputDerivativeSize () const
 Get dimension of input derivative vector. More...
 
size_type outputSize () const
 Get dimension of output vector. More...
 
const std::string & name () const
 Get function name. More...
 
virtual std::ostream & print (std::ostream &o) const
 Display object in a stream. More...
 

Static Public Member Functions

static EIGEN_MAKE_ALIGNED_OPERATOR_NEW RelativePositionPtr_t create (const std::string &name, const DevicePtr_t &robot, const JointPtr_t &joint1, const JointPtr_t &joint2, const vector3_t &point1, const vector3_t &point2, std::vector< bool > mask=boost::assign::list_of(true)(true)(true).convert_to_container< std::vector< bool > >())
 Return a shared pointer to a new instance. More...
 
static RelativePositionPtr_t create (const DevicePtr_t &robot, const JointPtr_t &joint1, const JointPtr_t &joint2, const vector3_t &point1, const vector3_t &point2, std::vector< bool > mask=boost::assign::list_of(true)(true)(true).convert_to_container< std::vector< bool > >())
 Return a shared pointer to a new instance. More...
 

Protected Member Functions

virtual void impl_compute (vectorOut_t result, ConfigurationIn_t argument) const throw ()
 Compute value of error. More...
 
virtual void impl_jacobian (matrixOut_t jacobian, ConfigurationIn_t arg) const throw ()
 
- Protected Member Functions inherited from hpp::constraints::DifferentiableFunction
 DifferentiableFunction (size_type inputSize, size_type inputDerivativeSize, size_type outputSize, std::string name=std::string())
 Concrete class constructor should call this constructor. More...
 
virtual void impl_compute (vectorOut_t result, vectorIn_t argument) const =0
 User implementation of function evaluation. More...
 
virtual void impl_jacobian (matrixOut_t jacobian, vectorIn_t arg) const =0
 

Detailed Description

Constraint on the relative position of two robot joints.

The value of the function is defined as follows:

\begin{eqnarray*} \mathbf{r} (\mathbf{q}) &=& \mathbf{x}_1 - M_1^{-1}(\mathbf{q}) M_2 (\mathbf{q})\mathbf{x}_2\\ &=& \mathbf{x}_1 + R_1^T (\mathbf{q}) (\mathbf{t}_1 (\mathbf{q}) - \mathbf{t}_2 (\mathbf{q})) - R_1^T (\mathbf{q}) R_2 (\mathbf{q}) \mathbf{x}_2 \\ \mathbf{\dot{e}} &=& R_1^T (\mathbf{q}) \left( \left[R_2 (\mathbf{q})\mathbf{x}_2\right]_{\times} (\omega_2 - \omega_1) + \left[\mathbf{t}_1 - \mathbf{t}_2\right]_{\times} \omega_1 + \mathbf{\dot{t}}_1 - \mathbf{\dot{t}}_2 \right)\\ &=& R_1^T (\mathbf{q}) \left( \left[R_2 (\mathbf{q})\mathbf{x}_2\right]_{\times} \omega_2 + \left[\mathbf{t}_1 - (R_2 (\mathbf{q})\mathbf{x}_2 + \mathbf{t}_2)\right]_{\times} \omega_1 + \mathbf{\dot{t}}_1 - \mathbf{\dot{t}}_2 \right)\\ &=& R_1^T (\mathbf{q}) \left( \left[R_2 (\mathbf{q})\mathbf{x}_2\right]_{\times} J_{joint\ 2}^{\omega}(\mathbf{q}) + \left[\mathbf{t}_1 - (R_2 (\mathbf{q})\mathbf{x}_2 + \mathbf{t}_2)\right]_{\times} J_{joint\ 1}^{\omega}(\mathbf{q}) + J_{joint\ 1}^{\mathbf{v}}(\mathbf{q}) - J_{joint\ 2}^{\mathbf{v}}(\mathbf{q}) \right) \mathbf{\dot{q}}\\ \end{eqnarray*}

$\mathbf{x}_1$ and $\mathbf{x}_2$ are the position of the points to match expressed in the local frame of each joint.

Constructor & Destructor Documentation

◆ ~RelativePosition()

virtual hpp::constraints::RelativePosition::~RelativePosition ( )
throw (
)
inlinevirtual

◆ RelativePosition()

hpp::constraints::RelativePosition::RelativePosition ( const std::string &  name,
const DevicePtr_t robot,
const JointPtr_t joint1,
const JointPtr_t joint2,
const vector3_t point1,
const vector3_t point2,
std::vector< bool >  mask = boost::assign::list_of(true)(true)(true).convert_to_container< std::vector< bool > >() 
)

Constructor.

Parameters
robotthe robot the constraints is applied to,
joint1,joint2joints the relative positions of which is constrained.
point1,point2the points on each joint that should coincide expressed in joint local frames.
maskwhich component of the error vector to take into account.

Member Function Documentation

◆ create() [1/2]

static EIGEN_MAKE_ALIGNED_OPERATOR_NEW RelativePositionPtr_t hpp::constraints::RelativePosition::create ( const std::string &  name,
const DevicePtr_t robot,
const JointPtr_t joint1,
const JointPtr_t joint2,
const vector3_t point1,
const vector3_t point2,
std::vector< bool >  mask = boost::assign::list_of(true)(true)(true).convert_to_container< std::vector< bool > >() 
)
static

Return a shared pointer to a new instance.

Parameters
namethe name of the constraints,
robotthe robot the constraints is applied to,
joint1,joint2joints the relative positions of which is constrained.
point1,point2the points on each joint that should coincide expressed in joint local frames.
maskwhich component of the error vector to take into account.

◆ create() [2/2]

static RelativePositionPtr_t hpp::constraints::RelativePosition::create ( const DevicePtr_t robot,
const JointPtr_t joint1,
const JointPtr_t joint2,
const vector3_t point1,
const vector3_t point2,
std::vector< bool >  mask = boost::assign::list_of(true)(true)(true).convert_to_container< std::vector< bool > >() 
)
static

Return a shared pointer to a new instance.

Parameters
robotthe robot the constraints is applied to,
joint1,joint2joints the relative positions of which is constrained.
point1,point2the points on each joint that should coincide expressed in joint local frames.
maskwhich component of the error vector to take into account.

◆ impl_compute()

virtual void hpp::constraints::RelativePosition::impl_compute ( vectorOut_t  result,
ConfigurationIn_t  argument 
) const
throw (
)
protectedvirtual

Compute value of error.

Parameters
argumentconfiguration of the robot,
Return values
resulterror vector

◆ impl_jacobian()

virtual void hpp::constraints::RelativePosition::impl_jacobian ( matrixOut_t  jacobian,
ConfigurationIn_t  arg 
) const
throw (
)
protectedvirtual

◆ pointInJoint1() [1/2]

const vector3_t& hpp::constraints::RelativePosition::pointInJoint1 ( ) const
inline

Get reference point in joint 1.

◆ pointInJoint1() [2/2]

void hpp::constraints::RelativePosition::pointInJoint1 ( const vector3_t reference)
inline

Set reference point in joint 1.

◆ pointInJoint2() [1/2]

const vector3_t& hpp::constraints::RelativePosition::pointInJoint2 ( ) const
inline

Get reference point in joint 2.

◆ pointInJoint2() [2/2]

void hpp::constraints::RelativePosition::pointInJoint2 ( const vector3_t reference)
inline

Set reference point in joint 2.