segwayrmp400.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2009 Goutham Mallapragda, Anthony Cascone, Rich Mattes & Brian Gerkey
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  */
20 /*
21  Desc: Segway RMP 400 Driver
22  Authors: Goutham Mallapragada, Anthony Cascone, Rich Mattes
23  Updated: July 21, 2009
24 */
25 
26 #ifndef __SEGWAYRMP400_H_
27 #define __SEGWAYRMP400_H_
28 
29 #include <stdio.h>
30 #include <pthread.h>
31 #include <string.h>
32 #include <stdlib.h>
33 #include <math.h>
34 #if !defined (WIN32)
35  #include <unistd.h>
36  #include <netinet/in.h>
37 #endif
38 
39 #include <libplayercore/playercore.h>
40 
41 
44 {
45 
46 public:
47 
49  SegwayRMP400(ConfigFile* cf, int section);
50 
52  virtual int MainSetup();
53 
55  virtual void MainQuit();
56 
57 private:
58 
59  // Devices
62 
63  // Device Addresses
66 
69 
70  // Device Data Structures
73 
76 
79 
80  // Flags
81  bool provide_2d;
82  bool provide_3d;
83 
84  int counter;
86  void Main();
87 
89  int ProcessMessage(QueuePointer &resp_queue, player_msghdr_t* hdr, void* data);
90 
92  void ProcessData();
93 
96 
99 
101  bool newfront3d, newback3d, newfront2d, newback2d;
102 
104  bool fullspeed;
105 };
106 
107 #endif
Class for loading configuration file information.
Definition: configfile.h:196
position 2d velocity command
Definition: player_interfaces.h:617
bool fullspeed
Flag for full speed data reporting.
Definition: segwayrmp400.h:104
void Main()
Main.
Definition: segwayrmp400.cc:268
Generic message header.
Definition: player.h:157
virtual void MainQuit()
Shutdown (Player Standard)
Definition: segwayrmp400.cc:247
A device address.
Definition: player.h:141
Device * segwayrmp2d[2]
child segwayrmp200 devices for 2d subsrciption
Definition: segwayrmp400.h:60
player_position2d_data_t position2d_data
Output data for parent segwayrmp400 device 2d.
Definition: segwayrmp400.h:74
Base class for drivers which oeprate with a thread.
Definition: driver.h:544
Data: state (PLAYER_POSITION3D_DATA_STATE)
Definition: player_interfaces.h:2470
Command: velocity (PLAYER_POSITION3D_CMD_SET_VEL)
Definition: player_interfaces.h:2498
Device * segwayrmp3d[2]
child segwayrmp200 devices for 3d subsrciption
Definition: segwayrmp400.h:61
player_position2d_cmd_vel_t position2d_cmd
Output cmd for parent segwayrmp400 device 2d.
Definition: segwayrmp400.h:75
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:74
An autopointer for the message queue.
Definition: message.h:73
bool provide_2d
Provide 2d interface Flag.
Definition: segwayrmp400.h:81
player_devaddr_t position2d_id
2d Position Interface Address (Input)
Definition: segwayrmp400.h:68
bool provide_3d
Provide 3d interface Flag.
Definition: segwayrmp400.h:82
bool newfront3d
Flags for new data.
Definition: segwayrmp400.h:101
void ProcessData()
Packages position data and publishes.
Definition: segwayrmp400.cc:421
player_devaddr_t position3d_id
3d Position Interface Address (Input)
Definition: segwayrmp400.h:67
virtual int MainSetup()
Initialize (Player Standard)
Definition: segwayrmp400.cc:197
player_position2d_data_t rmp2d_data[2]
Incoming data from child segwayrmp200 devices 2d.
Definition: segwayrmp400.h:71
position2d data
Definition: player_interfaces.h:606
int HandlePosition3DCmd(player_position3d_cmd_vel_t *cmd)
Internal method to handle position 3D commands.
Definition: segwayrmp400.cc:390
player_position3d_cmd_vel_t position3d_cmd
Output cmd for parent segwayrmp400 device 3d.
Definition: segwayrmp400.h:78
int HandlePosition2DCmd(player_position2d_cmd_vel_t *cmd)
Internal method to handle position 2D commands.
Definition: segwayrmp400.cc:405
SegwayRMP400(ConfigFile *cf, int section)
Standard Constructor.
Definition: segwayrmp400.cc:116
int ProcessMessage(QueuePointer &resp_queue, player_msghdr_t *hdr, void *data)
Process message function (Player Standard)
Definition: segwayrmp400.cc:292
player_position3d_data_t rmp3d_data[2]
Incoming data from child segwayrmp200 devices 3d.
Definition: segwayrmp400.h:72
player_devaddr_t segwayrmp2d_id[2]
2d Position Interface Address (Output)
Definition: segwayrmp400.h:64
player_position3d_data_t position3d_data
Output data for parent segwayrmp400 device 3d.
Definition: segwayrmp400.h:77
player_devaddr_t segwayrmp3d_id[2]
3d Position Interface Address (Output)
Definition: segwayrmp400.h:65
SegwayRMP400 Position Driver.
Definition: segwayrmp400.h:43

Last updated 12 September 2005 21:38:45