Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
create
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
{
41
enum
ProtocolVersion
{
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
;
54
ProtocolVersion
getVersion
()
const
;
55
float
getAxleLength
()
const
;
56
unsigned
int
getBaud
()
const
;
57
float
getMaxVelocity
()
const
;
58
float
getWheelDiameter
()
const
;
59
63
static
RobotModel
ROOMBA_400
;
64
68
static
RobotModel
CREATE_1
;
69
73
static
RobotModel
CREATE_2
;
74
75
private
:
76
uint32_t
id
;
77
ProtocolVersion
version
;
78
float
axleLength
;
79
unsigned
int
baud
;
80
float
maxVelocity
;
81
float
wheelDiameter
;
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
87
enum
SensorPacketID
{
88
ID_GROUP_0
= 0,
89
ID_GROUP_1
= 1,
90
ID_GROUP_2
= 2,
91
ID_GROUP_3
= 3,
92
ID_GROUP_4
= 4,
93
ID_GROUP_5
= 5,
94
ID_GROUP_6
= 6,
95
ID_GROUP_100
= 100,
96
ID_GROUP_101
= 101,
97
ID_GROUP_106
= 106,
98
ID_GROUP_107
= 107,
99
ID_BUMP_WHEELDROP
= 7,
100
ID_WALL
= 8,
101
ID_CLIFF_LEFT
= 9,
102
ID_CLIFF_FRONT_LEFT
= 10,
103
ID_CLIFF_FRONT_RIGHT
= 11,
104
ID_CLIFF_RIGHT
= 12,
105
ID_VIRTUAL_WALL
= 13,
106
ID_OVERCURRENTS
= 14,
107
ID_DIRT_DETECT_LEFT
= 15,
108
ID_DIRT_DETECT_RIGHT
= 16,
109
ID_IR_OMNI
= 17,
110
ID_IR_LEFT
= 52,
111
ID_IR_RIGHT
= 53,
112
ID_BUTTONS
= 18,
113
ID_DISTANCE
= 19,
114
ID_ANGLE
= 20,
115
ID_CHARGE_STATE
= 21,
116
ID_VOLTAGE
= 22,
117
ID_CURRENT
= 23,
118
ID_TEMP
= 24,
119
ID_CHARGE
= 25,
120
ID_CAPACITY
= 26,
121
ID_WALL_SIGNAL
= 27,
122
ID_CLIFF_LEFT_SIGNAL
= 28,
123
ID_CLIFF_FRONT_LEFT_SIGNAL
= 29,
124
ID_CLIFF_FRONT_RIGHT_SIGNAL
= 30,
125
ID_CLIFF_RIGHT_SIGNAL
= 31,
126
ID_CARGO_BAY_DIGITAL_INPUTS
= 32,
127
ID_CARGO_BAY_ANALOG_SIGNAL
= 33,
128
ID_CHARGE_SOURCE
= 34,
129
ID_OI_MODE
= 35,
130
ID_SONG_NUM
= 36,
131
ID_PLAYING
= 37,
132
ID_NUM_STREAM_PACKETS
= 38,
133
ID_VEL
= 39,
134
ID_RADIUS
= 40,
135
ID_RIGHT_VEL
= 41,
136
ID_LEFT_VEL
= 42,
137
ID_LEFT_ENC
= 43,
138
ID_RIGHT_ENC
= 44,
139
ID_LIGHT
= 45,
140
ID_LIGHT_LEFT
= 46,
141
ID_LIGHT_FRONT_LEFT
= 47,
142
ID_LIGHT_CENTER_LEFT
= 48,
143
ID_LIGHT_CENTER_RIGHT
= 49,
144
ID_LIGHT_FRONT_RIGHT
= 50,
145
ID_LIGHT_RIGHT
= 51,
146
ID_LEFT_MOTOR_CURRENT
= 54,
147
ID_RIGHT_MOTOR_CURRENT
= 55,
148
ID_MAIN_BRUSH_CURRENT
= 56,
149
ID_SIDE_BRUSH_CURRENT
= 57,
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,
170
OC_DRIVE_DIRECT
= 145,
171
OC_DRIVE_PWM
= 146,
172
OC_MOTORS
= 138,
173
OC_MOTORS_PWM
= 144,
174
OC_LEDS
= 139,
175
OC_SCHEDULING_LEDS
= 162,
176
OC_DIGIT_LEDS_RAW
= 163,
177
OC_BUTTONS
= 165,
178
OC_DIGIT_LEDS_ASCII
= 164,
179
OC_SONG
= 140,
180
OC_PLAY
= 141,
181
OC_SENSORS
= 142,
182
OC_QUERY_LIST
=149,
183
OC_STREAM
= 148,
184
OC_TOGGLE_STREAM
= 150,
185
};
186
187
enum
BAUDCODE
{
188
BAUD_300
= 0,
189
BAUD_600
= 1,
190
BAUD_1200
= 2,
191
BAUD_2400
= 3,
192
BAUD_4800
= 4,
193
BAUD_9600
= 5,
194
BAUD_14400
= 6,
195
BAUD_19200
= 7,
196
BAUD_28800
= 8,
197
BAUD_38400
= 9,
198
BAUD_57600
= 10,
199
BAUD_115200
= 11
200
};
201
202
enum
CreateMode
{
203
MODE_OFF
= 0,
204
MODE_PASSIVE
= 1,
205
MODE_SAFE
= 2,
206
MODE_FULL
= 3,
207
MODE_UNAVAILABLE
= -1
208
};
209
210
enum
CleanMode
{
211
CLEAN_DEFAULT
=
OC_CLEAN
,
212
CLEAN_MAX
=
OC_MAX
,
213
CLEAN_SPOT
=
OC_SPOT
214
};
215
216
enum
ChargingState
{
217
CHARGE_NONE
= 0,
218
CHARGE_RECONDITION
= 1,
219
CHARGE_FULL
= 2,
220
CHARGE_TRICKLE
= 3,
221
CHARGE_WAITING
= 4,
222
CHARGE_FAULT
= 5
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
{
236
IR_CHAR_NONE
= 0,
237
IR_CHAR_LEFT
= 129,
238
IR_CHAR_FORWARD
= 130,
239
IR_CHAR_RIGHT
= 131,
240
IR_CHAR_SPOT
= 132,
241
IR_CHAR_MAX
= 133,
242
IR_CHAR_SMALL
= 134,
243
IR_CHAR_MEDIUM
= 135,
244
IR_CHAR_LARGE
= 136,
245
IR_CHAR_CLEAN
= 136,
246
IR_CHAR_PAUSE
= 137,
247
IR_CHAR_POWER
= 138,
248
IR_CHAR_ARC_LEFT
= 139,
249
IR_CHAR_ARC_RIGHT
= 140,
250
IR_CHAR_STOP
= 141,
251
IR_CHAR_DOWNLOAD
= 142,
252
IR_CHAR_SEEK_DOCK
= 143,
253
IR_CHAR_DOCK_RESERVED
= 240,
254
IR_CHAR_RED_BUOY
= 248,
255
IR_CHAR_GREEN_BUOY
= 244,
256
IR_CHAR_FORCE_FIELD
= 242,
257
IR_CHAR_RED_GREEN_BUOY
= 252,
258
IR_CHAR_RED_FORCE_FIELD
= 250,
259
IR_CHAR_GREEN_FORCE_FIELD
= 246,
260
IR_CHAR_RED_GREEN_FORCE_FIELD
= 254,
261
IR_CHAR_600_DOCK_RESERVED
= 160,
262
IR_CHAR_600_FORCE_FIELD
= 161,
263
IR_CHAR_600_GREEN_BUOY
= 164,
264
IR_CHAR_600_GREEN_FORCE_FIELD
= 165,
265
IR_CHAR_600_RED_BUOY
= 168,
266
IR_CHAR_600_RED_FORCE_FIELD
= 169,
267
IR_CHAR_600_RED_GREEN_BUOY
= 172,
268
IR_CHAR_600_RED_GREEN_FORCE_FIELD
= 173,
269
IR_CHAR_VIRTUAL_WALL
= 162
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
create::IR_CHAR_POWER
Definition:
types.h:247
create::OC_RESET
Definition:
types.h:156
create::ChargingState
ChargingState
Definition:
types.h:216
create::OC_FULL
Definition:
types.h:161
create::ID_GROUP_1
Definition:
types.h:89
create::RobotModel::version
ProtocolVersion version
Definition:
types.h:77
create::OC_DRIVE
Definition:
types.h:169
create::OC_DIGIT_LEDS_ASCII
Definition:
types.h:178
create::ID_CLIFF_FRONT_RIGHT
Definition:
types.h:103
create::OC_MAX
Definition:
types.h:163
create::ID_WALL
Definition:
types.h:100
create::IR_CHAR_LEFT
Definition:
types.h:237
create::ID_LIGHT_LEFT
Definition:
types.h:140
create::Pose::y
float y
Definition:
types.h:277
create::CLEAN_MAX
Definition:
types.h:212
create::CHARGE_TRICKLE
Definition:
types.h:220
create::ID_DISTANCE
Definition:
types.h:113
create::RobotModel::nextId
static uint32_t nextId
Definition:
types.h:84
create::IR_CHAR_PAUSE
Definition:
types.h:246
create::ID_GROUP_100
Definition:
types.h:95
create::RobotModel::getBaud
unsigned int getBaud() const
Definition:
types.cpp:35
create::ID_IR_LEFT
Definition:
types.h:110
create::OC_DRIVE_PWM
Definition:
types.h:171
create::ID_CLIFF_RIGHT
Definition:
types.h:104
create::ID_LEFT_MOTOR_CURRENT
Definition:
types.h:146
create::IR_CHAR_LARGE
Definition:
types.h:244
create::CHARGE_FULL
Definition:
types.h:219
create::IR_CHAR_GREEN_BUOY
Definition:
types.h:255
create::ID_GROUP_2
Definition:
types.h:90
create::IR_CHAR_GREEN_FORCE_FIELD
Definition:
types.h:259
create::BAUD_57600
Definition:
types.h:198
create::IR_CHAR_RED_BUOY
Definition:
types.h:254
create::IR_CHAR_STOP
Definition:
types.h:250
create::ID_NUM_STREAM_PACKETS
Definition:
types.h:132
create::RobotModel::CREATE_1
static RobotModel CREATE_1
Compatible with Create 1 or Roomba 500 series.
Definition:
types.h:68
create::V_3
Definition:
types.h:44
create::Pose::yaw
float yaw
Definition:
types.h:278
create::OC_BUTTONS
Definition:
types.h:177
create::CLEAN_SPOT
Definition:
types.h:213
create::OC_CLEAN
Definition:
types.h:162
create::OC_DATE
Definition:
types.h:168
create::ID_LIGHT_RIGHT
Definition:
types.h:145
create::BAUDCODE
BAUDCODE
Definition:
types.h:187
create::IR_CHAR_600_GREEN_FORCE_FIELD
Definition:
types.h:264
create::ID_GROUP_107
Definition:
types.h:98
create::IR_CHAR_SPOT
Definition:
types.h:240
create::ID_RIGHT_ENC
Definition:
types.h:138
create::BAUD_115200
Definition:
types.h:199
create::MODE_SAFE
Definition:
types.h:205
create::ID_VIRTUAL_WALL
Definition:
types.h:105
create::MODE_PASSIVE
Definition:
types.h:204
create::ID_CHARGE_SOURCE
Definition:
types.h:128
create::RobotModel::baud
unsigned int baud
Definition:
types.h:79
create::ID_CARGO_BAY_ANALOG_SIGNAL
Definition:
types.h:127
create::ID_SONG_NUM
Definition:
types.h:130
create::ID_OI_MODE
Definition:
types.h:129
create::ID_DIRT_DETECT_LEFT
Definition:
types.h:107
create::BAUD_28800
Definition:
types.h:196
create::CLEAN_DEFAULT
Definition:
types.h:211
create::Opcode
Opcode
Definition:
types.h:154
create::ID_GROUP_3
Definition:
types.h:91
create::BAUD_300
Definition:
types.h:188
create::ID_LIGHT
Definition:
types.h:139
create::IR_CHAR_600_FORCE_FIELD
Definition:
types.h:262
create::CHARGE_FAULT
Definition:
types.h:222
create::ID_CLIFF_FRONT_LEFT
Definition:
types.h:102
create::IR_CHAR_FORCE_FIELD
Definition:
types.h:256
create
Definition:
create.h:46
create::BAUD_19200
Definition:
types.h:195
create::IR_CHAR_SEEK_DOCK
Definition:
types.h:252
create::OC_SCHEDULING_LEDS
Definition:
types.h:175
create::OC_MOTORS_PWM
Definition:
types.h:173
create::ID_LEFT_ENC
Definition:
types.h:137
create::ID_CLIFF_FRONT_LEFT_SIGNAL
Definition:
types.h:123
create::ID_WALL_SIGNAL
Definition:
types.h:121
create::BAUD_14400
Definition:
types.h:194
create::BAUD_4800
Definition:
types.h:192
create::FRI
Definition:
types.h:231
create::OC_PLAY
Definition:
types.h:180
create::ID_RADIUS
Definition:
types.h:134
create::ID_ANGLE
Definition:
types.h:114
create::RobotModel::getVersion
ProtocolVersion getVersion() const
Definition:
types.cpp:27
create::IR_CHAR_DOWNLOAD
Definition:
types.h:251
create::ID_GROUP_101
Definition:
types.h:96
create::ID_NUM
Definition:
types.h:151
create::ID_GROUP_5
Definition:
types.h:93
create::V_2
Definition:
types.h:43
create::Pose
Represents a robot pose.
Definition:
types.h:275
create::ID_CLIFF_RIGHT_SIGNAL
Definition:
types.h:125
create::OC_DRIVE_DIRECT
Definition:
types.h:170
create::SensorPacketID
SensorPacketID
Definition:
types.h:87
create::ID_PLAYING
Definition:
types.h:131
create::OC_SENSORS
Definition:
types.h:181
create::IR_CHAR_600_RED_GREEN_BUOY
Definition:
types.h:267
create::MODE_UNAVAILABLE
Definition:
types.h:207
create::ID_VEL
Definition:
types.h:133
create::V_1
Definition:
types.h:42
create::ID_LIGHT_FRONT_RIGHT
Definition:
types.h:144
create::Pose::covariance
std::vector< float > covariance
3x3 covariance matrix in row-major order.
Definition:
types.h:283
create::MODE_OFF
Definition:
types.h:203
create::OC_SCHEDULE
Definition:
types.h:167
create::IR_CHAR_600_RED_BUOY
Definition:
types.h:265
create::BAUD_1200
Definition:
types.h:190
create::ID_OVERCURRENTS
Definition:
types.h:106
create::IR_CHAR_600_GREEN_BUOY
Definition:
types.h:263
create::OC_SONG
Definition:
types.h:179
create::RobotModel::getMaxVelocity
float getMaxVelocity() const
Definition:
types.cpp:39
create::ID_IR_RIGHT
Definition:
types.h:111
create::WED
Definition:
types.h:229
create::ID_CARGO_BAY_DIGITAL_INPUTS
Definition:
types.h:126
create::ID_MAIN_BRUSH_CURRENT
Definition:
types.h:148
create::ProtocolVersion
ProtocolVersion
Definition:
types.h:41
create::ID_CHARGE_STATE
Definition:
types.h:115
create::RobotModel::getWheelDiameter
float getWheelDiameter() const
Definition:
types.cpp:43
create::ID_LIGHT_CENTER_LEFT
Definition:
types.h:142
create::V_ALL
Definition:
types.h:45
create::Vel
Pose Vel
Definition:
types.h:286
create::BAUD_38400
Definition:
types.h:197
create::OC_DOCK
Definition:
types.h:165
create::ID_GROUP_106
Definition:
types.h:97
create::OC_STOP
Definition:
types.h:157
create::ID_BUMP_WHEELDROP
Definition:
types.h:99
create::ID_GROUP_4
Definition:
types.h:92
create::ID_CAPACITY
Definition:
types.h:120
create::RobotModel::RobotModel
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
create::CHARGE_WAITING
Definition:
types.h:221
create::RobotModel::id
uint32_t id
Definition:
types.h:76
create::MODE_FULL
Definition:
types.h:206
create::ID_CURRENT
Definition:
types.h:117
create::IR_CHAR_RED_GREEN_BUOY
Definition:
types.h:257
create::OC_SPOT
Definition:
types.h:164
create::OC_MOTORS
Definition:
types.h:172
create::IR_CHAR_CLEAN
Definition:
types.h:245
create::IR_CHAR_SMALL
Definition:
types.h:242
create::OC_START
Definition:
types.h:155
create::IR_CHAR_600_RED_FORCE_FIELD
Definition:
types.h:266
create::Pose::x
float x
Definition:
types.h:276
create::RobotModel::wheelDiameter
float wheelDiameter
Definition:
types.h:81
create::RobotModel::operator==
bool operator==(RobotModel &other) const
Definition:
types.cpp:15
create::ID_VOLTAGE
Definition:
types.h:116
create::ID_SIDE_BRUSH_CURRENT
Definition:
types.h:149
create::ID_CLIFF_FRONT_RIGHT_SIGNAL
Definition:
types.h:124
create::ID_IR_OMNI
Definition:
types.h:109
create::ID_LIGHT_CENTER_RIGHT
Definition:
types.h:143
create::IR_CHAR_600_DOCK_RESERVED
Definition:
types.h:261
create::IR_CHAR_RED_FORCE_FIELD
Definition:
types.h:258
create::TUE
Definition:
types.h:228
create::OC_BAUD
Definition:
types.h:158
create::OC_STREAM
Definition:
types.h:183
create::OC_TOGGLE_STREAM
Definition:
types.h:184
create::OC_POWER
Definition:
types.h:166
create::ID_RIGHT_VEL
Definition:
types.h:135
create::ID_BUTTONS
Definition:
types.h:112
create::ID_GROUP_6
Definition:
types.h:94
create::CHARGE_NONE
Definition:
types.h:217
create::IR_CHAR_MAX
Definition:
types.h:241
create::CleanMode
CleanMode
Definition:
types.h:210
create::ID_STASIS
Definition:
types.h:150
create::ID_GROUP_0
Definition:
types.h:88
create::IR_CHAR_NONE
Definition:
types.h:236
create::ID_LIGHT_FRONT_LEFT
Definition:
types.h:141
create::SAT
Definition:
types.h:232
create::IR_CHAR_FORWARD
Definition:
types.h:238
create::OC_QUERY_LIST
Definition:
types.h:182
create::OC_CONTROL
Definition:
types.h:159
create::OC_LEDS
Definition:
types.h:174
create::BAUD_9600
Definition:
types.h:193
create::RobotModel::getId
uint32_t getId() const
Definition:
types.cpp:23
create::IR_CHAR_VIRTUAL_WALL
Definition:
types.h:269
create::IR_CHAR_RED_GREEN_FORCE_FIELD
Definition:
types.h:260
create::IR_CHAR_RIGHT
Definition:
types.h:239
create::MON
Definition:
types.h:227
create::BAUD_600
Definition:
types.h:189
create::CHARGE_RECONDITION
Definition:
types.h:218
create::IR_CHAR_ARC_LEFT
Definition:
types.h:248
create::RobotModel::CREATE_2
static RobotModel CREATE_2
Compatible with Create 2 or Roomba 600 series and greater.
Definition:
types.h:73
create::RobotModel::axleLength
float axleLength
Definition:
types.h:78
create::IR_CHAR_MEDIUM
Definition:
types.h:243
create::ID_TEMP
Definition:
types.h:118
create::RobotModel::maxVelocity
float maxVelocity
Definition:
types.h:80
create::IR_CHAR_600_RED_GREEN_FORCE_FIELD
Definition:
types.h:268
create::OC_DIGIT_LEDS_RAW
Definition:
types.h:176
create::ID_RIGHT_MOTOR_CURRENT
Definition:
types.h:147
create::ID_CHARGE
Definition:
types.h:119
create::IR_CHAR_ARC_RIGHT
Definition:
types.h:249
create::RobotModel
Definition:
types.h:48
create::CreateMode
CreateMode
Definition:
types.h:202
create::DayOfWeek
DayOfWeek
Definition:
types.h:225
create::RobotModel::ROOMBA_400
static RobotModel ROOMBA_400
Compatible with Roomba 400 series and earlier.
Definition:
types.h:63
create::RobotModel::getAxleLength
float getAxleLength() const
Definition:
types.cpp:31
create::ID_LEFT_VEL
Definition:
types.h:136
create::ID_CLIFF_LEFT_SIGNAL
Definition:
types.h:122
create::THU
Definition:
types.h:230
create::OC_SAFE
Definition:
types.h:160
create::SUN
Definition:
types.h:226
create::ID_DIRT_DETECT_RIGHT
Definition:
types.h:108
create::BAUD_2400
Definition:
types.h:191
create::IRChars
IRChars
Definition:
types.h:235
create::IR_CHAR_DOCK_RESERVED
Definition:
types.h:253
create::ID_CLIFF_LEFT
Definition:
types.h:101
libcreate
Author(s): Jacob Perron
autogenerated on Sat Jun 8 2019 17:58:17