player.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2000
4  * Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
5  *
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 /********************************************************************
23  *
24  * This library is free software; you can redistribute it and/or
25  * modify it under the terms of the GNU Lesser General Public
26  * License as published by the Free Software Foundation; either
27  * version 2.1 of the License, or (at your option) any later version.
28  *
29  * This library is distributed in the hope that it will be useful,
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32  * Lesser General Public License for more details.
33  *
34  * You should have received a copy of the GNU Lesser General Public
35  * License along with this library; if not, write to the Free Software
36  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37  *
38  ********************************************************************/
39 
40 /*
41  * Desc: Player communication packet structures and codes
42  * CVS: $Id: player.h 8799 2010-06-28 04:12:42Z jpgr87 $
43  */
44 
45 
46 #ifndef PLAYER_H
47 #define PLAYER_H
48 
49 #include <time.h>
50 
51 /* Include values from the configure script */
52 #include "playerconfig.h"
53 
64 #define PLAYER_MAX_MESSAGE_SIZE 8388608 /*8MB*/
65 
66 #define PLAYER_MAX_PAYLOAD_SIZE (PLAYER_MAX_MESSAGE_SIZE - sizeof(player_msghdr_t))
67 
68 #define PLAYER_MAX_DRIVER_STRING_LEN 64
69 
70 #define PLAYER_MAX_DEVICES 4096
71 
72 #define PLAYER_MSGQUEUE_DEFAULT_MAXLEN 1024
73 
74 #define PLAYER_IDENT_STRING "Player v."
75 
76 #define PLAYER_IDENT_STRLEN 32
77 
78 #define PLAYER_KEYLEN 32
79 
91 #define PLAYER_MSGTYPE_DATA 1
92 
95 #define PLAYER_MSGTYPE_CMD 2
96 
102 #define PLAYER_MSGTYPE_REQ 3
103 
108 #define PLAYER_MSGTYPE_RESP_ACK 4
109 
113 #define PLAYER_MSGTYPE_SYNCH 5
114 
121 #define PLAYER_MSGTYPE_RESP_NACK 6
122 
141 typedef struct player_devaddr
142 {
144  uint32_t host;
147  uint32_t robot;
149  uint16_t interf;
151  uint16_t index;
153 
157 typedef struct player_msghdr
158 {
162  uint8_t type;
164  uint8_t subtype;
166  double timestamp;
168  uint32_t seq;
170  uint32_t size;
180 typedef struct player_point_2d
181 {
183  double px;
185  double py;
187 
188 
190 typedef struct player_point_3d
191 {
193  double px;
195  double py;
197  double pz;
199 
200 
202 typedef struct player_orientation_3d
203 {
205  double proll;
207  double ppitch;
209  double pyaw;
211 
213 typedef struct player_pose2d
214 {
216  double px;
218  double py;
220  double pa;
222 
224 typedef struct player_pose3d
225 {
227  double px;
229  double py;
231  double pz;
233  double proll;
235  double ppitch;
237  double pyaw;
239 
241 typedef struct player_bbox2d
242 {
244  double sw;
246  double sl;
248 
250 typedef struct player_bbox3d
251 {
253  double sw;
255  double sl;
257  double sh;
259 
262 {
264  uint32_t key_count;
266  char* key;
268  uint32_t group_count;
270  char* group;
272  uint16_t type;
274  uint16_t subtype;
276  uint32_t data_count;
278  uint8_t* data;
280  uint32_t timestamp_sec;
282  uint32_t timestamp_usec;
285 
287 typedef struct player_segment
288 {
290  double x0;
292  double y0;
294  double x1;
296  double y1;
298 
303 typedef struct player_extent2d
304 {
306  double x0;
308  double y0;
310  double x1;
312  double y1;
314 
316 typedef struct player_color
317 {
319  uint8_t alpha;
321  uint8_t red;
323  uint8_t green;
325  uint8_t blue;
327 
329 typedef struct player_bool
330 {
332  uint8_t state;
333 } player_bool_t;
334 
336 typedef struct player_uint32
337 {
338  uint32_t value;
340 
341 
389 #define PLAYER_CAPABILTIES_REQ 255
390 
393 {
395  uint32_t type;
397  uint32_t subtype;
399 
400 
408 #define PLAYER_GET_INTPROP_REQ 254
409 #define PLAYER_SET_INTPROP_REQ 253
410 #define PLAYER_GET_DBLPROP_REQ 252
411 #define PLAYER_SET_DBLPROP_REQ 251
412 #define PLAYER_GET_STRPROP_REQ 250
413 #define PLAYER_SET_STRPROP_REQ 249
414 #define PLAYER_GET_BOOLPROP_REQ 248
415 #define PLAYER_SET_BOOLPROP_REQ 247
416 
418 typedef struct player_boolprop_req
419 {
421  uint32_t key_count;
423  char *key;
425  char value;
427 
429 typedef struct player_intprop_req
430 {
432  uint32_t key_count;
434  char *key;
436  int32_t value;
438 
440 typedef struct player_dblprop_req
441 {
443  uint32_t key_count;
445  char *key;
447  double value;
449 
451 typedef struct player_strprop_req
452 {
454  uint32_t key_count;
456  char *key;
458  uint32_t value_count;
460  char *value;
462 
463 // /////////////////////////////////////////////////////////////////////////////
464 //
465 // Here starts the alphabetical list of interfaces
466 // (please keep it that way)
467 //
468 // /////////////////////////////////////////////////////////////////////////////
469 
506 #include <libplayerinterface/player_interfaces.h>
507 
508 #endif /* PLAYER_H */
double y0
Endpoints [m].
Definition: player.h:292
struct player_segment player_segment_t
A line segment, used to construct vector-based maps.
double y1
Endpoints [m].
Definition: player.h:312
double sl
Length [m].
Definition: player.h:246
uint8_t state
state
Definition: player.h:332
uint16_t interf
The interface provided by the device; must be one of PLAYER_*_CODE.
Definition: player.h:149
double ppitch
pitch [rad]
Definition: player.h:235
Vectormap feature data.
Definition: player.h:261
A rectangular bounding box, used to define the size of an object.
Definition: player.h:250
Generic message header.
Definition: player.h:157
char value
The property value.
Definition: player.h:425
A rectangular bounding box, used to define the origin and bounds of an object.
Definition: player.h:303
uint32_t key_count
The property key&#39;s length.
Definition: player.h:443
A color descriptor.
Definition: player.h:316
double value
The property value.
Definition: player.h:447
double px
X [m].
Definition: player.h:216
struct player_uint32 player_uint32_t
Structure for messages returning a single integer.
struct player_point_3d player_point_3d_t
A point in 3D space.
player_devaddr_t addr
Device to which this message pertains.
Definition: player.h:160
double py
Y [m].
Definition: player.h:229
double proll
roll [rad]
Definition: player.h:205
double y1
Endpoints [m].
Definition: player.h:296
Request to get a double property.
Definition: player.h:440
A pose in the plane.
Definition: player.h:213
double x1
Endpoints [m].
Definition: player.h:310
struct player_bbox2d player_bbox2d_t
A rectangular bounding box, used to define the size of an object.
uint32_t data_count
Entry data length.
Definition: player.h:276
An angle in 3D space.
Definition: player.h:202
double x0
Endpoints [m].
Definition: player.h:290
A device address.
Definition: player.h:141
double pyaw
yaw [rad]
Definition: player.h:209
double py
Y [m].
Definition: player.h:195
uint32_t key_count
Length of key in bytes.
Definition: player.h:264
struct player_color player_color_t
A color descriptor.
struct player_bbox3d player_bbox3d_t
A rectangular bounding box, used to define the size of an object.
struct player_pose2d player_pose2d_t
A pose in the plane.
uint8_t alpha
Alpha (transparency) channel.
Definition: player.h:319
uint8_t green
Green color channel.
Definition: player.h:323
struct player_msghdr player_msghdr_t
Generic message header.
uint32_t group_count
Second identifier count.
Definition: player.h:268
uint32_t host
The &quot;host&quot; on which the device resides.
Definition: player.h:144
A point in the plane.
Definition: player.h:180
double py
Y [m].
Definition: player.h:185
uint32_t timestamp_usec
Time of entry creation.
Definition: player.h:282
Structure for messages returning a single integer.
Definition: player.h:336
uint32_t timestamp_sec
Time of entry creation.
Definition: player.h:280
uint32_t key_count
The property key&#39;s length.
Definition: player.h:421
double sw
Width [m].
Definition: player.h:253
double px
X [m].
Definition: player.h:227
double x1
Endpoints [m].
Definition: player.h:294
double pa
yaw [rad]
Definition: player.h:220
uint32_t key_count
The property key&#39;s length.
Definition: player.h:432
uint32_t size
Size in bytes of the payload to follow.
Definition: player.h:170
uint8_t type
Message type; must be one of PLAYER_MSGTYPE_*.
Definition: player.h:162
uint32_t robot
The &quot;robot&quot; or device collection in which the device resides.
Definition: player.h:147
char * group
Second identifier.
Definition: player.h:270
double pz
Z [m].
Definition: player.h:197
struct player_point_2d player_point_2d_t
A point in the plane.
A rectangular bounding box, used to define the size of an object.
Definition: player.h:241
double px
X [m].
Definition: player.h:183
Request to get a boolean property.
Definition: player.h:418
int32_t value
The property value.
Definition: player.h:436
char * key
Identifier for the entry.
Definition: player.h:266
double x0
Origin x [m].
Definition: player.h:306
double timestamp
Time associated with message contents (seconds since epoch)
Definition: player.h:166
char * value
The property value.
Definition: player.h:460
uint16_t type
Entry data type.
Definition: player.h:272
double px
X [m].
Definition: player.h:193
uint32_t value_count
The property&#39;s length.
Definition: player.h:458
double pyaw
yaw [rad]
Definition: player.h:237
double ppitch
pitch [rad]
Definition: player.h:207
double sl
Length [m].
Definition: player.h:255
Structure containing a single capability request.
Definition: player.h:392
struct player_orientation_3d player_orientation_3d_t
An angle in 3D space.
A boolean variable, 0 for false anything else for true.
Definition: player.h:329
double sw
Width [m].
Definition: player.h:244
struct player_bool player_bool_t
A boolean variable, 0 for false anything else for true.
struct player_devaddr player_devaddr_t
A device address.
double sh
Height [m].
Definition: player.h:257
double y0
Origin y [m].
Definition: player.h:308
struct player_pose3d player_pose3d_t
A pose in space.
uint32_t seq
For keeping track of associated messages.
Definition: player.h:168
uint32_t key_count
The property key&#39;s length.
Definition: player.h:454
A pose in space.
Definition: player.h:224
uint8_t * data
Entry data.
Definition: player.h:278
char * key
The property key.
Definition: player.h:434
A point in 3D space.
Definition: player.h:190
double py
Y [m].
Definition: player.h:218
char * key
The property key.
Definition: player.h:423
Request to get a string property.
Definition: player.h:451
Request to get an integer property.
Definition: player.h:429
struct player_blackboard_entry player_blackboard_entry_t
Vectormap feature data.
uint8_t subtype
Message subtype; interface specific.
Definition: player.h:164
uint8_t blue
Blue color channel.
Definition: player.h:325
double proll
roll [rad]
Definition: player.h:233
double pz
Z [m].
Definition: player.h:231
uint8_t red
Red color channel.
Definition: player.h:321
A line segment, used to construct vector-based maps.
Definition: player.h:287
char * key
The property key.
Definition: player.h:445
uint32_t type
The type of the requested capability (i.e.
Definition: player.h:395
uint32_t subtype
The subtype of the requested capability (i.e.
Definition: player.h:397
uint16_t subtype
Entry data subtype.
Definition: player.h:274
char * key
The property key.
Definition: player.h:456
struct player_extent2d player_extent2d_t
A rectangular bounding box, used to define the origin and bounds of an object.
uint16_t index
Which device of that interface.
Definition: player.h:151

Last updated 12 September 2005 21:38:45