mbase/motorpacket.h
1 
26 /*
27  * $Id: motorpacket.h 4308 2007-12-13 20:23:08Z gerkey $
28  *
29  * part of the P2OS parser. methods for filling and parsing server
30  * information packets (mbasedriverMotorPackets)
31  */
32 
37 #ifndef _mbasedriverMotorPacket_H
38 #define _mbasedriverMotorPacket_H
39 
40 #include <limits.h>
41 
42 #include "mbasedriver.h"
43 
44 
46 {
47  private:
48  int param_idx; // index of our robot's data in the parameter table
49 
50  public:
51  // these values are returned in every standard mbasedriverMotorPacket
52  bool lwstall, rwstall;
53  int battery;
54  short angle, lvel, rvel;
55  int xpos, ypos;
56 
57  bool Parse( unsigned char *buffer, int length );
58  void Print();
59  void Fill(player_mbasedriver_data_t* data);
60 
61  mbasedriverMotorPacket(int idx)
62  {
63  param_idx = idx;
64 
65  xpos = INT_MAX;
66  ypos = INT_MAX;
67  }
68 };
69 
70 #endif
bool Parse(unsigned char *buffer, int length)
Parse -Parses and absorbs a standard packet from the robot.
Definition: mbase/motorpacket.cc:58
Copyright (C) 2010 Ana Teresa Hernández Malagón Movirobotics Player - One Hell of a Robot Server Copy...
Definition: mbase/motorpacket.h:45
void Print()
Copyright (C) 2010 Ana Teresa Hernández Malagón Movirobotics Player - One Hell of a Robot Server Copy...
Definition: mbase/motorpacket.cc:45
void Fill(player_mbasedriver_data_t *data)
Fill.
Definition: mbase/motorpacket.cc:111