feature-joint-limits.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_JOINTLIMITS_HH__
11 #define __SOT_FEATURE_JOINTLIMITS_HH__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* SOT */
20 
21 /* --------------------------------------------------------------------- */
22 /* --- API ------------------------------------------------------------- */
23 /* --------------------------------------------------------------------- */
24 
25 #if defined(WIN32)
26 #if defined(feature_joint_limits_EXPORTS)
27 #define SOTFEATUREJOINTLIMITS_EXPORT __declspec(dllexport)
28 #else
29 #define SOTFEATUREJOINTLIMITS_EXPORT __declspec(dllimport)
30 #endif
31 #else
32 #define SOTFEATUREJOINTLIMITS_EXPORT
33 #endif
34 
35 /* --------------------------------------------------------------------- */
36 /* --- CLASS ----------------------------------------------------------- */
37 /* --------------------------------------------------------------------- */
38 
39 namespace dynamicgraph {
40 namespace sot {
41 namespace dg = dynamicgraph;
42 
48  : public FeatureAbstract,
49  FeatureReferenceHelper<FeatureJointLimits> {
50 
51 public:
52  static const std::string CLASS_NAME;
53  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
54 
55 protected:
56  double threshold;
57  const static double THRESHOLD_DEFAULT; // = .9;
58 
59  /* unsigned int freeFloatingIndex,freeFloatingSize; */
60  /* static const unsigned int FREE_FLOATING_INDEX = 0; */
61  /* static const unsigned int FREE_FLOATING_SIZE = 5; */
62 
63  /* --- SIGNALS ------------------------------------------------------------ */
64 public:
65  dg::SignalPtr<dg::Vector, int> jointSIN;
66  dg::SignalPtr<dg::Vector, int> upperJlSIN;
67  dg::SignalPtr<dg::Vector, int> lowerJlSIN;
68  dg::SignalTimeDependent<dg::Vector, int> widthJlSINTERN;
69 
71 
74 
81 public:
82  FeatureJointLimits(const std::string &name);
83  virtual ~FeatureJointLimits(void) {}
84 
85  virtual unsigned int &getDimension(unsigned int &dim, int time);
86 
87  virtual dg::Vector &computeError(dg::Vector &res, int time);
88  virtual dg::Matrix &computeJacobian(dg::Matrix &res, int time);
89  dg::Vector &computeWidthJl(dg::Vector &res, const int &time);
90 
92  inline static Flags selectActuated(void);
93 
94  virtual void display(std::ostream &os) const;
95 };
96 
97 } /* namespace sot */
98 } /* namespace dynamicgraph */
99 
100 #endif // #ifndef __SOT_FEATURE_JOINTLIMITS_HH__
101 
102 /*
103  * Local variables:
104  * c-basic-offset: 2
105  * End:
106  */
dynamicgraph::sot::FeatureJointLimits::getClassName
virtual const std::string & getClassName(void) const
Returns the name class.
Definition: feature-joint-limits.hh:53
dynamicgraph::sot::FeatureAbstract::jacobianSOUT
SignalTimeDependent< dg::Matrix, int > jacobianSOUT
Jacobian of the error wrt the robot state: .
Definition: feature-abstract.hh:190
dynamicgraph::sot::FeatureJointLimits::~FeatureJointLimits
virtual ~FeatureJointLimits(void)
Definition: feature-joint-limits.hh:83
dynamicgraph::sot::FeatureReferenceHelper
Definition: feature-abstract.hh:225
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
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
feature-abstract.hh
dynamicgraph::sot::FeatureAbstract
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:76
dynamicgraph::sot::FeatureJointLimits
Class that defines gradient vector for jl avoidance.
Definition: feature-joint-limits.hh:47
dynamicgraph::sot::FeatureJointLimits::jointSIN
dg::SignalPtr< dg::Vector, int > jointSIN
Definition: feature-joint-limits.hh:65
dynamicgraph::sot::FeatureJointLimits::widthJlSINTERN
dg::SignalTimeDependent< dg::Vector, int > widthJlSINTERN
Definition: feature-joint-limits.hh:68
SOTFEATUREJOINTLIMITS_EXPORT
#define SOTFEATUREJOINTLIMITS_EXPORT
Definition: feature-joint-limits.hh:32
exception-task.hh
dynamicgraph::sot::FeatureJointLimits::upperJlSIN
dg::SignalPtr< dg::Vector, int > upperJlSIN
Definition: feature-joint-limits.hh:66
dynamicgraph::sot::FeatureJointLimits::threshold
double threshold
Definition: feature-joint-limits.hh:56
dynamicgraph::sot::FeatureJointLimits::THRESHOLD_DEFAULT
const static double THRESHOLD_DEFAULT
Definition: feature-joint-limits.hh:57
dynamicgraph::sot::FeatureJointLimits::lowerJlSIN
dg::SignalPtr< dg::Vector, int > lowerJlSIN
Definition: feature-joint-limits.hh:67
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:170
dynamicgraph::sot::Flags
Definition: flags.hh:31
dynamicgraph::sot::FeatureJointLimits::CLASS_NAME
static const std::string CLASS_NAME
Definition: feature-joint-limits.hh:52