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 */

Last updated 12 September 2005 21:38:45