task-conti.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_TASKCONTI_H__
11 #define __SOT_TASKCONTI_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
18 #include <dynamic-graph/linear-algebra.h>
19 namespace dg = dynamicgraph;
20 
21 /* STD */
22 #include <string>
23 
24 /* SOT */
26 #include <sot/core/flags.hh>
27 #include <sot/core/task.hh>
28 
30 
31 /* --------------------------------------------------------------------- */
32 /* --- API ------------------------------------------------------------- */
33 /* --------------------------------------------------------------------- */
34 
35 #if defined(WIN32)
36 #if defined(task_conti_EXPORTS)
37 #define SOTTASKCONTI_EXPORT __declspec(dllexport)
38 #else
39 #define SOTTASKCONTI_EXPORT __declspec(dllimport)
40 #endif
41 #else
42 #define SOTTASKCONTI_EXPORT
43 #endif
44 
45 /* --------------------------------------------------------------------- */
46 /* --- CLASS ----------------------------------------------------------- */
47 /* --------------------------------------------------------------------- */
48 
49 namespace dynamicgraph {
50 namespace sot {
51 namespace dg = dynamicgraph;
52 
54 protected:
55  enum TimeRefValues { TIME_REF_UNSIGNIFICANT = -1, TIME_REF_TO_BE_SET = -2 };
56 
57  int timeRef;
58  double mu;
59  dg::Vector q0;
60 
61 public:
62  static const std::string CLASS_NAME;
63  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
64 
65 public:
66  TaskConti(const std::string &n);
67 
68  void referenceTime(const unsigned int &t) { timeRef = t; }
69  const int &referenceTime(void) { return timeRef; }
70 
71  /* --- COMPUTATION --- */
72  VectorMultiBound &computeContiDesiredVelocity(VectorMultiBound &task,
73  const int &time);
74 
75  /* --- SIGNALS ------------------------------------------------------------ */
76 public:
77  dg::SignalPtr<dg::Vector, int> controlPrevSIN;
78 
79  /* --- DISPLAY ------------------------------------------------------------ */
80  void display(std::ostream &os) const;
81 };
82 
83 } /* namespace sot */
84 } /* namespace dynamicgraph */
85 
86 #endif /* #ifndef __SOT_TASKCONTI_H__ */
dynamicgraph::sot::TaskConti::CLASS_NAME
static const std::string CLASS_NAME
Definition: task-conti.hh:62
dynamicgraph::sot::TaskConti::getClassName
virtual const std::string & getClassName(void) const
Definition: task-conti.hh:63
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::VectorMultiBound
std::vector< MultiBound > VectorMultiBound
Definition: multi-bound.hh:68
task.hh
feature-abstract.hh
dynamicgraph::sot::TaskConti::controlPrevSIN
dg::SignalPtr< dg::Vector, int > controlPrevSIN
Definition: task-conti.hh:77
SOTTASKCONTI_EXPORT
#define SOTTASKCONTI_EXPORT
Definition: task-conti.hh:42
dynamicgraph::sot::TaskConti::referenceTime
const int & referenceTime(void)
Definition: task-conti.hh:69
dynamicgraph::sot::TaskConti::timeRef
int timeRef
Definition: task-conti.hh:57
dynamicgraph::sot::TaskConti::TimeRefValues
TimeRefValues
Definition: task-conti.hh:55
dynamicgraph::sot::TaskConti::q0
dg::Vector q0
Definition: task-conti.hh:59
flags.hh
dynamicgraph::sot::TaskConti
Definition: task-conti.hh:53
exception-task.hh
dynamicgraph::sot::Task
Class that defines the basic elements of a task.
Definition: task.hh:75
dynamicgraph::sot::TaskConti::referenceTime
void referenceTime(const unsigned int &t)
Definition: task-conti.hh:68
dynamicgraph::sot::TaskConti::mu
double mu
Definition: task-conti.hh:58