Main Page
Classes
Files
File List
File Members
include
p2os_driver
robot_params.hpp
Go to the documentation of this file.
1
/*
2
* P2OS for ROS
3
* Copyright (C) 2009 David Feil-Seifer, Brian Gerkey, Kasper Stoy,
4
* Richard Vaughan, & Andrew Howard
5
* Copyright (C) 2018 Hunter L. Allen
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
*
21
*/
22
#ifndef P2OS_DRIVER__ROBOT_PARAMS_HPP_
23
#define P2OS_DRIVER__ROBOT_PARAMS_HPP_
24
/*
25
* robot_params.hpp
26
*
27
* ActivMedia robot parameters, automatically generated by saphconv.tcl from
28
* Saphira parameter files:
29
* amigo.p
30
* amigo-sh.p
31
* p2at.p
32
* p2at8+.p
33
* p2at8.p
34
* p2ce.p
35
* p2d8+.p
36
* p2d8.p
37
* p2de.p
38
* p2df.p
39
* p2dx.p
40
* p2it.p
41
* p2pb.p
42
* p2pp.p
43
* p3at-sh.p
44
* p3at.p
45
* p3atiw.p
46
* p3dx-sh.p
47
* p3dx.p
48
* peoplebot-sh.p
49
* perfpb+.p
50
* perfpb.p
51
* pion1m.p
52
* pion1x.p
53
* pionat.p
54
* powerbot-sh.p
55
* powerbot.p
56
* psos1m.p
57
* psos1x.p
58
* p3dx-sh-lms1xx.p
59
*/
60
#include <string>
61
62
void
initialize_robot_params
(
void
);
63
64
65
#define PLAYER_NUM_ROBOT_TYPES 30
66
67
// Default max speeds
68
#define MOTOR_DEF_MAX_SPEED 0.5
69
#define MOTOR_DEF_MAX_TURNSPEED DTOR(100)
70
71
/*
72
* Apparently, newer kernel require a large value (200000) here. It only
73
* makes the initialization phase take a bit longer, and doesn't have any
74
* impact on the speed at which packets are received from P2OS
75
*/
76
#define P2OS_CYCLETIME_USEC 200000
77
78
/* p2os constants */
79
80
#define P2OS_NOMINAL_VOLTAGE 12.0
81
82
/* Command numbers */
83
#define SYNC0 0
84
#define SYNC1 1
85
#define SYNC2 2
86
87
enum
P2OSCommand
88
{
89
PULSE
= 0,
90
OPEN
= 1,
91
CLOSE
= 2,
92
ENABLE
= 4,
93
SETA
= 5,
94
SETV
= 6,
95
SETO
= 7,
96
MOVE
= 8,
// int, translational move (mm)
97
ROTATE
= 9,
// int, set rotational velocity, duplicate of RVEL (deg/sec)
98
SETRV
= 10,
// int, sets the maximum rotational velocity (deg/sec)
99
VEL
= 11,
100
HEAD
= 12,
// int, turn to absolute heading 0-359 (degrees)
101
DHEAD
= 13,
// int, turn relative to current heading (degrees)
102
// DROTATE = 14, does not really exist
103
SAY
= 15,
// string, makes the robot beep.
104
// up to 20 pairs of duration (20 ms incrs) and tones (halfcycle)
105
JOYINFO
= 17,
// int, requests joystick packet, 0 to stop, 1 for 1, 2 for
106
// continuous
107
CONFIG
= 18,
// int, request configuration packet
108
ENCODER
= 19,
// int, > 0 to request continous stream of packets, 0 to stop
109
RVEL
= 21,
110
DCHEAD
= 22,
// int, colbert relative heading setpoint (degrees)
111
SETRA
= 23,
112
SONAR
= 28,
113
STOP
= 29,
114
DIGOUT
= 30,
// int, sets the digout lines
115
// TIMER = 31, ... no clue about this one
116
VEL2
= 32,
117
GRIPPER
= 33,
118
// KICK = 34, um...
119
ADSEL
= 35,
// int, select the port given as argument
120
GRIPPERVAL
= 36,
121
GRIPPERPACREQUEST
= 37,
// p2 gripper packet request
122
IOREQUEST
= 40,
// request iopackets from p2os
123
PTUPOS
= 41,
// most-sig byte is port number, least-sig byte is pulse width
124
TTY2
= 42,
// Added in AmigOS 1.2
125
GETAUX
= 43,
// Added in AmigOS 1.2
126
BUMP_STALL
= 44,
127
TCM2
= 45,
// TCM2 module commands, see tcm2 manual for details
128
JOYDRIVE
= 47,
129
MOVINGBLINK
= 49,
// int, 1 to blink lamp quickly before moving, 0 not to
131
HOSTBAUD
= 50,
// int, set baud rate for host port - 0=9600, 1=19200,
133
AUX1BAUD
= 51,
// int, set baud rate for Aux1 - 0=9600, 1=19200, 2=38400,
135
AUX2BAUD
= 52,
// int, set baud rate for Aux2 - 0=9600, 1=19200, 2=38400,
137
ESTOP
= 55,
// none, emergency stop, overrides decel
138
ESTALL
= 56,
// ?
139
GYRO
= 58,
// Added in AROS 1.8
140
// SRISIM specific:
141
142
// for calibrating the compass:
143
CALCOMP
= 65,
// int, commands for calibrating compass, see compass manual
144
145
TTY3
= 66,
// Added in AmigOS 1.3
146
GETAUX2
= 67,
// Added in AmigOS 1.3
147
ARM_INFO
= 70,
148
ARM_STATUS
= 71,
149
ARM_INIT
= 72,
150
ARM_CHECK
= 73,
151
ARM_POWER
= 74,
152
ARM_HOME
= 75,
153
ARM_PARK
= 76,
154
ARM_POS
= 77,
155
ARM_SPEED
= 78,
156
ARM_STOP
= 79,
157
ARM_AUTOPARK
= 80,
158
ARM_GRIPPARK
= 81,
159
160
ROTKP
= 82,
// Added in P2OS1.M
161
ROTKV
= 83,
// Added in P2OS1.M
162
ROTKI
= 84,
// Added in P2OS1.M
163
TRANSKP
= 85,
// Added in P2OS1.M
164
TRANSKV
= 86,
// Added in P2OS1.M
165
TRANSKI
= 87,
// Added in P2OS1.M
166
SOUND
= 90,
167
PLAYLIST
= 91,
168
SOUNDTOG
= 92,
// int, AmigoBot (old H8 model) specific, enable(1) or
170
// Power commands
171
POWER_PC
= 95,
172
POWER_LRF
= 96,
173
POWER_5V
= 97,
174
POWER_12V
= 98,
175
POWER_24V
= 98,
176
POWER_AUX_PC
= 125,
177
POWER_TOUCHSCREEN
= 126,
178
POWER_PTZ
= 127,
179
POWER_AUDIO
= 128,
180
POWER_LRF2
= 129,
181
182
// For SEEKUR or later lateral-capable robots
183
LATVEL
= 110,
// int, sets the lateral velocity (mm)
184
LATACCEL
= 113,
// int, sets the lateral acceleration (+, mm/sec2) or
186
SETLATV
= 0,
// int, someday will set the vel
187
};
188
189
/* Server Information Packet (SIP) types */
190
#define STATUSSTOPPED 0x32
191
#define STATUSMOVING 0x33
192
#define ENCODER 0x90
193
#define SERAUX 0xB0
194
#define SERAUX2 0xB8 // Added in AmigOS 1.3
195
#define GYROPAC 0x98 // Added AROS 1.8
196
#define ARMPAC 160 // ARMpac
197
#define ARMINFOPAC 161 // ARMINFOpac
198
// #define PLAYLIST 0xD0
199
200
/* Argument types */
201
#define ARGINT 0x3B // Positive int (LSB, MSB)
202
#define ARGNINT 0x1B // Negative int (LSB, MSB)
203
#define ARGSTR 0x2B // String (Note: 1st byte is length!!)
204
205
/* gripper stuff */
206
#define GRIPopen 1
207
#define GRIPclose 2
208
#define GRIPstop 3
209
#define LIFTup 4
210
#define LIFTdown 5
211
#define LIFTstop 6
212
#define GRIPstore 7
213
#define GRIPdeploy 8
214
#define GRIPhalt 15
215
#define GRIPpress 16
216
#define LIFTcarry 17
217
218
/* CMUcam stuff */
219
#define CMUCAM_IMAGE_WIDTH 80
220
#define CMUCAM_IMAGE_HEIGHT 143
221
#define CMUCAM_MESSAGE_LEN 10
222
223
/* conection stuff */
224
#define DEFAULT_P2OS_PORT "/dev/ttyS0"
225
#define DEFAULT_P2OS_TCP_REMOTE_HOST "localhost"
226
#define DEFAULT_P2OS_TCP_REMOTE_PORT 8101
227
228
/* degrees and radians */
229
#define DTOR(a) M_PI * a / 180.0
230
#define RTOD(a) 180.0 * a / M_PI
231
232
typedef
struct
233
{
234
double
x
;
235
double
y
;
236
double
th
;
237
double
length
;
238
double
radius
;
239
}
bumper_def_t
;
240
241
typedef
struct
242
{
243
double
x
;
244
double
y
;
245
double
th
;
246
}
sonar_pose_t
;
247
248
249
typedef
struct
250
{
251
double
AngleConvFactor
;
252
std::string
Class
;
253
double
DiffConvFactor
;
254
double
DistConvFactor
;
255
int
FrontBumpers
;
256
double
GyroScaler
;
257
int
HasMoveCommand
;
258
int
Holonomic
;
259
int
IRNum
;
260
int
IRUnit
;
261
int
LaserFlipped
;
262
std::string
LaserIgnore
;
263
std::string
LaserPort
;
264
int
LaserPossessed
;
265
int
LaserPowerControlled
;
266
int
LaserTh
;
267
int
LaserX
;
268
int
LaserY
;
269
int
MaxRVelocity
;
270
int
MaxVelocity
;
271
int
NewTableSensingIR
;
272
int
NumFrontBumpers
;
273
int
NumRearBumpers
;
274
double
RangeConvFactor
;
275
int
RearBumpers
;
276
int
RequestEncoderPackets
;
277
int
RequestIOPackets
;
278
int
RobotDiagonal
;
279
int
RobotLength
;
280
int
RobotRadius
;
281
int
RobotWidth
;
282
int
RotAccel
;
283
int
RotDecel
;
284
int
RotVelMax
;
285
int
SettableAccsDecs
;
286
int
SettableVelMaxes
;
287
int
SonarNum
;
288
std::string
Subclass
;
289
int
SwitchToBaudRate
;
290
int
TableSensingIR
;
291
int
TransAccel
;
292
int
TransDecel
;
293
int
TransVelMax
;
294
int
Vel2Divisor
;
295
double
VelConvFactor
;
296
sonar_pose_t
sonar_pose[32];
297
// bumper_def_t bumper_geom[32];
298
}
RobotParams_t
;
299
300
extern
RobotParams_t
PlayerRobotParams
[];
301
302
#endif // P2OS_DRIVER__ROBOT_PARAMS_HPP_
DCHEAD
Definition:
robot_params.hpp:110
RobotParams_t::TableSensingIR
int TableSensingIR
Definition:
robot_params.hpp:290
POWER_AUX_PC
Definition:
robot_params.hpp:176
initialize_robot_params
void initialize_robot_params(void)
Definition:
robot_params.cpp:2122
RobotParams_t::RequestIOPackets
int RequestIOPackets
Definition:
robot_params.hpp:277
ESTALL
Definition:
robot_params.hpp:138
TTY2
Definition:
robot_params.hpp:124
ROTKI
Definition:
robot_params.hpp:162
JOYINFO
Definition:
robot_params.hpp:105
RobotParams_t::TransDecel
int TransDecel
Definition:
robot_params.hpp:292
POWER_12V
Definition:
robot_params.hpp:174
SETA
Definition:
robot_params.hpp:93
GETAUX
Definition:
robot_params.hpp:125
POWER_PTZ
Definition:
robot_params.hpp:178
ARM_STATUS
Definition:
robot_params.hpp:148
LATACCEL
Definition:
robot_params.hpp:184
DHEAD
Definition:
robot_params.hpp:101
RobotParams_t::Class
std::string Class
Definition:
robot_params.hpp:252
RobotParams_t::AngleConvFactor
double AngleConvFactor
Definition:
robot_params.hpp:251
ENABLE
Definition:
robot_params.hpp:92
TRANSKI
Definition:
robot_params.hpp:165
GRIPPER
Definition:
robot_params.hpp:117
ARM_INFO
Definition:
robot_params.hpp:147
IOREQUEST
Definition:
robot_params.hpp:122
POWER_AUDIO
Definition:
robot_params.hpp:179
GYRO
Definition:
robot_params.hpp:139
RobotParams_t::Vel2Divisor
int Vel2Divisor
Definition:
robot_params.hpp:294
RobotParams_t::RotVelMax
int RotVelMax
Definition:
robot_params.hpp:284
ARM_INIT
Definition:
robot_params.hpp:149
SETO
Definition:
robot_params.hpp:95
VEL2
Definition:
robot_params.hpp:116
ARM_GRIPPARK
Definition:
robot_params.hpp:158
RobotParams_t::LaserIgnore
std::string LaserIgnore
Definition:
robot_params.hpp:262
RobotParams_t::RequestEncoderPackets
int RequestEncoderPackets
Definition:
robot_params.hpp:276
RobotParams_t::LaserX
int LaserX
Definition:
robot_params.hpp:267
SETLATV
lateral deceleration (-, mm/sec2)
Definition:
robot_params.hpp:186
RobotParams_t::HasMoveCommand
int HasMoveCommand
Definition:
robot_params.hpp:257
POWER_LRF
Definition:
robot_params.hpp:172
ROTATE
Definition:
robot_params.hpp:97
ESTOP
3=57600, 4=115200
Definition:
robot_params.hpp:137
RobotParams_t::MaxRVelocity
int MaxRVelocity
Definition:
robot_params.hpp:269
HEAD
Definition:
robot_params.hpp:100
RobotParams_t::TransAccel
int TransAccel
Definition:
robot_params.hpp:291
ARM_STOP
Definition:
robot_params.hpp:156
ROTKP
Definition:
robot_params.hpp:160
ARM_SPEED
Definition:
robot_params.hpp:155
bumper_def_t::radius
double radius
Definition:
robot_params.hpp:238
GRIPPERPACREQUEST
Definition:
robot_params.hpp:121
CONFIG
Definition:
robot_params.hpp:107
DIGOUT
Definition:
robot_params.hpp:114
sonar_pose_t::x
double x
Definition:
robot_params.hpp:243
sonar_pose_t
Definition:
robot_params.hpp:241
RobotParams_t::RangeConvFactor
double RangeConvFactor
Definition:
robot_params.hpp:274
RobotParams_t::Subclass
std::string Subclass
Definition:
robot_params.hpp:288
P2OSCommand
P2OSCommand
Definition:
robot_params.hpp:87
RobotParams_t::RobotLength
int RobotLength
Definition:
robot_params.hpp:279
RobotParams_t::RearBumpers
int RearBumpers
Definition:
robot_params.hpp:275
RobotParams_t::Holonomic
int Holonomic
Definition:
robot_params.hpp:258
RobotParams_t::VelConvFactor
double VelConvFactor
Definition:
robot_params.hpp:295
RobotParams_t::FrontBumpers
int FrontBumpers
Definition:
robot_params.hpp:255
ARM_HOME
Definition:
robot_params.hpp:152
RobotParams_t::RobotDiagonal
int RobotDiagonal
Definition:
robot_params.hpp:278
RobotParams_t::LaserY
int LaserY
Definition:
robot_params.hpp:268
RobotParams_t::LaserPort
std::string LaserPort
Definition:
robot_params.hpp:263
SONAR
Definition:
robot_params.hpp:112
GETAUX2
Definition:
robot_params.hpp:146
RobotParams_t::RobotRadius
int RobotRadius
Definition:
robot_params.hpp:280
PlayerRobotParams
RobotParams_t PlayerRobotParams[]
Definition:
robot_params.cpp:2119
POWER_24V
Definition:
robot_params.hpp:175
POWER_TOUCHSCREEN
Definition:
robot_params.hpp:177
RobotParams_t::SettableAccsDecs
int SettableAccsDecs
Definition:
robot_params.hpp:285
bumper_def_t
Definition:
robot_params.hpp:232
RobotParams_t::LaserPowerControlled
int LaserPowerControlled
Definition:
robot_params.hpp:265
POWER_5V
Definition:
robot_params.hpp:173
ARM_POS
Definition:
robot_params.hpp:154
CLOSE
Definition:
robot_params.hpp:91
RobotParams_t::SettableVelMaxes
int SettableVelMaxes
Definition:
robot_params.hpp:286
bumper_def_t::th
double th
Definition:
robot_params.hpp:236
SAY
Definition:
robot_params.hpp:103
TTY3
Definition:
robot_params.hpp:145
ADSEL
Definition:
robot_params.hpp:119
RobotParams_t::IRNum
int IRNum
Definition:
robot_params.hpp:259
RobotParams_t::NumFrontBumpers
int NumFrontBumpers
Definition:
robot_params.hpp:272
TCM2
Definition:
robot_params.hpp:127
SETRV
Definition:
robot_params.hpp:98
bumper_def_t::y
double y
Definition:
robot_params.hpp:235
SETV
Definition:
robot_params.hpp:94
JOYDRIVE
Definition:
robot_params.hpp:128
RobotParams_t::IRUnit
int IRUnit
Definition:
robot_params.hpp:260
TRANSKP
Definition:
robot_params.hpp:163
AUX2BAUD
3=57600, 4=115200
Definition:
robot_params.hpp:135
MOVE
Definition:
robot_params.hpp:96
RobotParams_t::GyroScaler
double GyroScaler
Definition:
robot_params.hpp:256
ARM_PARK
Definition:
robot_params.hpp:153
RobotParams_t::TransVelMax
int TransVelMax
Definition:
robot_params.hpp:293
OPEN
Definition:
robot_params.hpp:90
RobotParams_t::MaxVelocity
int MaxVelocity
Definition:
robot_params.hpp:270
AUX1BAUD
2=38400, 3=57600, 4=115200
Definition:
robot_params.hpp:133
TRANSKV
Definition:
robot_params.hpp:164
POWER_PC
diable(0) sound
Definition:
robot_params.hpp:171
RobotParams_t::SwitchToBaudRate
int SwitchToBaudRate
Definition:
robot_params.hpp:289
SOUNDTOG
Definition:
robot_params.hpp:168
RobotParams_t::DistConvFactor
double DistConvFactor
Definition:
robot_params.hpp:254
CALCOMP
Definition:
robot_params.hpp:143
sonar_pose_t::th
double th
Definition:
robot_params.hpp:245
RobotParams_t::RotAccel
int RotAccel
Definition:
robot_params.hpp:282
ARM_AUTOPARK
Definition:
robot_params.hpp:157
RobotParams_t::SonarNum
int SonarNum
Definition:
robot_params.hpp:287
RobotParams_t::LaserFlipped
int LaserFlipped
Definition:
robot_params.hpp:261
RobotParams_t::LaserTh
int LaserTh
Definition:
robot_params.hpp:266
RobotParams_t::NewTableSensingIR
int NewTableSensingIR
Definition:
robot_params.hpp:271
BUMP_STALL
Definition:
robot_params.hpp:126
LATVEL
Definition:
robot_params.hpp:183
HOSTBAUD
(for patrolbot)
Definition:
robot_params.hpp:131
RobotParams_t::RobotWidth
int RobotWidth
Definition:
robot_params.hpp:281
STOP
Definition:
robot_params.hpp:113
GRIPPERVAL
Definition:
robot_params.hpp:120
ARM_POWER
Definition:
robot_params.hpp:151
RVEL
Definition:
robot_params.hpp:109
RobotParams_t::LaserPossessed
int LaserPossessed
Definition:
robot_params.hpp:264
PLAYLIST
Definition:
robot_params.hpp:167
ARM_CHECK
Definition:
robot_params.hpp:150
ENCODER
#define ENCODER
Definition:
robot_params.hpp:192
SOUND
Definition:
robot_params.hpp:166
PTUPOS
Definition:
robot_params.hpp:123
RobotParams_t::DiffConvFactor
double DiffConvFactor
Definition:
robot_params.hpp:253
PULSE
Definition:
robot_params.hpp:89
MOVINGBLINK
Definition:
robot_params.hpp:129
ROTKV
Definition:
robot_params.hpp:161
RobotParams_t::NumRearBumpers
int NumRearBumpers
Definition:
robot_params.hpp:273
RobotParams_t
Definition:
robot_params.hpp:249
POWER_LRF2
Definition:
robot_params.hpp:180
bumper_def_t::x
double x
Definition:
robot_params.hpp:234
VEL
Definition:
robot_params.hpp:99
RobotParams_t::RotDecel
int RotDecel
Definition:
robot_params.hpp:283
sonar_pose_t::y
double y
Definition:
robot_params.hpp:244
bumper_def_t::length
double length
Definition:
robot_params.hpp:237
SETRA
Definition:
robot_params.hpp:111
p2os_driver
Author(s): Hunter L. Allen
, David Feil-Seifer
, Aris Synodinos
, Brian Gerkey, Kasper Stoy, Richard Vaughan, Andrew Howard, Tucker Hermans, ActivMedia Robotics LLC, MobileRobots Inc.
autogenerated on Sat Jun 20 2020 03:29:42