neck-limitation.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_NeckLimitation_H__
11 #define __SOT_NeckLimitation_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
18 #include <dynamic-graph/linear-algebra.h>
19 namespace dg = dynamicgraph;
20 
21 /* SOT */
22 #include <dynamic-graph/all-signals.h>
23 #include <dynamic-graph/entity.h>
25 
26 /* STD */
27 #include <list>
28 #include <map>
29 #include <string>
30 
31 /* --------------------------------------------------------------------- */
32 /* --- API ------------------------------------------------------------- */
33 /* --------------------------------------------------------------------- */
34 
35 #if defined(WIN32)
36 #if defined(neck_limitation_EXPORTS)
37 #define NeckLimitation_EXPORT __declspec(dllexport)
38 #else
39 #define NeckLimitation_EXPORT __declspec(dllimport)
40 #endif
41 #else
42 #define NeckLimitation_EXPORT
43 #endif
44 
45 /* --------------------------------------------------------------------- */
46 /* --- CLASS ----------------------------------------------------------- */
47 /* --------------------------------------------------------------------- */
48 
49 namespace dynamicgraph {
50 namespace sot {
51 
52 namespace dg = dynamicgraph;
53 
54 class NeckLimitation_EXPORT NeckLimitation : public dg::Entity {
55 public:
56  static const std::string CLASS_NAME;
57  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
58 
59 protected:
60  unsigned int panRank, tiltRank;
61  static const unsigned int PAN_RANK_DEFAULT;
62  static const unsigned int TILT_RANK_DEFAULT;
63 
64  /* The limitation is: sgn.Tilt >= Pan.alpha + beta, with alpha the linear
65  * coefficient and beta the affine one, and sgn is +1 or -1. */
66  double coeffLinearPan, coeffAffinePan;
67  double signTilt;
68  static const double COEFF_LINEAR_DEFAULT;
69  static const double COEFF_AFFINE_DEFAULT;
70  static const double SIGN_TILT_DEFAULT;
71 
72 public: /* --- CONSTRUCTION --- */
73  NeckLimitation(const std::string &name);
74  virtual ~NeckLimitation(void);
75 
76 public: /* --- SIGNAL --- */
77  dg::SignalPtr<dg::Vector, int> jointSIN;
78  dg::SignalTimeDependent<dg::Vector, int> jointSOUT;
79 
80 public: /* --- FUNCTIONS --- */
81  dg::Vector &computeJointLimitation(dg::Vector &jointLimited,
82  const int &timeSpec);
83 
84 public: /* --- PARAMS --- */
85  virtual void display(std::ostream &os) const;
86 };
87 
88 } /* namespace sot */
89 } /* namespace dynamicgraph */
90 
91 #endif // #ifndef __SOT_NeckLimitation_H__
dynamicgraph::sot::NeckLimitation::signTilt
double signTilt
Definition: neck-limitation.hh:67
dynamicgraph::sot::NeckLimitation::PAN_RANK_DEFAULT
static const unsigned int PAN_RANK_DEFAULT
Definition: neck-limitation.hh:61
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
NeckLimitation_EXPORT
#define NeckLimitation_EXPORT
Definition: neck-limitation.hh:42
dynamicgraph::sot::NeckLimitation::COEFF_LINEAR_DEFAULT
static const double COEFF_LINEAR_DEFAULT
Definition: neck-limitation.hh:68
dynamicgraph::sot::NeckLimitation::COEFF_AFFINE_DEFAULT
static const double COEFF_AFFINE_DEFAULT
Definition: neck-limitation.hh:69
dynamicgraph::sot::NeckLimitation::SIGN_TILT_DEFAULT
static const double SIGN_TILT_DEFAULT
Definition: neck-limitation.hh:70
dynamicgraph::sot::NeckLimitation::coeffLinearPan
double coeffLinearPan
Definition: neck-limitation.hh:66
dynamicgraph::sot::NeckLimitation::jointSOUT
dg::SignalTimeDependent< dg::Vector, int > jointSOUT
Definition: neck-limitation.hh:78
dynamicgraph::sot::NeckLimitation::TILT_RANK_DEFAULT
static const unsigned int TILT_RANK_DEFAULT
Definition: neck-limitation.hh:62
dynamicgraph::sot::NeckLimitation::jointSIN
dg::SignalPtr< dg::Vector, int > jointSIN
Definition: neck-limitation.hh:77
dynamicgraph::sot::NeckLimitation
Definition: neck-limitation.hh:54
dynamicgraph::sot::NeckLimitation::CLASS_NAME
static const std::string CLASS_NAME
Definition: neck-limitation.hh:56
task-abstract.hh
dynamicgraph::sot::NeckLimitation::getClassName
virtual const std::string & getClassName(void) const
Definition: neck-limitation.hh:57
dynamicgraph::sot::NeckLimitation::tiltRank
unsigned int tiltRank
Definition: neck-limitation.hh:60