dynamicgraph::sot::FeatureAbstract Class Reference

This class gives the abstract definition of a feature. More...

#include <sot/core/feature-abstract.hh>

Inheritance diagram for dynamicgraph::sot::FeatureAbstract:
dynamicgraph::Entity noncopyable dynamicgraph::sot::Feature1D dynamicgraph::sot::FeatureGeneric dynamicgraph::sot::FeatureJointLimits dynamicgraph::sot::FeatureLineDistance dynamicgraph::sot::FeaturePoint6d dynamicgraph::sot::FeaturePosture dynamicgraph::sot::FeaturePosture dynamicgraph::sot::FeatureVector3 dynamicgraph::sot::FeatureVisualPoint

List of all members.

Public Member Functions

virtual const std::string & getClassName (void) const
 Returns the name class.
void featureRegistration (void)
 Register the feature in the stack of tasks.
void initCommands (void)
 FeatureAbstract (const std::string &name)
 Default constructor: the name of the class should be given.
virtual ~FeatureAbstract (void)
 Default destructor.
Methods returning the dimension of the feature.
virtual unsigned int & getDimension (unsigned int &res, int time)=0
 Verbose method.
unsigned int getDimension (int time)
 Short method.
unsigned int getDimension (void) const
 Shortest method.
Methods to control internal computation.

The main idea is that some feature may have a lower frequency than the internal control loop. In this case, the methods for computation are called only when needed.

virtual ml::VectorcomputeError (ml::Vector &res, int time)=0
 Compute the error between the desired feature and the current value of the feature measured or deduced from the robot state.
virtual ml::MatrixcomputeJacobian (ml::Matrix &res, int time)=0
 Compute the Jacobian of the error according the robot state.
virtual ml::VectorcomputeErrorDot (ml::Vector &res, int time)
 Callback for signal errordotSOUT.
Reference
virtual void setReference (FeatureAbstract *sdes)=0
virtual void unsetReference (void)
virtual const FeatureAbstractgetReferenceAbstract (void) const =0
virtual FeatureAbstractgetReferenceAbstract (void)=0
virtual bool isReferenceSet (void) const
virtual void addDependenciesFromReference (void)=0
virtual void removeDependenciesFromReference (void)=0
void setReferenceByName (const std::string &name)
std::string getReferenceByName (void) const

Public Attributes

Input signals:
SignalPtr< Flags, int > selectionSIN
 This vector specifies which dimension are used to perform the computation. For instance let us assume that the feature is a 3D point. If only the Y-axis should be used for computing error, activation and Jacobian, then the vector to specify is $ [ 0 1 0] $.
SignalPtr< ml::Vector, int > errordotSIN
 Derivative of the reference value.

Static Public Attributes

static const std::string CLASS_NAME
 Store the name of the class.

Output signals:

SignalTimeDependent
< ml::Vector, int > 
errorSOUT
 This signal returns the error between the desired value and the current value : $ {\bf s}^*(t) - {\bf s}(t)$.
SignalTimeDependent
< ml::Vector, int > 
errordotSOUT
 Derivative of the reference value.
SignalTimeDependent
< ml::Matrix, int > 
jacobianSOUT
 This signal returns the Jacobian of the current value according to the robot state: $ J(t) = \frac{\delta{\bf s}^*(t)}{\delta {\bf q}(t)}$.
SignalTimeDependent< unsigned
int, int > 
dimensionSOUT
 Returns the dimension of the feature as an output signal.
virtual std::ostream & writeGraph (std::ostream &os) const
 This method write a graph description on the file named FileName.
virtual bool withErrorDot (void) const SOT_CORE_DEPRECATED
 Return true for children that provide the errordot output signal.
virtual SignalTimeDependent
< ml::Vector, int > & 
getErrorDot ()

Detailed Description

This class gives the abstract definition of a feature.

In short, a feature is a data evolving according to time. It is defined by a vector ${\bf s}(t) \in \mathbb{R}^n $ where $ t $ is the time. By default a feature has a desired ${\bf s}^*(t) $. ${\bf s}^*$ is provided by another feature of the same type called reference. The feature is in charge of collecting its own current state. A feature is supposed to compute an error between its current state and the desired one: $ e(t) = {\bf s}^*(t) - {\bf s}(t) $. A feature is supposed to compute a Jacobian according to the robot state vector $ \frac{\delta {\bf s}(t)}{\delta {\bf q}(t)}$.

The task is in general computed from the value of the feature at the current instant $f(q(t),t)$, the Jacobian $J$ and evolution of the feature with respect to time: $\frac{\partial f}{\partial t}$.

