dynamicgraph::sot::FeatureAbstract Class Referenceabstract

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

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

Inheritance diagram for dynamicgraph::sot::FeatureAbstract:
[legend]

Public Member Functions

virtual const std::string & getClassName (void) const
 Returns the name class. More...
 
void featureRegistration (void)
 Register the feature in the stack of tasks. More...
 
void initCommands (void)
 
 FeatureAbstract (const std::string &name)
 Default constructor: the name of the class should be given. More...
 
virtual ~FeatureAbstract (void)
 Default destructor. More...
 
Methods returning the dimension of the feature.
virtual unsigned int & getDimension (unsigned int &res, int time)=0
 Verbose method. More...
 
unsigned int getDimension (int time)
 Short method. More...
 
unsigned int getDimension (void) const
 Shortest method. More...
 
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 dg::VectorcomputeError (dg::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. More...
 
virtual dg::MatrixcomputeJacobian (dg::Matrix &res, int time)=0
 Compute the Jacobian of the error according the robot state. More...
 
virtual dg::VectorcomputeErrorDot (dg::Vector &res, int time)
 Callback for signal errordotSOUT. More...
 
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 Member Functions inherited from dynamicgraph::Entity
 Entity (const std::string &name)
 
virtual ~Entity ()
 
const std::string & getName () const
 
virtual std::string getDocString () const
 
bool hasSignal (const std::string &signame) const
 
SignalBase< int > & getSignal (const std::string &signalName)
 
const SignalBase< int > & getSignal (const std::string &signalName) const
 
std::ostream & displaySignalList (std::ostream &os) const
 
virtual std::ostream & writeCompletionList (std::ostream &os) const
 
virtual void display (std::ostream &os) const
 
virtual SignalBase< int > * test ()
 
virtual void test2 (SignalBase< int > *)
 
const std::string & getCommandList () const
 
CommandMap_t getNewStyleCommandMap ()
 
command::CommandgetNewStyleCommand (const std::string &cmdName)
 
SignalMap getSignalMap () const
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *file="", int line=0)
 
void setLoggerVerbosityLevel (LoggerVerbosity lv)
 
LoggerVerbosity getLoggerVerbosityLevel ()
 

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] \). More...
 
SignalPtr< dg::Vector, int > errordotSIN
 Derivative of the reference value. More...
 

Static Public Attributes

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

Output signals:

SignalTimeDependent< dg::Vector, int > errorSOUT
 This signal returns the error between the desired value and the current value : \( {\bf s}^*(t) - {\bf s}(t)\). More...
 
SignalTimeDependent< dg::Vector, int > errordotSOUT
 Derivative of the reference value. More...
 
SignalTimeDependent< dg::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)}\). More...
 
SignalTimeDependent< unsigned int, int > dimensionSOUT
 Returns the dimension of the feature as an output signal. More...
 
virtual std::ostream & writeGraph (std::ostream &os) const
 This method write a graph description on the file named FileName. More...
 
virtual SOT_CORE_DEPRECATED bool withErrorDot (void) const
 Return true for children that provide the errordot output signal. More...
 
virtual SignalTimeDependent< dg::Vector, int > & getErrorDot ()
 

Additional Inherited Members

- Public Types inherited from dynamicgraph::Entity
typedef std::map< std::string, SignalBase< int > * > SignalMap
 
typedef std::map< const std::string, command::Command * > CommandMap_t
 
- Protected Member Functions inherited from dynamicgraph::Entity
void addCommand (const std::string &name, command::Command *command)
 
void entityRegistration ()
 
void entityDeregistration ()
 
void signalRegistration (const SignalArray< int > &signals)
 
void signalDeregistration (const std::string &name)
 
- Protected Attributes inherited from dynamicgraph::Entity
std::string name
 
SignalMap signalMap
 
CommandMap_t commandMap
 
Logger logger_
 

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

dynamicgraph::sot::FeatureAbstract::FeatureAbstract ( const std::string &  name)

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

virtual dynamicgraph::sot::FeatureAbstract::~FeatureAbstract ( void  )
inlinevirtual

Default destructor.

Member Function Documentation

virtual void dynamicgraph::sot::FeatureAbstract::addDependenciesFromReference ( void  )
pure virtual
virtual dg::Vector& dynamicgraph::sot::FeatureAbstract::computeError ( dg::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, and dynamicgraph::sot::FeaturePosture.

virtual dg::Vector& dynamicgraph::sot::FeatureAbstract::computeErrorDot ( dg::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, and dynamicgraph::sot::FeaturePosture.

virtual dg::Matrix& dynamicgraph::sot::FeatureAbstract::computeJacobian ( dg::Matrix res,
int  time 
)
pure virtual
void dynamicgraph::sot::FeatureAbstract::featureRegistration ( void  )

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, 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.
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 SignalTimeDependent<dg::Vector,int>& dynamicgraph::sot::FeatureAbstract::getErrorDot ( )
inlinevirtual
virtual const FeatureAbstract* dynamicgraph::sot::FeatureAbstract::getReferenceAbstract ( void  ) const
pure virtual
virtual FeatureAbstract* dynamicgraph::sot::FeatureAbstract::getReferenceAbstract ( void  )
pure virtual
std::string dynamicgraph::sot::FeatureAbstract::getReferenceByName ( void  ) const
void dynamicgraph::sot::FeatureAbstract::initCommands ( void  )
virtual bool dynamicgraph::sot::FeatureAbstract::isReferenceSet ( void  ) const
inlinevirtual
virtual void dynamicgraph::sot::FeatureAbstract::removeDependenciesFromReference ( void  )
pure 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  )
inlinevirtual
virtual SOT_CORE_DEPRECATED bool dynamicgraph::sot::FeatureAbstract::withErrorDot ( void  ) const
inlinevirtual

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

const std::string dynamicgraph::sot::FeatureAbstract::CLASS_NAME
static

Store the name of the class.

SignalTimeDependent<unsigned int,int> dynamicgraph::sot::FeatureAbstract::dimensionSOUT

Returns the dimension of the feature as an output signal.

SignalPtr< dg::Vector,int > dynamicgraph::sot::FeatureAbstract::errordotSIN

Derivative of the reference value.

SignalTimeDependent< dg::Vector,int > dynamicgraph::sot::FeatureAbstract::errordotSOUT

Derivative of the reference value.

SignalTimeDependent<dg::Vector,int> dynamicgraph::sot::FeatureAbstract::errorSOUT

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

SignalTimeDependent<dg::Matrix,int> dynamicgraph::sot::FeatureAbstract::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)}\).

SignalPtr< Flags,int > dynamicgraph::sot::FeatureAbstract::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] \).