sot-core  4.11.6
Hierarchical task solver plug-in for dynamic-graph.
feature-pose.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019,
3  * Joseph Mirabel
4  *
5  * LAAS-CNRS
6  *
7  */
8 
9 #ifndef __SOT_FEATURE_POSE_HH__
10 #define __SOT_FEATURE_POSE_HH__
11 
12 /* --------------------------------------------------------------------- */
13 /* --- INCLUDE --------------------------------------------------------- */
14 /* --------------------------------------------------------------------- */
15 
16 /* SOT */
17 #include <sot/core/config.hh>
20 
21 /* --------------------------------------------------------------------- */
22 /* --- CLASS ----------------------------------------------------------- */
23 /* --------------------------------------------------------------------- */
24 
25 namespace dynamicgraph {
26 namespace sot {
27 
30 
61 template <Representation_t representation = R3xSO3Representation>
62 class SOT_CORE_DLLAPI FeaturePose : public FeatureAbstract {
63 
64 public:
65  static const std::string CLASS_NAME;
66  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
67 
68 public:
72  dynamicgraph::SignalPtr<MatrixHomogeneous, int> oMja;
75  dynamicgraph::SignalPtr<MatrixHomogeneous, int> jaMfa;
77  dynamicgraph::SignalPtr<MatrixHomogeneous, int> oMjb;
79  dynamicgraph::SignalPtr<MatrixHomogeneous, int> jbMfb;
81  dynamicgraph::SignalPtr<Matrix, int> jaJja;
83  dynamicgraph::SignalPtr<Matrix, int> jbJjb;
84 
86  dynamicgraph::SignalPtr<MatrixHomogeneous, int> faMfbDes;
89  dynamicgraph::SignalPtr<Vector, int> faNufafbDes;
95  SignalTimeDependent<MatrixHomogeneous, int> faMfb;
97 
100  SignalTimeDependent<Vector7, int> q_faMfb;
101 
104  SignalTimeDependent<Vector7, int> q_faMfbDes;
110 
116 public:
117  FeaturePose(const std::string &name);
118  virtual ~FeaturePose(void);
119 
120  virtual unsigned int &getDimension(unsigned int &dim, int time);
121 
123  virtual dynamicgraph::Vector &computeError(dynamicgraph::Vector &res,
124  int time);
131  virtual dynamicgraph::Vector &computeErrorDot(dynamicgraph::Vector &res,
132  int time);
139  virtual dynamicgraph::Matrix &computeJacobian(dynamicgraph::Matrix &res,
140  int time);
141 
142  virtual void display(std::ostream &os) const;
143 
144 public:
145  void servoCurrentPosition(const int &time);
146 
147 private:
148  MatrixHomogeneous &computefaMfb(MatrixHomogeneous &res, int time);
149  Vector7 &computeQfaMfb(Vector7 &res, int time);
150  Vector7 &computeQfaMfbDes(Vector7 &res, int time);
151 
153 };
154 
155 template <typename T>
156 Vector6d convertVelocity(const MatrixHomogeneous &M,
157  const MatrixHomogeneous &Mdes,
158  const Vector &faNufafbDes);
159 
160 template <> const std::string FeaturePose<SE3Representation>::CLASS_NAME;
161 template <> const std::string FeaturePose<R3xSO3Representation>::CLASS_NAME;
162 
163 #if __cplusplus >= 201103L
164 extern template class SOT_CORE_DLLAPI FeaturePose<SE3Representation>;
165 extern template class SOT_CORE_DLLAPI FeaturePose<R3xSO3Representation>;
166 #endif
167 
170 
171 } /* namespace sot */
172 } /* namespace dynamicgraph */
173 
174 #endif // #ifndef __SOT_FEATURE_POSE_HH__
175 
176 /*
177  * Local variables:
178  * c-basic-offset: 2
179  * End:
180  */
dynamicgraph::sot::FeaturePose::jaJja
dynamicgraph::SignalPtr< Matrix, int > jaJja
Jacobian of the input Joint A, expressed in Joint A
Definition: feature-pose.hh:81
DECLARE_NO_REFERENCE
#define DECLARE_NO_REFERENCE
Definition: feature-abstract.hh:275
dynamicgraph::sot::FeaturePose::jbJjb
dynamicgraph::SignalPtr< Matrix, int > jbJjb
Jacobian of the input Joint B, expressed in Joint B
Definition: feature-pose.hh:83
dynamicgraph::sot::SE3Representation
@ SE3Representation
Definition: feature-pose.hh:29
dynamicgraph::sot::MatrixHomogeneous
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Definition: matrix-geometry.hh:74
dynamicgraph::sot::FeatureAbstract::jacobianSOUT
SignalTimeDependent< dynamicgraph::Matrix, int > jacobianSOUT
Jacobian of the error wrt the robot state: .
Definition: feature-abstract.hh:192
dynamicgraph::sot::FeatureAbstract::errorSOUT
SignalTimeDependent< dynamicgraph::Vector, int > errorSOUT
This signal returns the error between the desired value and the current value : .
Definition: feature-abstract.hh:184
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::FeaturePose::q_faMfbDes
SignalTimeDependent< Vector7, int > q_faMfbDes
Definition: feature-pose.hh:104
feature-abstract.hh
dynamicgraph::sot::FeaturePose::q_faMfb
SignalTimeDependent< Vector7, int > q_faMfb
Definition: feature-pose.hh:100
dynamicgraph::sot::FeaturePose::faNufafbDes
dynamicgraph::SignalPtr< Vector, int > faNufafbDes
Definition: feature-pose.hh:89
dynamicgraph::sot::FeatureAbstract
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:75
dynamicgraph::sot::R3xSO3Representation
@ R3xSO3Representation
Definition: feature-pose.hh:29
dynamicgraph::sot::FeaturePose::jbMfb
dynamicgraph::SignalPtr< MatrixHomogeneous, int > jbMfb
Input pose of Frame B wrt to Joint B.
Definition: feature-pose.hh:79
dynamicgraph::sot::FeaturePose::jaMfa
dynamicgraph::SignalPtr< MatrixHomogeneous, int > jaMfa
Input pose of Frame A wrt to Joint A.
Definition: feature-pose.hh:75
dynamicgraph::sot::FeaturePose_t
FeaturePose< R3xSO3Representation > FeaturePose_t
Definition: feature-pose.hh:168
dynamicgraph::sot::FeaturePose
Feature that controls the relative (or absolute) pose between two frames A (or world) and B.
Definition: feature-pose.hh:62
dynamicgraph::sot::FeaturePoseSE3_t
FeaturePose< SE3Representation > FeaturePoseSE3_t
Definition: feature-pose.hh:169
dynamicgraph::sot::convertVelocity
Vector6d convertVelocity(const MatrixHomogeneous &M, const MatrixHomogeneous &Mdes, const Vector &faNufafbDes)
dynamicgraph::sot::FeaturePose::CLASS_NAME
static const std::string CLASS_NAME
Definition: feature-pose.hh:65
dynamicgraph::sot::FeaturePose::getClassName
virtual const std::string & getClassName(void) const
Returns the name class.
Definition: feature-pose.hh:66
dynamicgraph::sot::Representation_t
Representation_t
Enum used to specify what difference operation is used in FeaturePose.
Definition: feature-pose.hh:29
matrix-geometry.hh
dynamicgraph::sot::Vector7
Eigen::Matrix< double, 7, 1 > SOT_CORE_EXPORT Vector7
Definition: matrix-geometry.hh:83
dynamicgraph::sot::FeatureAbstract::selectionSIN
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
dynamicgraph::sot::FeaturePose::oMjb
dynamicgraph::SignalPtr< MatrixHomogeneous, int > oMjb
Input pose of Joint B wrt to world frame.
Definition: feature-pose.hh:77
dynamicgraph::sot::FeaturePose::faMfbDes
dynamicgraph::SignalPtr< MatrixHomogeneous, int > faMfbDes
The desired pose of Frame B wrt to Frame A.
Definition: feature-pose.hh:86