garcia_mixed.h

00001 /*
00002  *  Player - One Hell of a Robot Server
00003  *  Copyright (C) 2000  Brian Gerkey et al.
00004  *
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #include <stdint.h>
00023 
00024 #include <libplayercore/playercore.h>
00025 #include <libplayercore/error.h>
00026 
00027 #include "acpGarcia.h"
00028 
00030 // The class for the driver
00031 class GarciaDriver : public Driver
00032 {
00033   public:
00034 
00035     // Constructor; need that
00036     GarciaDriver(ConfigFile* cf, int section);
00037 
00038     virtual ~GarciaDriver();
00039 
00040     // Must implement the following methods.
00041     int Setup();
00042     int Shutdown();
00043     // Main function for device thread.
00044     virtual void Main();
00045 
00046     // This method will be invoked on each incoming message
00047     virtual int ProcessMessage(QueuePointer & resp_queue,
00048                                player_msghdr * hdr,
00049                                void * data);
00050     //void ProcessConfig();
00051     void ProcessPos2dPosCmd(player_msghdr_t* hdr, player_position2d_cmd_pos_t &data);
00052     void ProcessPos2dVelCmd(player_msghdr_t* hdr, player_position2d_cmd_vel_t &data);
00053     void ProcessSpeechCommand(player_msghdr_t* hdr, player_speech_cmd_t &data);
00054     void ProcessDioCommand(player_msghdr_t* hdr, player_dio_cmd_t &data);
00055 
00056     void ProcessPos2dGeomReq(player_msghdr_t* hdr);
00057     void ProcessIrPoseReq(player_msghdr_t* hdr);
00058 
00059     void RefreshData();
00060 
00061  private:
00062 
00063     // position2d interface
00064     player_devaddr_t           mPos2dAddr;
00065     player_position2d_data_t   mPos2dData;
00066     player_position2d_cmd_pos_t    mPos2dPosCmd;
00067     player_position2d_cmd_vel_t    mPos2dVelCmd;
00068 
00069     // ir interface
00070     player_devaddr_t       mIrAddr;
00071     player_ir_data_t       mIrData;
00072 
00073     // speech interface
00074     player_devaddr_t       mSpeechAddr;
00075     player_speech_cmd_t    mSpeechCmd;
00076 
00077     // dio interface
00078     player_devaddr_t       mDioAddr;
00079     player_dio_data_t      mDioData;
00080     player_dio_cmd_t       mDioCmd;
00081 
00082     // power interface
00083     player_devaddr_t       mPowerAddr;
00084     player_power_data_t      mPowerData;
00085 
00086     int32_t mSleep;
00087 
00088     double mLength;
00089     double mWidth;
00090     double mWheelBase;
00091     double mWheelRadius;
00092 
00093     acpValue mSpeed;
00094     acpValue mPitch;
00095     acpValue mVolume;
00096 
00097     acpGarcia* mGarcia;
00098 };

Last updated 12 September 2005 21:38:45