Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Copyright 2011, |
3 |
|
|
* Olivier Stasse, CNRS |
4 |
|
|
* |
5 |
|
|
* CNRS |
6 |
|
|
* |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
#ifndef ABSTRACT_SOT_EXTERNAL_INTERFACE_HH |
10 |
|
|
#define ABSTRACT_SOT_EXTERNAL_INTERFACE_HH |
11 |
|
|
|
12 |
|
|
#include <map> |
13 |
|
|
#include <sot/core/api.hh> |
14 |
|
|
#include <string> |
15 |
|
|
#include <vector> |
16 |
|
|
|
17 |
|
|
namespace dynamicgraph { |
18 |
|
|
namespace sot { |
19 |
|
|
|
20 |
|
|
class SOT_CORE_EXPORT NamedVector { |
21 |
|
|
private: |
22 |
|
|
std::string name_; |
23 |
|
|
std::vector<double> values_; |
24 |
|
|
|
25 |
|
|
public: |
26 |
|
2 |
NamedVector() {} |
27 |
|
2 |
~NamedVector() {} |
28 |
|
|
|
29 |
|
|
const std::string &getName() const { return name_; } |
30 |
|
|
|
31 |
|
1 |
void setName(const std::string &aname) { name_ = aname; } |
32 |
|
|
|
33 |
|
1 |
const std::vector<double> &getValues() const { return values_; } |
34 |
|
|
|
35 |
|
1 |
void setValues(const std::vector<double> &values) { values_ = values; } |
36 |
|
|
}; |
37 |
|
|
typedef NamedVector SensorValues; |
38 |
|
|
typedef NamedVector ControlValues; |
39 |
|
|
|
40 |
|
|
class SOT_CORE_EXPORT AbstractSotExternalInterface { |
41 |
|
|
public: |
42 |
|
10 |
AbstractSotExternalInterface() {} |
43 |
|
|
|
44 |
|
20 |
virtual ~AbstractSotExternalInterface() {} |
45 |
|
|
|
46 |
|
|
virtual void setupSetSensors( |
47 |
|
|
std::map<std::string, SensorValues> &sensorsIn) = 0; |
48 |
|
|
|
49 |
|
|
virtual void nominalSetSensors( |
50 |
|
|
std::map<std::string, SensorValues> &sensorsIn) = 0; |
51 |
|
|
|
52 |
|
|
virtual void cleanupSetSensors( |
53 |
|
|
std::map<std::string, SensorValues> &sensorsIn) = 0; |
54 |
|
|
|
55 |
|
|
virtual void getControl(std::map<std::string, ControlValues> &) = 0; |
56 |
|
|
virtual void setSecondOrderIntegration(void) = 0; |
57 |
|
|
virtual void setNoIntegration(void) = 0; |
58 |
|
|
}; |
59 |
|
|
} // namespace sot |
60 |
|
|
} // namespace dynamicgraph |
61 |
|
|
|
62 |
|
|
typedef dynamicgraph::sot::AbstractSotExternalInterface * |
63 |
|
|
createSotExternalInterface_t(); |
64 |
|
|
typedef void destroySotExternalInterface_t( |
65 |
|
|
dynamicgraph::sot::AbstractSotExternalInterface *); |
66 |
|
|
|
67 |
|
|
#endif // ABSTRACT_SOT_EXTERNAL_INTERFACE_HH |
68 |
|
|
|