types.h
Go to the documentation of this file.
1 
32 #ifndef CREATE_TYPES_H
33 #define CREATE_TYPES_H
34 
35 #include <vector>
36 #include <stdint.h>
37 #include <string>
38 #include <stdexcept>
39 
40 namespace create {
42  V_1 = 1,
43  V_2 = 2,
44  V_3 = 4,
45  V_ALL = 0xFFFFFFFF
46  };
47 
48  class RobotModel {
49  public:
50  bool operator==(RobotModel& other) const;
51  operator uint32_t() const;
52 
53  uint32_t getId() const;
55  float getAxleLength() const;
56  unsigned int getBaud() const;
57  float getMaxVelocity() const;
58  float getWheelDiameter() const;
59 
64 
69 
74 
75  private:
76  uint32_t id;
78  float axleLength;
79  unsigned int baud;
80  float maxVelocity;
82 
83  RobotModel(const ProtocolVersion version, const float axleLength, const unsigned int baud, const float maxVelocity = 0.5, const float wheelDiameter = 0.078);
84  static uint32_t nextId;
85  };
86 
95  ID_GROUP_100 = 100,
96  ID_GROUP_101 = 101,
97  ID_GROUP_106 = 106,
98  ID_GROUP_107 = 107,
100  ID_WALL = 8,
114  ID_ANGLE = 20,
118  ID_TEMP = 24,
119  ID_CHARGE = 25,
133  ID_VEL = 39,
134  ID_RADIUS = 40,
139  ID_LIGHT = 45,
150  ID_STASIS = 58,
151  ID_NUM = 52
152  };
153 
154  enum Opcode {
155  OC_START = 128,
156  OC_RESET = 7,
157  OC_STOP = 173,
158  OC_BAUD = 129,
159  OC_CONTROL = 130,
160  OC_SAFE = 131,
161  OC_FULL = 132,
162  OC_CLEAN = 135,
163  OC_MAX = 136,
164  OC_SPOT = 134,
165  OC_DOCK = 143,
166  OC_POWER = 133,
167  OC_SCHEDULE = 167,
168  OC_DATE = 168,
169  OC_DRIVE = 137,
172  OC_MOTORS = 138,
174  OC_LEDS = 139,
177  OC_BUTTONS = 165,
179  OC_SONG = 140,
180  OC_PLAY = 141,
183  OC_STREAM = 148,
185  };
186 
187  enum BAUDCODE {
188  BAUD_300 = 0,
189  BAUD_600 = 1,
200  };
201 
202  enum CreateMode {
203  MODE_OFF = 0,
208  };
209 
210  enum CleanMode {
214  };
215 
223  };
224 
225  enum DayOfWeek {
226  SUN = 0,
227  MON = 1,
228  TUE = 2,
229  WED = 3,
230  THU = 4,
231  FRI = 5,
232  SAT = 6
233  };
234 
235  enum IRChars {
241  IR_CHAR_MAX = 133,
270  };
271 
275  struct Pose {
276  float x;
277  float y;
278  float yaw;
279 
283  std::vector<float> covariance;
284  };
285 
286  typedef Pose Vel;
287 } // namespace create
288 
289 #endif // CREATE_TYPES_H
ChargingState
Definition: types.h:216
ProtocolVersion version
Definition: types.h:77
float y
Definition: types.h:277
static uint32_t nextId
Definition: types.h:84
unsigned int getBaud() const
Definition: types.cpp:35
static RobotModel CREATE_1
Compatible with Create 1 or Roomba 500 series.
Definition: types.h:68
float yaw
Definition: types.h:278
BAUDCODE
Definition: types.h:187
unsigned int baud
Definition: types.h:79
Opcode
Definition: types.h:154
Definition: create.h:48
ProtocolVersion getVersion() const
Definition: types.cpp:27
Represents a robot pose.
Definition: types.h:275
SensorPacketID
Definition: types.h:87
std::vector< float > covariance
3x3 covariance matrix in row-major order.
Definition: types.h:283
float getMaxVelocity() const
Definition: types.cpp:39
ProtocolVersion
Definition: types.h:41
float getWheelDiameter() const
Definition: types.cpp:43
Pose Vel
Definition: types.h:286
RobotModel(const ProtocolVersion version, const float axleLength, const unsigned int baud, const float maxVelocity=0.5, const float wheelDiameter=0.078)
Definition: types.cpp:5
uint32_t id
Definition: types.h:76
float x
Definition: types.h:276
float wheelDiameter
Definition: types.h:81
bool operator==(RobotModel &other) const
Definition: types.cpp:15
CleanMode
Definition: types.h:210
uint32_t getId() const
Definition: types.cpp:23
static RobotModel CREATE_2
Compatible with Create 2 or Roomba 600 series and greater.
Definition: types.h:73
float axleLength
Definition: types.h:78
float maxVelocity
Definition: types.h:80
CreateMode
Definition: types.h:202
DayOfWeek
Definition: types.h:225
static RobotModel ROOMBA_400
Compatible with Roomba 400 series and earlier.
Definition: types.h:63
float getAxleLength() const
Definition: types.cpp:31
IRChars
Definition: types.h:235


libcreate
Author(s): Jacob Perron
autogenerated on Sat May 8 2021 03:02:37