segwayrmp400.h
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2009 Goutham Mallapragda, Anthony Cascone, Rich Mattes & Brian Gerkey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*
Desc: Segway RMP 400 Driver
Authors: Goutham Mallapragada, Anthony Cascone, Rich Mattes
Updated: July 21, 2009
*/
#ifndef __SEGWAYRMP400_H_
#define __SEGWAYRMP400_H_
#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#if !defined (WIN32)
#include <unistd.h>
#include <netinet/in.h>
#endif
#include <libplayercore/playercore.h>
class SegwayRMP400 : public ThreadedDriver
{
public:
SegwayRMP400(ConfigFile* cf, int section);
virtual int MainSetup();
virtual void MainQuit();
private:
// Devices
Device* segwayrmp2d[2];
Device* segwayrmp3d[2];
// Device Addresses
player_devaddr_t segwayrmp2d_id[2];
player_devaddr_t segwayrmp3d_id[2];
player_devaddr_t position3d_id;
player_devaddr_t position2d_id;
// Device Data Structures
player_position2d_data_t rmp2d_data[2];
player_position3d_data_t rmp3d_data[2];
player_position2d_data_t position2d_data;
player_position2d_cmd_vel_t position2d_cmd;
player_position3d_data_t position3d_data;
player_position3d_cmd_vel_t position3d_cmd;
// Flags
bool provide_2d;
bool provide_3d;
int counter;
void Main();
int ProcessMessage(QueuePointer &resp_queue, player_msghdr_t* hdr, void* data);
void ProcessData();
int HandlePosition3DCmd(player_position3d_cmd_vel_t* cmd);
int HandlePosition2DCmd(player_position2d_cmd_vel_t* cmd);
bool newfront3d, newback3d, newfront2d, newback2d;
bool fullspeed;
};
#endif
ConfigFile
Class for loading configuration file information.
Definition: configfile.h:196
player_position2d_cmd_vel
position 2d velocity command
Definition: player_interfaces.h:617
SegwayRMP400::fullspeed
bool fullspeed
Flag for full speed data reporting.
Definition: segwayrmp400.h:104
SegwayRMP400::Main
void Main()
Main.
Definition: segwayrmp400.cc:268
player_msghdr
Generic message header.
Definition: player.h:157
SegwayRMP400::MainQuit
virtual void MainQuit()
Shutdown (Player Standard)
Definition: segwayrmp400.cc:247
player_devaddr
A device address.
Definition: player.h:141
SegwayRMP400::segwayrmp2d
Device * segwayrmp2d[2]
child segwayrmp200 devices for 2d subsrciption
Definition: segwayrmp400.h:60
SegwayRMP400::position2d_data
player_position2d_data_t position2d_data
Output data for parent segwayrmp400 device 2d.
Definition: segwayrmp400.h:74
ThreadedDriver
Base class for drivers which oeprate with a thread.
Definition: driver.h:544
player_position3d_data
Data: state (PLAYER_POSITION3D_DATA_STATE)
Definition: player_interfaces.h:2470
player_position3d_cmd_vel
Command: velocity (PLAYER_POSITION3D_CMD_SET_VEL)
Definition: player_interfaces.h:2498
SegwayRMP400::segwayrmp3d
Device * segwayrmp3d[2]
child segwayrmp200 devices for 3d subsrciption
Definition: segwayrmp400.h:61
SegwayRMP400::position2d_cmd
player_position2d_cmd_vel_t position2d_cmd
Output cmd for parent segwayrmp400 device 2d.
Definition: segwayrmp400.h:75
Device
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:74
QueuePointer
An autopointer for the message queue.
Definition: message.h:73
SegwayRMP400::provide_2d
bool provide_2d
Provide 2d interface Flag.
Definition: segwayrmp400.h:81
SegwayRMP400::position2d_id
player_devaddr_t position2d_id
2d Position Interface Address (Input)
Definition: segwayrmp400.h:68
SegwayRMP400::provide_3d
bool provide_3d
Provide 3d interface Flag.
Definition: segwayrmp400.h:82
SegwayRMP400::newfront3d
bool newfront3d
Flags for new data.
Definition: segwayrmp400.h:101
SegwayRMP400::ProcessData
void ProcessData()
Packages position data and publishes.
Definition: segwayrmp400.cc:421
SegwayRMP400::position3d_id
player_devaddr_t position3d_id
3d Position Interface Address (Input)
Definition: segwayrmp400.h:67
SegwayRMP400::MainSetup
virtual int MainSetup()
Initialize (Player Standard)
Definition: segwayrmp400.cc:197
SegwayRMP400::rmp2d_data
player_position2d_data_t rmp2d_data[2]
Incoming data from child segwayrmp200 devices 2d.
Definition: segwayrmp400.h:71
player_position2d_data
position2d data
Definition: player_interfaces.h:606
SegwayRMP400::HandlePosition3DCmd
int HandlePosition3DCmd(player_position3d_cmd_vel_t *cmd)
Internal method to handle position 3D commands.
Definition: segwayrmp400.cc:390
SegwayRMP400::position3d_cmd
player_position3d_cmd_vel_t position3d_cmd
Output cmd for parent segwayrmp400 device 3d.
Definition: segwayrmp400.h:78
SegwayRMP400::HandlePosition2DCmd
int HandlePosition2DCmd(player_position2d_cmd_vel_t *cmd)
Internal method to handle position 2D commands.
Definition: segwayrmp400.cc:405
SegwayRMP400::SegwayRMP400
SegwayRMP400(ConfigFile *cf, int section)
Standard Constructor.
Definition: segwayrmp400.cc:116
SegwayRMP400::ProcessMessage
int ProcessMessage(QueuePointer &resp_queue, player_msghdr_t *hdr, void *data)
Process message function (Player Standard)
Definition: segwayrmp400.cc:292
SegwayRMP400::rmp3d_data
player_position3d_data_t rmp3d_data[2]
Incoming data from child segwayrmp200 devices 3d.
Definition: segwayrmp400.h:72
SegwayRMP400::segwayrmp2d_id
player_devaddr_t segwayrmp2d_id[2]
2d Position Interface Address (Output)
Definition: segwayrmp400.h:64
SegwayRMP400::position3d_data
player_position3d_data_t position3d_data
Output data for parent segwayrmp400 device 3d.
Definition: segwayrmp400.h:77
SegwayRMP400::segwayrmp3d_id
player_devaddr_t segwayrmp3d_id[2]
3d Position Interface Address (Output)
Definition: segwayrmp400.h:65
SegwayRMP400
SegwayRMP400 Position Driver.
Definition: segwayrmp400.h:43

Last updated 12 September 2005 21:38:45