hpp::constraints::Position Class Reference

Constraint on the position of a robot point. More...

#include <hpp/constraints/position.hh>

Inheritance diagram for hpp::constraints::Position:
Collaboration diagram for hpp::constraints::Position:

Public Member Functions

virtual ~Position () throw ()
 
void reference (const vector3_t &reference)
 Set position of target point in global frame. More...
 
const vector3_treference () const
 Get position of target point in global frame. More...
 
 Position (const std::string &name, const DevicePtr_t &robot, const JointPtr_t &joint, const vector3_t &pointInLocalFrame, const vector3_t &targetInGlobalFrame, const matrix3_t &rotation, std::vector< bool > mask)
 Constructor. 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 PositionPtr_t create (const std::string &name, const DevicePtr_t &robot, const JointPtr_t &joint, const vector3_t &pointInLocalFrame, const vector3_t &targetInGlobalFrame, const matrix3_t &rotation=matrix3_t::getIdentity(), std::vector< bool > mask=boost::assign::list_of(true)(true)(true))
 Return a shared pointer to a new instance. More...
 
static PositionPtr_t create (const DevicePtr_t &robot, const JointPtr_t &joint, const vector3_t &pointInLocalFrame, const vector3_t &targetInGlobalFrame, const matrix3_t &rotation=matrix3_t::getIdentity(), std::vector< bool > mask=boost::assign::list_of(true)(true)(true))
 Return a shared pointer to a new instance. More...
 

Static Public Attributes

static matrix3_t I3
 Identity matrix of size 3. 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 position of a robot point.

The value of the function is defined as the vector from a local point in the joint frame to a target point in the world frame expressed in some frame:

\begin{eqnarray*} \mathbf{e} &=& S B^T \left(\mathbf{x}^* - M(\mathbf{q})\mathbf{x}\right) = S B^T \left(\mathbf{x}^* - R(\mathbf{q})\mathbf{x} - \mathbf{t}(\mathbf{q})\right)\\ \mathbf{\dot{e}} &=& S B^T \left( - \left[\omega\right]_{\times}R(\mathbf{q})\mathbf{x} - \mathbf{\dot{t}}\right)\\ &=& S B^T \left( \left[R(\mathbf{q})\mathbf{x}\right]_{\times}\omega - \mathbf{\dot{t}}\right)\\ &=& S B^T \left( \left[R(\mathbf{q})\mathbf{x}\right]_{\times} J_{joint}^{\omega} - J_{joint}^{\mathbf{v}}\right)\mathbf{\dot{q}} \end{eqnarray*}

  • $S$ is a selection matrix (diagonal matrix with 1 or 0) defining whether each dof is constrained,
  • $B$ is a constant rotation matrix representing the basis in which the error is expressed
  • $\mathbf{x}^*$ is the target point in world frame,
  • $M(\mathbf{q})$ is the position of the constrained joint as an homogeneous matrix, and
  • $\mathbf{x}$ is the position of the local point in the joint frame.
    Note
    The constant rotation matrix $R$ combined with selection of degrees of freedom enable users to define constraints in a plane or along a line not necessarily aligned with the world reference frame axes.

Constructor & Destructor Documentation

◆ ~Position()

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

◆ Position()

hpp::constraints::Position::Position ( const std::string &  name,
const DevicePtr_t robot,
const JointPtr_t joint,
const vector3_t pointInLocalFrame,
const vector3_t targetInGlobalFrame,
const matrix3_t rotation,
std::vector< bool >  mask 
)

Constructor.

Parameters
namethe name of the constraints,
robotthe robot the constraint applies to,
jointthe joint the position of which is constrained,
pointInLocalFramepoint in local frame,
targetInGlobalFrametarget point in globalframe.

Member Function Documentation

◆ create() [1/2]

static EIGEN_MAKE_ALIGNED_OPERATOR_NEW PositionPtr_t hpp::constraints::Position::create ( const std::string &  name,
const DevicePtr_t robot,
const JointPtr_t joint,
const vector3_t pointInLocalFrame,
const vector3_t targetInGlobalFrame,
const matrix3_t rotation = matrix3_t::getIdentity(),
std::vector< bool >  mask = boost::assign::list_of(true)(true)(true) 
)
static

Return a shared pointer to a new instance.

Parameters
namethe name of the constraints,
robotthe robot the constraint applies to,
jointthe joint the position of which is constrained,
pointInLocalFramepoint in local frame,
targetInGlobalFrametarget point in globalframe,
rotationframe in which the error is expressed,
maskwhich component of the error vector to take into account.

◆ create() [2/2]

static PositionPtr_t hpp::constraints::Position::create ( const DevicePtr_t robot,
const JointPtr_t joint,
const vector3_t pointInLocalFrame,
const vector3_t targetInGlobalFrame,
const matrix3_t rotation = matrix3_t::getIdentity(),
std::vector< bool >  mask = boost::assign::list_of(true)(true)(true) 
)
static

Return a shared pointer to a new instance.

Parameters
robotthe robot the constraint applies to,
jointthe joint the position of which is constrained,
pointInLocalFramepoint in local frame,
targetInGlobalFrametarget point in globalframe,
rotationframe in which the error is expressed,
maskwhich component of the error vector to take into account.

◆ impl_compute()

virtual void hpp::constraints::Position::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::Position::impl_jacobian ( matrixOut_t  jacobian,
ConfigurationIn_t  arg 
) const
throw (
)
protectedvirtual

◆ reference() [1/2]

void hpp::constraints::Position::reference ( const vector3_t reference)
inline

Set position of target point in global frame.

◆ reference() [2/2]

const vector3_t& hpp::constraints::Position::reference ( ) const
inline

Get position of target point in global frame.

Member Data Documentation

◆ I3

matrix3_t hpp::constraints::Position::I3
static

Identity matrix of size 3.