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