sot-core
4.11.8
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>
21 #include <dynamic-graph/all-signals.h>
22 #include <dynamic-graph/entity.h>
82 virtual const std::string &
getClassName(
void)
const {
return CLASS_NAME; }
85 void featureRegistration(
void);
87 void initCommands(
void);
104 virtual unsigned int &getDimension(
unsigned int &res,
int time) = 0;
113 getDimension(res, time);
122 return dimensionSOUT.accessCopy();
140 virtual dynamicgraph::Vector &computeError(dynamicgraph::Vector &res,
148 virtual dynamicgraph::Matrix &computeJacobian(dynamicgraph::Matrix &res,
155 virtual dynamicgraph::Vector &computeErrorDot(dynamicgraph::Vector &res,
185 SignalTimeDependent<dynamicgraph::Vector, int>
errorSOUT;
200 virtual std::ostream &writeGraph(std::ostream &os)
const;
202 virtual SignalTimeDependent<dynamicgraph::Vector, int> &
getErrorDot() {
219 virtual void addDependenciesFromReference(
void) = 0;
220 virtual void removeDependenciesFromReference(
void) = 0;
223 void setReferenceByName(
const std::string &name);
224 std::string getReferenceByName(
void)
const;
228 template <
class FeatureSpecialized>
230 FeatureSpecialized *ptr;
244 template <
class FeatureSpecialized>
247 ptr =
dynamic_cast<FeatureSpecialized *
>(sdes);
251 #define DECLARE_REFERENCE_FUNCTIONS(FeatureSpecialized) \
252 typedef FeatureReferenceHelper<FeatureSpecialized> SP; \
253 virtual void setReference(FeatureAbstract *sdes) { \
254 if (sdes == NULL) { \
256 if (SP::isReferenceSet()) removeDependenciesFromReference(); \
257 SP::unsetReference(); \
260 SP::setReference(sdes); \
261 if (SP::isReferenceSet()) 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:121
#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:193
SignalTimeDependent< dynamicgraph::Vector, int > errorSOUT
This signal returns the error between the desired value and the current value : .
Definition: feature-abstract.hh:185
virtual ~FeatureAbstract(void)
Default destructor.
Definition: feature-abstract.hh:93
static const std::string CLASS_NAME
Store the name of the class.
Definition: feature-abstract.hh:79
Definition: feature-abstract.hh:229
Definition: abstract-sot-external-interface.hh:17
SignalPtr< dynamicgraph::Vector, int > errordotSIN
Derivative of the reference value.
Definition: feature-abstract.hh:176
FeatureSpecialized * getReference(void)
Definition: feature-abstract.hh:240
virtual const std::string & getClassName(void) const
Returns the name class.
Definition: feature-abstract.hh:82
virtual void unsetReference(void)
Definition: feature-abstract.hh:214
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:76
SignalTimeDependent< dynamicgraph::Vector, int > errordotSOUT
Derivative of the error with respect to time: .
Definition: feature-abstract.hh:189
void setReference(FeatureAbstract *sdes)
Definition: feature-abstract.hh:245
unsigned int getDimension(int time)
Short method.
Definition: feature-abstract.hh:111
FeatureReferenceHelper(void)
Definition: feature-abstract.hh:234
void unsetReference(void)
Definition: feature-abstract.hh:238
const FeatureSpecialized * getReference(void) const
Definition: feature-abstract.hh:241
virtual SignalTimeDependent< dynamicgraph::Vector, int > & getErrorDot()
Definition: feature-abstract.hh:202
SignalPtr< Flags, int > selectionSIN
This vector specifies which dimension are used to perform the computation. For instance let us assume...
Definition: feature-abstract.hh:173
virtual bool isReferenceSet(void) const
Definition: feature-abstract.hh:217
SignalTimeDependent< unsigned int, int > dimensionSOUT
Returns the dimension of the feature as an output signal.
Definition: feature-abstract.hh:196
bool isReferenceSet(void) const
Definition: feature-abstract.hh:239