hrplib/hrpModel/Sensor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  */
14 #ifndef HRPMODEL_SENSOR_H_INCLUDED
15 #define HRPMODEL_SENSOR_H_INCLUDED
16 
17 #include <string>
18 #include <iostream>
19 #include <vector>
20 #include <hrpUtil/Eigen3d.h>
21 #include "Config.h"
22 
23 namespace hrp {
24 
25  class Link;
26 
27  class HRPMODEL_API Sensor
28  {
29  public:
30 
31  enum SensorType {
32  COMMON = 0,
41  NUM_SENSOR_TYPES
42  };
43 
44  static const int TYPE = COMMON;
45 
46  Sensor();
47  virtual ~Sensor();
48 
49  static Sensor* create(int type);
50  static void destroy(Sensor* sensor);
51 
52  virtual void operator=(const Sensor& org);
53 
54  virtual void clear();
55 
56  std::string name;
57  int type;
58  int id;
62 
63  virtual void putInformation(std::ostream& os);
64 
65  };
66 
67 
68  class HRPMODEL_API ForceSensor : public Sensor
69  {
70  public:
71  static const int TYPE = FORCE;
72 
73  ForceSensor();
76 
77  virtual void clear();
78  virtual void putInformation(std::ostream& os);
79  };
80 
81 
82  class HRPMODEL_API RateGyroSensor : public Sensor
83  {
84  public:
85  static const int TYPE = RATE_GYRO;
86 
89 
90  virtual void clear();
91  virtual void putInformation(std::ostream& os);
92  };
93 
94 
95  class HRPMODEL_API AccelSensor : public Sensor
96  {
97  public:
98  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
99 
100  static const int TYPE = ACCELERATION;
101 
102  AccelSensor();
103 
105 
106  virtual void clear();
107  virtual void putInformation(std::ostream& os);
108 
109  // The following members are used in the ForwardDynamics class
110  typedef Eigen::Vector2d vector2;
111  vector2 x[3];
113  };
114 
115  class HRPMODEL_API RangeSensor : public Sensor
116  {
117  public:
118  static const int TYPE = RANGE;
119 
120  RangeSensor();
121 
122  double scanAngle, scanStep, scanRate, maxDistance;
123  std::vector<double> distances;
125  bool isUpdated, isEnabled;
126  };
127 
128 #ifdef far
129 #undef far
130 #endif
131 #ifdef near
132 #undef near
133 #endif
134 
135  class HRPMODEL_API VisionSensor : public Sensor
136  {
137  public:
138  typedef enum {NONE, COLOR, MONO, DEPTH, COLOR_DEPTH, MONO_DEPTH} ImageType;
139  static const int TYPE = VISION;
140 
141  VisionSensor();
142  int width, height;
143  double far, near, fovy, frameRate;
144  ImageType imageType;
145  std::vector<unsigned char> image;
146  std::vector<unsigned char> depth;
148  bool isUpdated, isEnabled;
149  };
150 };
151 
152 
153 #endif
std::vector< double > distances
png_infop png_charp png_int_32 png_int_32 int * type
Definition: png.h:2332
* x
Definition: IceUtils.h:98
void clear(CorbaSequence &seq)
std::vector< unsigned char > image
Definition: inflate.h:32
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
Eigen::Matrix3d Matrix33
Definition: EigenTypes.h:12
png_infop png_uint_32 png_uint_32 * height
Definition: png.h:2309
local int destroy(gz_stream *s)
Definition: gzio.c:355
std::vector< unsigned char > depth
static BodyCustomizerHandle create(BodyHandle bodyHandle, const char *modelName)


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:25