GCC Code Coverage Report


Directory: ./
File: include/sot/core/motion-period.hh
Date: 2024-11-13 12:35:17
Exec Total Coverage
Lines: 0 2 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_JOINTLIMITS_HH__
11 #define __SOT_JOINTLIMITS_HH__
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/exception-task.hh>
25
26 /* --------------------------------------------------------------------- */
27 /* --- API ------------------------------------------------------------- */
28 /* --------------------------------------------------------------------- */
29
30 #if defined(WIN32)
31 #if defined(motion_period_EXPORTS)
32 #define SOTMOTIONPERIOD_EXPORT __declspec(dllexport)
33 #else
34 #define SOTMOTIONPERIOD_EXPORT __declspec(dllimport)
35 #endif
36 #else
37 #define SOTMOTIONPERIOD_EXPORT
38 #endif
39
40 /* --------------------------------------------------------------------- */
41 /* --- CLASS ----------------------------------------------------------- */
42 /* --------------------------------------------------------------------- */
43
44 /*!
45 \class MotionPeriod
46 */
47 namespace dynamicgraph {
48 namespace sot {
49
50 class SOTMOTIONPERIOD_EXPORT MotionPeriod : public dynamicgraph::Entity {
51 public:
52 static const std::string CLASS_NAME;
53 virtual const std::string &getClassName(void) const { return CLASS_NAME; }
54
55 protected:
56 enum MotionPeriodType { MOTION_CONSTANT, MOTION_SIN, MOTION_COS };
57
58 struct sotMotionParam {
59 MotionPeriodType motionType;
60 unsigned int period;
61 unsigned int initPeriod;
62 double amplitude;
63 double initAmplitude;
64 };
65
66 unsigned int size;
67 std::vector<sotMotionParam> motionParams;
68
69 void resize(const unsigned int &size);
70
71 /* --- SIGNALS ------------------------------------------------------------ */
72 public:
73 dynamicgraph::SignalTimeDependent<dynamicgraph::Vector, int> motionSOUT;
74
75 public:
76 MotionPeriod(const std::string &name);
77 virtual ~MotionPeriod(void) {}
78
79 dynamicgraph::Vector &computeMotion(dynamicgraph::Vector &res,
80 const int &time);
81
82 virtual void display(std::ostream &os) const;
83 };
84
85 } /* namespace sot */
86 } /* namespace dynamicgraph */
87
88 #endif // #ifndef __SOT_JOINTLIMITS_HH__
89
90 /*
91 * Local variables:
92 * c-basic-offset: 2
93 * End:
94 */
95