feature-generic.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_FEATURE_GENERIC_HH__
11 #define __SOT_FEATURE_GENERIC_HH__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* SOT */
20 
21 /* --------------------------------------------------------------------- */
22 /* --- API ------------------------------------------------------------- */
23 /* --------------------------------------------------------------------- */
24 
25 #if defined(WIN32)
26 #if defined(feature_generic_EXPORTS)
27 #define SOTFEATUREGENERIC_EXPORT __declspec(dllexport)
28 #else
29 #define SOTFEATUREGENERIC_EXPORT __declspec(dllimport)
30 #endif
31 #else
32 #define SOTFEATUREGENERIC_EXPORT
33 #endif
34 
35 /* --------------------------------------------------------------------- */
36 /* --- CLASS ----------------------------------------------------------- */
37 /* --------------------------------------------------------------------- */
38 
39 namespace dynamicgraph {
40 namespace sot {
41 namespace dg = dynamicgraph;
42 
58  : public FeatureAbstract,
59  FeatureReferenceHelper<FeatureGeneric> {
60 
61 public:
63  static const std::string CLASS_NAME;
65  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
66 
67 protected:
69 
70  /* --- SIGNALS ------------------------------------------------------------ */
71 public:
79  dg::SignalPtr<dg::Vector, int> errorSIN;
80 
82  dg::SignalPtr<dg::Matrix, int> jacobianSIN;
83 
92 
96 
97 public:
99  FeatureGeneric(const std::string &name);
100 
102  virtual ~FeatureGeneric(void) {}
103 
105  virtual unsigned int &getDimension(unsigned int &dim, int time);
106 
113  virtual dg::Vector &computeError(dg::Vector &res, int time);
114 
116  virtual dg::Matrix &computeJacobian(dg::Matrix &res, int time);
117 
121  virtual void display(std::ostream &os) const;
122 
128 };
129 
130 } /* namespace sot */
131 } /* namespace dynamicgraph */
132 
133 #endif // #ifndef __SOT_FEATURE_GENERIC_HH__
134 
135 /*
136  * Local variables:
137  * c-basic-offset: 2
138  * End:
139  */
dynamicgraph::sot::FeatureGeneric::dimensionDefault
dg::Vector::Index dimensionDefault
Definition: feature-generic.hh:68
dynamicgraph::sot::FeatureAbstract::jacobianSOUT
SignalTimeDependent< dg::Matrix, int > jacobianSOUT
Jacobian of the error wrt the robot state: .
Definition: feature-abstract.hh:190
dynamicgraph::sot::FeatureReferenceHelper
Definition: feature-abstract.hh:225
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::FeatureGeneric::getClassName
virtual const std::string & getClassName(void) const
Definition: feature-generic.hh:65
SOTFEATUREGENERIC_EXPORT
#define SOTFEATUREGENERIC_EXPORT
Definition: feature-generic.hh:32
dynamicgraph::sot::Index
Eigen::VectorXd::Index Index
Definition: robot-utils.hh:36
dynamicgraph::sot::FeatureAbstract::errorSOUT
SignalTimeDependent< dg::Vector, int > errorSOUT
This signal returns the error between the desired value and the current value : .
Definition: feature-abstract.hh:182
DECLARE_REFERENCE_FUNCTIONS
#define DECLARE_REFERENCE_FUNCTIONS(FeatureSpecialized)
Definition: feature-abstract.hh:247
dynamicgraph::sot::FeatureGeneric
Class that defines a generic implementation of the abstract interface for features.
Definition: feature-generic.hh:57
feature-abstract.hh
dynamicgraph::sot::FeatureGeneric::CLASS_NAME
static const std::string CLASS_NAME
Definition: feature-generic.hh:63
dynamicgraph::sot::FeatureAbstract
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:76
dynamicgraph::sot::FeatureGeneric::jacobianSIN
dg::SignalPtr< dg::Matrix, int > jacobianSIN
Input for the Jacobian.
Definition: feature-generic.hh:82
dynamicgraph::sot::FeatureGeneric::errorSIN
dg::SignalPtr< dg::Vector, int > errorSIN
Input for the error.
Definition: feature-generic.hh:79
dynamicgraph::sot::FeatureGeneric::~FeatureGeneric
virtual ~FeatureGeneric(void)
Default destructor.
Definition: feature-generic.hh:102
exception-task.hh