Choreonoid  1.1
Sensor.h
[詳解]
1 
6 #ifndef CNOID_BODY_SENSOR_H_INCLUDED
7 #define CNOID_BODY_SENSOR_H_INCLUDED
8 
9 #include <cnoid/EigenTypes>
10 #include <string>
11 #include <vector>
12 #include <iostream>
13 #include "exportdecl.h"
14 
15 namespace cnoid {
16 
17  class Link;
18 
20  {
21  public:
22 
23  enum SensorType {
24  COMMON = 0,
33  NUM_SENSOR_TYPES
34  };
35 
36  static const int TYPE = COMMON;
37 
38  Sensor();
39  virtual ~Sensor();
40 
41  static Sensor* create(int type);
42  static void destroy(Sensor* sensor);
43 
44  virtual void operator=(const Sensor& org);
45 
46  virtual void clear();
47 
48  std::string name;
49  int type;
50  int id;
54 
55  virtual void putInformation(std::ostream& os);
56 
57  };
58 
59 
61  {
62  public:
63  static const int TYPE = FORCE;
64 
65  ForceSensor();
68 
69  virtual void clear();
70  virtual void putInformation(std::ostream& os);
71  };
72 
73 
75  {
76  public:
77  static const int TYPE = RATE_GYRO;
78 
81 
82  virtual void clear();
83  virtual void putInformation(std::ostream& os);
84  };
85 
86 
88  {
89  public:
90  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
91 
92  static const int TYPE = ACCELERATION;
93 
94  AccelSensor();
95 
97 
98  virtual void clear();
99  virtual void putInformation(std::ostream& os);
100 
101  // The following members are used in the ForwardDynamics class
102  Vector2 x[3];
104  };
105 
107  {
108  public:
109  static const int TYPE = RANGE;
110 
111  RangeSensor();
112 
113  double scanAngle, scanStep, scanRate, maxDistance;
114  std::vector<double> distances;
116  };
117 };
118 
119 
120 #endif
Definition: Sensor.h:32
Definition: Sensor.h:60
Vector3 w
Definition: Sensor.h:80
Vector3 localPos
Definition: Sensor.h:53
int type
Definition: Sensor.h:49
Matrix3 localR
Definition: Sensor.h:52
Definition: Sensor.h:30
Definition: Sensor.h:27
Definition: Sensor.h:19
Definition: Sensor.h:29
Definition: Sensor.h:87
bool isFirstUpdate
Definition: Sensor.h:103
Vector3 f
Definition: Sensor.h:66
int id
Definition: Sensor.h:50
Link * link
Definition: Sensor.h:51
Vector3 tau
Definition: Sensor.h:67
Definition: EasyScanner.h:16
Definition: Sensor.h:31
std::vector< double > distances
Definition: Sensor.h:114
Eigen::Vector2d Vector2
Definition: EigenTypes.h:24
Definition: Sensor.h:25
Vector3 dv
Definition: Sensor.h:96
Eigen::Vector3d Vector3
Definition: EigenTypes.h:26
double scanStep
Definition: Sensor.h:113
#define CNOID_EXPORT
Definition: Util/exportdecl.h:13
Definition: Sensor.h:26
Definition: Sensor.h:106
Definition: Sensor.h:74
std::string name
Definition: Sensor.h:48
Definition: Sensor.h:28
SensorType
Definition: Sensor.h:23
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:25
double nextUpdateTime
Definition: Sensor.h:115