sot-core
4.11.4
Hierarchical task solver plug-in for dynamic-graph.
|
Go to the documentation of this file.
10 #ifndef __SOT_FEATURE_ABSTRACT_H__
11 #define __SOT_FEATURE_ABSTRACT_H__
18 #include <dynamic-graph/linear-algebra.h>
22 #include "sot/core/deprecated.hh"
23 #include <dynamic-graph/all-signals.h>
24 #include <dynamic-graph/entity.h>
81 virtual const std::string &
getClassName(
void)
const {
return CLASS_NAME; }
84 void featureRegistration(
void);
86 void initCommands(
void);
103 virtual unsigned int &getDimension(
unsigned int &res,
int time) = 0;
112 getDimension(res, time);
121 return dimensionSOUT.accessCopy();
139 virtual dynamicgraph::Vector &computeError(dynamicgraph::Vector &res,
147 virtual dynamicgraph::Matrix &computeJacobian(dynamicgraph::Matrix &res,
154 virtual dynamicgraph::Vector &computeErrorDot(dynamicgraph::Vector &res,
184 SignalTimeDependent<dynamicgraph::Vector, int>
errorSOUT;
199 virtual std::ostream &writeGraph(std::ostream &os)
const;
201 virtual SignalTimeDependent<dynamicgraph::Vector, int> &
getErrorDot() {
218 virtual void addDependenciesFromReference(
void) = 0;
219 virtual void removeDependenciesFromReference(
void) = 0;
222 void setReferenceByName(
const std::string &name);
223 std::string getReferenceByName(
void)
const;
228 FeatureSpecialized *ptr;
242 template <
class FeatureSpecialized>
245 ptr =
dynamic_cast<FeatureSpecialized *
>(sdes);
249 #define DECLARE_REFERENCE_FUNCTIONS(FeatureSpecialized) \
250 typedef FeatureReferenceHelper<FeatureSpecialized> SP; \
251 virtual void setReference(FeatureAbstract *sdes) { \
252 if (sdes == NULL) { \
254 if (SP::isReferenceSet()) \
255 removeDependenciesFromReference(); \
256 SP::unsetReference(); \
259 SP::setReference(sdes); \
260 if (SP::isReferenceSet()) \
261 addDependenciesFromReference(); \
264 virtual const FeatureAbstract *getReferenceAbstract(void) const { \
265 return SP::getReference(); \
267 virtual FeatureAbstract *getReferenceAbstract(void) { \
268 return (FeatureAbstract *)SP::getReference(); \
270 bool isReferenceSet(void) const { return SP::isReferenceSet(); } \
271 virtual void addDependenciesFromReference(void); \
272 virtual void removeDependenciesFromReference(void)
275 #define DECLARE_NO_REFERENCE \
276 virtual void setReference(FeatureAbstract *) {} \
277 virtual const FeatureAbstract *getReferenceAbstract(void) const { \
280 virtual FeatureAbstract *getReferenceAbstract(void) { return NULL; } \
281 virtual void addDependenciesFromReference(void) {} \
282 virtual void removeDependenciesFromReference(void) {} \
289 #endif // #ifndef __SOT_FEATURE_ABSTRACT_H__
unsigned int getDimension(void) const
Shortest method.
Definition: feature-abstract.hh:120
#define SOT_CORE_EXPORT
Definition: api.hh:20
SignalTimeDependent< dynamicgraph::Matrix, int > jacobianSOUT
Jacobian of the error wrt the robot state: .
Definition: feature-abstract.hh:192
SignalTimeDependent< dynamicgraph::Vector, int > errorSOUT
This signal returns the error between the desired value and the current value : .
Definition: feature-abstract.hh:184
virtual ~FeatureAbstract(void)
Default destructor.
Definition: feature-abstract.hh:92
static const std::string CLASS_NAME
Store the name of the class.
Definition: feature-abstract.hh:78
Definition: feature-abstract.hh:227
Definition: abstract-sot-external-interface.hh:17
SignalPtr< dynamicgraph::Vector, int > errordotSIN
Derivative of the reference value.
Definition: feature-abstract.hh:175
FeatureSpecialized * getReference(void)
Definition: feature-abstract.hh:238
virtual const std::string & getClassName(void) const
Returns the name class.
Definition: feature-abstract.hh:81
virtual void unsetReference(void)
Definition: feature-abstract.hh:213
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:75
SignalTimeDependent< dynamicgraph::Vector, int > errordotSOUT
Derivative of the error with respect to time: .
Definition: feature-abstract.hh:188
void setReference(FeatureAbstract *sdes)
Definition: feature-abstract.hh:243
unsigned int getDimension(int time)
Short method.
Definition: feature-abstract.hh:110
FeatureReferenceHelper(void)
Definition: feature-abstract.hh:232
void unsetReference(void)
Definition: feature-abstract.hh:236
const FeatureSpecialized * getReference(void) const
Definition: feature-abstract.hh:239
virtual SignalTimeDependent< dynamicgraph::Vector, int > & getErrorDot()
Definition: feature-abstract.hh:201
SignalPtr< Flags, int > selectionSIN
This vector specifies which dimension are used to perform the computation. For instance let us assume...
Definition: feature-abstract.hh:172
virtual bool isReferenceSet(void) const
Definition: feature-abstract.hh:216
SignalTimeDependent< unsigned int, int > dimensionSOUT
Returns the dimension of the feature as an output signal.
Definition: feature-abstract.hh:195
bool isReferenceSet(void) const
Definition: feature-abstract.hh:237