GCC Code Coverage Report


Directory: ./
File: include/sot/core/neck-limitation.hh
Date: 2024-12-13 12:22:33
Exec Total Coverage
Lines: 0 1 0.0%
Branches: 0 0 -%

Line Branch Exec Source
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
20 /* SOT */
21 #include <dynamic-graph/all-signals.h>
22 #include <dynamic-graph/entity.h>
23
24 #include <sot/core/task-abstract.hh>
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 class NeckLimitation_EXPORT NeckLimitation : public dynamicgraph::Entity {
53 public:
54 static const std::string CLASS_NAME;
55 virtual const std::string &getClassName(void) const { return CLASS_NAME; }
56
57 protected:
58 unsigned int panRank, tiltRank;
59 static const unsigned int PAN_RANK_DEFAULT;
60 static const unsigned int TILT_RANK_DEFAULT;
61
62 /* The limitation is: sgn.Tilt >= Pan.alpha + beta, with alpha the linear
63 * coefficient and beta the affine one, and sgn is +1 or -1. */
64 double coeffLinearPan, coeffAffinePan;
65 double signTilt;
66 static const double COEFF_LINEAR_DEFAULT;
67 static const double COEFF_AFFINE_DEFAULT;
68 static const double SIGN_TILT_DEFAULT;
69
70 public: /* --- CONSTRUCTION --- */
71 NeckLimitation(const std::string &name);
72 virtual ~NeckLimitation(void);
73
74 public: /* --- SIGNAL --- */
75 dynamicgraph::SignalPtr<dynamicgraph::Vector, int> jointSIN;
76 dynamicgraph::SignalTimeDependent<dynamicgraph::Vector, int> jointSOUT;
77
78 public: /* --- FUNCTIONS --- */
79 dynamicgraph::Vector &computeJointLimitation(
80 dynamicgraph::Vector &jointLimited, const int &timeSpec);
81
82 public: /* --- PARAMS --- */
83 virtual void display(std::ostream &os) const;
84 };
85
86 } /* namespace sot */
87 } /* namespace dynamicgraph */
88
89 #endif // #ifndef __SOT_NeckLimitation_H__
90