player.h
00001 /*
00002  *  Player - One Hell of a Robot Server
00003  *  Copyright (C) 2000
00004  *     Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
00005  *
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 /********************************************************************
00023  *
00024  *  This library is free software; you can redistribute it and/or
00025  *  modify it under the terms of the GNU Lesser General Public
00026  *  License as published by the Free Software Foundation; either
00027  *  version 2.1 of the License, or (at your option) any later version.
00028  *
00029  *  This library is distributed in the hope that it will be useful,
00030  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00031  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00032  *  Lesser General Public License for more details.
00033  *
00034  *  You should have received a copy of the GNU Lesser General Public
00035  *  License along with this library; if not, write to the Free Software
00036  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00037  *
00038  ********************************************************************/
00039 
00040 /*
00041  * Desc: Player communication packet structures and codes
00042  * CVS:  $Id: player.h 9053 2011-05-25 02:39:25Z jpgr87 $
00043  */
00044 
00045 
00046 #ifndef PLAYER_H
00047 #define PLAYER_H
00048 
00049 #include <time.h>
00050 
00051 /* Include values from the configure script */
00052 #include "playerconfig.h"
00053 
00068 #define PLAYER_MAX_MESSAGE_SIZE 8388608 /*8MB*/
00069 
00070 #define PLAYER_MAX_PAYLOAD_SIZE (PLAYER_MAX_MESSAGE_SIZE - sizeof(player_msghdr_t))
00071 
00072 #define PLAYER_MAX_DRIVER_STRING_LEN 64
00073 
00074 #define PLAYER_MAX_DEVICES             4096
00075 
00076 #define PLAYER_MSGQUEUE_DEFAULT_MAXLEN 1024
00077 
00078 #define PLAYER_IDENT_STRING    "Player v."
00079 
00080 #define PLAYER_IDENT_STRLEN 32
00081 
00082 #define PLAYER_KEYLEN       32
00083 
00095 #define PLAYER_MSGTYPE_DATA      1
00096 
00099 #define PLAYER_MSGTYPE_CMD       2
00100 
00106 #define PLAYER_MSGTYPE_REQ       3
00107 
00112 #define PLAYER_MSGTYPE_RESP_ACK  4
00113 
00117 #define PLAYER_MSGTYPE_SYNCH     5
00118 
00125 #define PLAYER_MSGTYPE_RESP_NACK 6
00126 
00145 typedef struct player_devaddr
00146 {
00148   uint32_t host;
00151   uint32_t robot;
00153   uint16_t interf;
00155   uint16_t index;
00156 } player_devaddr_t;
00157 
00161 typedef struct player_msghdr
00162 {
00164   player_devaddr_t addr;
00166   uint8_t type;
00168   uint8_t subtype;
00170   double timestamp;
00172   uint32_t seq;
00174   uint32_t size;
00175 } player_msghdr_t;
00184 typedef struct player_point_2d
00185 {
00187   double px;
00189   double py;
00190 } player_point_2d_t;
00191 
00192 
00194 typedef struct player_point_3d
00195 {
00197   double px;
00199   double py;
00201   double pz;
00202 } player_point_3d_t;
00203 
00204 
00206 typedef struct player_orientation_3d
00207 {
00209   double proll;
00211   double ppitch;
00213   double pyaw;
00214 } player_orientation_3d_t;
00215 
00217 typedef struct player_pose2d
00218 {
00220   double px;
00222   double py;
00224   double pa;
00225 } player_pose2d_t;
00226 
00228 typedef struct player_pose3d
00229 {
00231   double px;
00233   double py;
00235   double pz;
00237   double proll;
00239   double ppitch;
00241   double pyaw;
00242 } player_pose3d_t;
00243 
00245 typedef struct player_bbox2d
00246 {
00248   double sw;
00250   double sl;
00251 } player_bbox2d_t;
00252 
00254 typedef struct player_bbox3d
00255 {
00257   double sw;
00259   double sl;
00261   double sh;
00262 } player_bbox3d_t;
00263 
00265 typedef struct player_blackboard_entry
00266 {
00268   uint32_t key_count;
00270   char* key;
00272   uint32_t group_count;
00274   char* group;
00276   uint16_t type;
00278   uint16_t subtype;
00280   uint32_t data_count;
00282   uint8_t* data;
00284   uint32_t timestamp_sec;
00286   uint32_t timestamp_usec;
00288 } player_blackboard_entry_t;
00289 
00291 typedef struct player_segment
00292 {
00294   double x0;
00296   double y0;
00298   double x1;
00300   double y1;
00301 } player_segment_t;
00302 
00307 typedef struct player_extent2d
00308 {
00310   double x0;
00312   double y0;
00314   double x1;
00316   double y1;
00317 } player_extent2d_t;
00318 
00320 typedef struct player_color
00321 {
00323   uint8_t alpha;
00325   uint8_t red;
00327   uint8_t green;
00329   uint8_t blue;
00330 } player_color_t;
00331 
00333 typedef struct player_bool
00334 {
00336   uint8_t state;
00337 } player_bool_t;
00338 
00340 typedef struct player_uint32
00341 {
00342   uint32_t value;
00343 } player_uint32_t;
00344 
00345 
00393 #define PLAYER_CAPABILITIES_REQ 255
00394 
00396 typedef struct player_capabilities_req
00397 {
00399   uint32_t type;
00401   uint32_t subtype;
00402 } player_capabilities_req_t;
00403 
00404 
00412 #define PLAYER_GET_INTPROP_REQ 254
00413 #define PLAYER_SET_INTPROP_REQ 253
00414 #define PLAYER_GET_DBLPROP_REQ 252
00415 #define PLAYER_SET_DBLPROP_REQ 251
00416 #define PLAYER_GET_STRPROP_REQ 250
00417 #define PLAYER_SET_STRPROP_REQ 249
00418 #define PLAYER_GET_BOOLPROP_REQ 248
00419 #define PLAYER_SET_BOOLPROP_REQ 247
00420 
00422 typedef struct player_boolprop_req
00423 {
00425         uint32_t key_count;
00427         char *key;
00429         char value;
00430 } player_boolprop_req_t;
00431 
00433 typedef struct player_intprop_req
00434 {
00436         uint32_t key_count;
00438         char *key;
00440         int32_t value;
00441 } player_intprop_req_t;
00442 
00444 typedef struct player_dblprop_req
00445 {
00447         uint32_t key_count;
00449         char *key;
00451         double value;
00452 } player_dblprop_req_t;
00453 
00455 typedef struct player_strprop_req
00456 {
00458         uint32_t key_count;
00460         char *key;
00462         uint32_t value_count;
00464         char *value;
00465 } player_strprop_req_t;
00466 
00467 // /////////////////////////////////////////////////////////////////////////////
00468 //
00469 //             Here starts the alphabetical list of interfaces
00470 //                       (please keep it that way)
00471 //
00472 // /////////////////////////////////////////////////////////////////////////////
00473 
00509 #include <libplayerinterface/player_interfaces.h>
00510 
00511 #endif /* PLAYER_H */