|
Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages
sip.hGo to the documentation of this file.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 * $Id: sip.h,v 1.4 2004/04/22 04:21:35 gerkey Exp $ 00025 * 00026 * part of the P2OS parser. methods for filling and parsing server 00027 * information packets (SIPs) 00028 */ 00029 #ifndef _SIP_H 00030 #define _SIP_H 00031 00032 #include <limits.h> 00033 00034 #include <p2os.h> 00035 00036 class SIP 00037 { 00038 private: 00039 int PositionChange( unsigned short, unsigned short ); 00040 int param_idx; // index of our robot's data in the parameter table 00041 00042 public: 00043 // these values are returned in every standard SIP 00044 bool lwstall, rwstall; 00045 unsigned char status, battery, sonarreadings, analog, digin, digout; 00046 unsigned short ptu, compass, timer, rawxpos; 00047 unsigned short rawypos, frontbumpers, rearbumpers; 00048 short angle, lvel, rvel, control; 00049 unsigned short sonars[PLAYER_SONAR_MAX_SAMPLES]; 00050 int xpos, ypos; 00051 int x_offset,y_offset,angle_offset; 00052 00053 // these values are returned in a CMUcam serial string extended SIP 00054 // (in host byte-order) 00055 unsigned short blobmx, blobmy; // Centroid 00056 unsigned short blobx1, blobx2, bloby1, bloby2; // Bounding box 00057 unsigned short blobarea, blobconf; // Area and confidence 00058 unsigned int blobcolor; 00059 00060 // This value is filled by ParseGyro() 00061 int32_t gyro_rate; 00062 00063 /* returns 0 if Parsed correctly otherwise 1 */ 00064 void Parse( unsigned char *buffer ); 00065 void ParseSERAUX( unsigned char *buffer ); 00066 void ParseGyro(unsigned char* buffer); 00067 void Print(); 00068 void PrintSonars(); 00069 void Fill(player_p2os_data_t* data); 00070 00071 SIP(int idx) 00072 { 00073 param_idx = idx; 00074 for(int i=0;i<ARRAYSIZE(sonars);i++) 00075 sonars[i] = 0; 00076 00077 xpos = INT_MAX; 00078 ypos = INT_MAX; 00079 } 00080 }; 00081 00082 #endif Generated on Tue May 3 14:15:36 2005 for Player by 1.3.6 |