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 8799 2010-06-28 04:12:42Z 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 00064 #define PLAYER_MAX_MESSAGE_SIZE 8388608 /*8MB*/ 00065 00066 #define PLAYER_MAX_PAYLOAD_SIZE (PLAYER_MAX_MESSAGE_SIZE - sizeof(player_msghdr_t)) 00067 00068 #define PLAYER_MAX_DRIVER_STRING_LEN 64 00069 00070 #define PLAYER_MAX_DEVICES 4096 00071 00072 #define PLAYER_MSGQUEUE_DEFAULT_MAXLEN 1024 00073 00074 #define PLAYER_IDENT_STRING "Player v." 00075 00076 #define PLAYER_IDENT_STRLEN 32 00077 00078 #define PLAYER_KEYLEN 32 00079 00091 #define PLAYER_MSGTYPE_DATA 1 00092 00095 #define PLAYER_MSGTYPE_CMD 2 00096 00102 #define PLAYER_MSGTYPE_REQ 3 00103 00108 #define PLAYER_MSGTYPE_RESP_ACK 4 00109 00113 #define PLAYER_MSGTYPE_SYNCH 5 00114 00121 #define PLAYER_MSGTYPE_RESP_NACK 6 00122 00141 typedef struct player_devaddr 00142 { 00144 uint32_t host; 00147 uint32_t robot; 00149 uint16_t interf; 00151 uint16_t index; 00152 } player_devaddr_t; 00153 00157 typedef struct player_msghdr 00158 { 00160 player_devaddr_t addr; 00162 uint8_t type; 00164 uint8_t subtype; 00166 double timestamp; 00168 uint32_t seq; 00170 uint32_t size; 00171 } player_msghdr_t; 00180 typedef struct player_point_2d 00181 { 00183 double px; 00185 double py; 00186 } player_point_2d_t; 00187 00188 00190 typedef struct player_point_3d 00191 { 00193 double px; 00195 double py; 00197 double pz; 00198 } player_point_3d_t; 00199 00200 00202 typedef struct player_orientation_3d 00203 { 00205 double proll; 00207 double ppitch; 00209 double pyaw; 00210 } player_orientation_3d_t; 00211 00213 typedef struct player_pose2d 00214 { 00216 double px; 00218 double py; 00220 double pa; 00221 } player_pose2d_t; 00222 00224 typedef struct player_pose3d 00225 { 00227 double px; 00229 double py; 00231 double pz; 00233 double proll; 00235 double ppitch; 00237 double pyaw; 00238 } player_pose3d_t; 00239 00241 typedef struct player_bbox2d 00242 { 00244 double sw; 00246 double sl; 00247 } player_bbox2d_t; 00248 00250 typedef struct player_bbox3d 00251 { 00253 double sw; 00255 double sl; 00257 double sh; 00258 } player_bbox3d_t; 00259 00261 typedef struct player_blackboard_entry 00262 { 00264 uint32_t key_count; 00266 char* key; 00268 uint32_t group_count; 00270 char* group; 00272 uint16_t type; 00274 uint16_t subtype; 00276 uint32_t data_count; 00278 uint8_t* data; 00280 uint32_t timestamp_sec; 00282 uint32_t timestamp_usec; 00284 } player_blackboard_entry_t; 00285 00287 typedef struct player_segment 00288 { 00290 double x0; 00292 double y0; 00294 double x1; 00296 double y1; 00297 } player_segment_t; 00298 00303 typedef struct player_extent2d 00304 { 00306 double x0; 00308 double y0; 00310 double x1; 00312 double y1; 00313 } player_extent2d_t; 00314 00316 typedef struct player_color 00317 { 00319 uint8_t alpha; 00321 uint8_t red; 00323 uint8_t green; 00325 uint8_t blue; 00326 } player_color_t; 00327 00329 typedef struct player_bool 00330 { 00332 uint8_t state; 00333 } player_bool_t; 00334 00336 typedef struct player_uint32 00337 { 00338 uint32_t value; 00339 } player_uint32_t; 00340 00341 00389 #define PLAYER_CAPABILTIES_REQ 255 00390 00392 typedef struct player_capabilities_req 00393 { 00395 uint32_t type; 00397 uint32_t subtype; 00398 } player_capabilities_req_t; 00399 00400 00408 #define PLAYER_GET_INTPROP_REQ 254 00409 #define PLAYER_SET_INTPROP_REQ 253 00410 #define PLAYER_GET_DBLPROP_REQ 252 00411 #define PLAYER_SET_DBLPROP_REQ 251 00412 #define PLAYER_GET_STRPROP_REQ 250 00413 #define PLAYER_SET_STRPROP_REQ 249 00414 #define PLAYER_GET_BOOLPROP_REQ 248 00415 #define PLAYER_SET_BOOLPROP_REQ 247 00416 00418 typedef struct player_boolprop_req 00419 { 00421 uint32_t key_count; 00423 char *key; 00425 char value; 00426 } player_boolprop_req_t; 00427 00429 typedef struct player_intprop_req 00430 { 00432 uint32_t key_count; 00434 char *key; 00436 int32_t value; 00437 } player_intprop_req_t; 00438 00440 typedef struct player_dblprop_req 00441 { 00443 uint32_t key_count; 00445 char *key; 00447 double value; 00448 } player_dblprop_req_t; 00449 00451 typedef struct player_strprop_req 00452 { 00454 uint32_t key_count; 00456 char *key; 00458 uint32_t value_count; 00460 char *value; 00461 } player_strprop_req_t; 00462 00463 // ///////////////////////////////////////////////////////////////////////////// 00464 // 00465 // Here starts the alphabetical list of interfaces 00466 // (please keep it that way) 00467 // 00468 // ///////////////////////////////////////////////////////////////////////////// 00469 00506 #include <libplayerinterface/player_interfaces.h> 00507 00508 #endif /* PLAYER_H */