feature.png
Feature diagram: Feature types derive from FeatureAbstract. Each feature has a reference of the same type and compute an error by comparing errorSIN signals from itself and from the reference.

Constructor & Destructor Documentation

Default constructor: the name of the class should be given.

virtual dynamicgraph::sot::FeatureAbstract::~FeatureAbstract ( void  ) [inline, virtual]

Default destructor.


Member Function Documentation

virtual ml::Vector& dynamicgraph::sot::FeatureAbstract::computeError ( ml::Vector res,
int  time 
) [pure virtual]

Compute the error between the desired feature and the current value of the feature measured or deduced from the robot state.

[out] res: The error will be set into res.
[in] time: The time at which the error is computed.
Returns:
The vector res with the appropriate value.

Implemented in dynamicgraph::sot::FeatureGeneric, dynamicgraph::sot::Feature1D, dynamicgraph::sot::FeaturePoint6d, dynamicgraph::sot::FeatureJointLimits, dynamicgraph::sot::FeaturePoint6dRelative, dynamicgraph::sot::FeatureLineDistance, dynamicgraph::sot::FeatureVisualPoint, dynamicgraph::sot::FeatureVector3, dynamicgraph::sot::FeaturePosture, and dynamicgraph::sot::FeaturePosture.

virtual ml::Vector& dynamicgraph::sot::FeatureAbstract::computeErrorDot ( ml::Vector res,
int  time 
) [virtual]

Callback for signal errordotSOUT.

Copy components of the input signal errordotSIN defined by selection flag selectionSIN.

Reimplemented in dynamicgraph::sot::FeaturePoint6dRelative.

Register the feature in the stack of tasks.

virtual unsigned int& dynamicgraph::sot::FeatureAbstract::getDimension ( unsigned int &  res,
int  time 
) [pure virtual]

Verbose method.

res: The integer in which the dimension will be return.
time: The time at which the feature should be considered.
Returns:
Dimension of the feature.
Note:
Be careful with features changing their dimension according to time.

Implemented in dynamicgraph::sot::FeatureGeneric, dynamicgraph::sot::Feature1D, dynamicgraph::sot::FeaturePoint6d, dynamicgraph::sot::FeatureJointLimits, dynamicgraph::sot::FeatureLineDistance, dynamicgraph::sot::FeatureVisualPoint, dynamicgraph::sot::FeatureVector3, dynamicgraph::sot::FeaturePosture, and dynamicgraph::sot::FeaturePosture.

unsigned int dynamicgraph::sot::FeatureAbstract::getDimension ( int  time) [inline]

Short method.

time: The time at which the feature should be considered.
Returns:
Dimension of the feature.
Note:
Be careful with features changing their dimension according to time.

References getDimension().

Referenced by getDimension().

unsigned int dynamicgraph::sot::FeatureAbstract::getDimension ( void  ) const [inline]

Shortest method.

Returns:
Dimension of the feature.
Note:
The feature is not changing its dimension according to time.
virtual const FeatureAbstract* dynamicgraph::sot::FeatureAbstract::getReferenceAbstract ( void  ) const [pure virtual]
virtual bool dynamicgraph::sot::FeatureAbstract::isReferenceSet ( void  ) const [inline, virtual]
virtual void dynamicgraph::sot::FeatureAbstract::setReference ( FeatureAbstract sdes) [pure virtual]
void dynamicgraph::sot::FeatureAbstract::setReferenceByName ( const std::string &  name)
virtual void dynamicgraph::sot::FeatureAbstract::unsetReference ( void  ) [inline, virtual]
virtual bool dynamicgraph::sot::FeatureAbstract::withErrorDot ( void  ) const [inline, virtual]

Return true for children that provide the errordot output signal.

virtual std::ostream& dynamicgraph::sot::FeatureAbstract::writeGraph ( std::ostream &  os) const [virtual]

This method write a graph description on the file named FileName.

Reimplemented from dynamicgraph::Entity.


Member Data Documentation

Returns the dimension of the feature as an output signal.

Derivative of the reference value.

This signal returns the error between the desired value and the current value : $ {\bf s}^*(t) - {\bf s}(t)$.

This signal returns the Jacobian of the current value according to the robot state: $ J(t) = \frac{\delta{\bf s}^*(t)}{\delta {\bf q}(t)}$.

This vector specifies which dimension are used to perform the computation. For instance let us assume that the feature is a 3D point. If only the Y-axis should be used for computing error, activation and Jacobian, then the vector to specify is $ [ 0 1 0] $.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines