op-point-modifier.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_OP_POINT_MODIFIOR_H__
11 #define __SOT_OP_POINT_MODIFIOR_H__
12 
13 #include <dynamic-graph/all-signals.h>
14 #include <dynamic-graph/entity.h>
15 #include <sot/core/debug.hh>
17 
18 /* Matrix */
19 #include <dynamic-graph/linear-algebra.h>
20 namespace dg = dynamicgraph;
21 
22 /* --------------------------------------------------------------------- */
23 /* --- API ------------------------------------------------------------- */
24 /* --------------------------------------------------------------------- */
25 
26 #if defined(WIN32)
27 #if defined(op_point_modifier_EXPORTS)
28 #define SOTOPPOINTMODIFIER_EXPORT __declspec(dllexport)
29 #else
30 #define SOTOPPOINTMODIFIER_EXPORT __declspec(dllimport)
31 #endif
32 #else
33 #define SOTOPPOINTMODIFIER_EXPORT
34 #endif
35 
36 /* --------------------------------------------------------------------- */
37 /* --- VECTOR ---------------------------------------------------------- */
38 /* --------------------------------------------------------------------- */
39 
40 namespace dynamicgraph {
41 namespace sot {
42 namespace dg = dynamicgraph;
43 
50 class SOTOPPOINTMODIFIER_EXPORT OpPointModifier : public dg::Entity {
51 public:
52  static const std::string CLASS_NAME;
53  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
54 
55 public:
56  dg::SignalPtr<dg::Matrix, int> jacobianSIN;
57  dg::SignalPtr<MatrixHomogeneous, int> positionSIN;
58 
59  dg::SignalTimeDependent<dg::Matrix, int> jacobianSOUT;
60  dg::SignalTimeDependent<MatrixHomogeneous, int> positionSOUT;
61 
62 public:
63  OpPointModifier(const std::string &name);
64  virtual ~OpPointModifier(void) {}
65 
66  dg::Matrix &jacobianSOUT_function(dg::Matrix &res, const int &time);
67  MatrixHomogeneous &positionSOUT_function(MatrixHomogeneous &res,
68  const int &time);
69  void setTransformation(const Eigen::Matrix4d &tr);
70  void setTransformationBySignalName(std::istringstream &cmdArgs);
71  const Eigen::Matrix4d &getTransformation(void);
72 
73 private:
74  MatrixHomogeneous transformation;
75 
76  /* This bool tunes the effect of the modifier for end-effector Jacobian (ie
77  * the output velocity is expressed in the end-effector frame) of from the
78  * world-ref Jacobian (ie
79  * the ouput velocity is computed in the world frame). */
80  bool isEndEffector;
81 };
82 
83 } /* namespace sot */
84 } /* namespace dynamicgraph */
85 
86 #endif // __SOT_OP_POINT_MODIFIOR_H__
dynamicgraph::sot::OpPointModifier::positionSIN
dg::SignalPtr< MatrixHomogeneous, int > positionSIN
Definition: op-point-modifier.hh:57
dynamicgraph::sot::MatrixHomogeneous
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Definition: matrix-geometry.hh:74
dynamicgraph::sot::OpPointModifier::positionSOUT
dg::SignalTimeDependent< MatrixHomogeneous, int > positionSOUT
Definition: op-point-modifier.hh:60
dynamicgraph::sot::OpPointModifier
Compute position and jacobian of a local frame attached to a joint.
Definition: op-point-modifier.hh:50
dynamicgraph::sot::OpPointModifier::~OpPointModifier
virtual ~OpPointModifier(void)
Definition: op-point-modifier.hh:64
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::OpPointModifier::getClassName
virtual const std::string & getClassName(void) const
Definition: op-point-modifier.hh:53
dynamicgraph::sot::OpPointModifier::jacobianSIN
dg::SignalPtr< dg::Matrix, int > jacobianSIN
Definition: op-point-modifier.hh:56
dynamicgraph::sot::OpPointModifier::CLASS_NAME
static const std::string CLASS_NAME
Definition: op-point-modifier.hh:52
debug.hh
SOTOPPOINTMODIFIER_EXPORT
#define SOTOPPOINTMODIFIER_EXPORT
Definition: op-point-modifier.hh:33
matrix-geometry.hh
dynamicgraph::sot::OpPointModifier::jacobianSOUT
dg::SignalTimeDependent< dg::Matrix, int > jacobianSOUT
Definition: op-point-modifier.hh:59