garcia_mixed.h
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2000 Brian Gerkey et al.
*
*
* 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
*
*/
#include <stdint.h>
#include <libplayercore/playercore.h>
#include "acpGarcia.h"
// The class for the driver
class GarciaDriver : public ThreadedDriver
{
public:
// Constructor; need that
GarciaDriver(ConfigFile* cf, int section);
virtual ~GarciaDriver();
// Must implement the following methods.
int MainSetup();
void MainQuit();
// Main function for device thread.
virtual void Main();
// This method will be invoked on each incoming message
virtual int ProcessMessage(QueuePointer & resp_queue,
player_msghdr * hdr,
void * data);
//void ProcessConfig();
void ProcessPos2dPosCmd(player_msghdr_t* hdr, player_position2d_cmd_pos_t &data);
void ProcessPos2dVelCmd(player_msghdr_t* hdr, player_position2d_cmd_vel_t &data);
void ProcessSpeechCommand(player_msghdr_t* hdr, player_speech_cmd_t &data);
void ProcessDioCommand(player_msghdr_t* hdr, player_dio_cmd_t &data);
void ProcessPos2dGeomReq(player_msghdr_t* hdr);
void ProcessIrPoseReq(player_msghdr_t* hdr);
void RefreshData();
private:
// position2d interface
player_devaddr_t mPos2dAddr;
player_position2d_data_t mPos2dData;
player_position2d_cmd_pos_t mPos2dPosCmd;
player_position2d_cmd_vel_t mPos2dVelCmd;
// ir interface
player_devaddr_t mIrAddr;
player_ir_data_t mIrData;
// speech interface
player_devaddr_t mSpeechAddr;
player_speech_cmd_t mSpeechCmd;
// dio interface
player_devaddr_t mDioAddr;
player_dio_data_t mDioData;
player_dio_cmd_t mDioCmd;
// power interface
player_devaddr_t mPowerAddr;
player_power_data_t mPowerData;
int32_t mSleep;
double mLength;
double mWidth;
double mWheelBase;
double mWheelRadius;
acpValue mSpeed;
acpValue mPitch;
acpValue mVolume;
acpGarcia* mGarcia;
};
ConfigFile
Class for loading configuration file information.
Definition: configfile.h:196
player_dio_cmd
Command: output values (PLAYER_DIO_CMD_VALUES)
Definition: player_interfaces.h:2004
player_position2d_cmd_vel
position 2d velocity command
Definition: player_interfaces.h:617
player_msghdr
Generic message header.
Definition: player.h:157
GarciaDriver
Definition: garcia_mixed.h:30
player_devaddr
A device address.
Definition: player.h:141
ThreadedDriver
Base class for drivers which oeprate with a thread.
Definition: driver.h:544
player_power_data
Data: voltage (PLAYER_POWER_DATA_STATE)
Definition: player_interfaces.h:291
QueuePointer
An autopointer for the message queue.
Definition: message.h:73
player_ir_data
Data: ranges (PLAYER_IR_DATA_RANGES)
Definition: player_interfaces.h:2113
player_position2d_cmd_pos
position2d position command
Definition: player_interfaces.h:626
GarciaDriver::Main
virtual void Main()
Main method for driver thread.
Definition: garcia_mixed.cc:320
player_position2d_data
position2d data
Definition: player_interfaces.h:606
GarciaDriver::ProcessMessage
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: garcia_mixed.cc:344
GarciaDriver::MainSetup
int MainSetup()
Sets up the resources needed by the driver thread.
Definition: garcia_mixed.cc:280
player_speech_cmd
Command: say a string (PLAYER_SPEECH_CMD_SAY)
Definition: player_interfaces.h:1800
GarciaDriver::MainQuit
void MainQuit()
Cleanup method for driver thread (called when main exits)
Definition: garcia_mixed.cc:308
player_dio_data
Data: input values (PLAYER_DIO_DATA_VALUES)
Definition: player_interfaces.h:1992

Last updated 12 September 2005 21:38:45