garcia_mixed.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2000 Brian Gerkey et al.
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 
22 #include <stdint.h>
23 
24 #include <libplayercore/playercore.h>
25 
26 #include "acpGarcia.h"
27 
29 // The class for the driver
31 {
32  public:
33 
34  // Constructor; need that
35  GarciaDriver(ConfigFile* cf, int section);
36 
37  virtual ~GarciaDriver();
38 
39  // Must implement the following methods.
40  int MainSetup();
41  void MainQuit();
42  // Main function for device thread.
43  virtual void Main();
44 
45  // This method will be invoked on each incoming message
46  virtual int ProcessMessage(QueuePointer & resp_queue,
47  player_msghdr * hdr,
48  void * data);
49  //void ProcessConfig();
50  void ProcessPos2dPosCmd(player_msghdr_t* hdr, player_position2d_cmd_pos_t &data);
51  void ProcessPos2dVelCmd(player_msghdr_t* hdr, player_position2d_cmd_vel_t &data);
52  void ProcessSpeechCommand(player_msghdr_t* hdr, player_speech_cmd_t &data);
53  void ProcessDioCommand(player_msghdr_t* hdr, player_dio_cmd_t &data);
54 
55  void ProcessPos2dGeomReq(player_msghdr_t* hdr);
56  void ProcessIrPoseReq(player_msghdr_t* hdr);
57 
58  void RefreshData();
59 
60  private:
61 
62  // position2d interface
63  player_devaddr_t mPos2dAddr;
64  player_position2d_data_t mPos2dData;
65  player_position2d_cmd_pos_t mPos2dPosCmd;
66  player_position2d_cmd_vel_t mPos2dVelCmd;
67 
68  // ir interface
69  player_devaddr_t mIrAddr;
70  player_ir_data_t mIrData;
71 
72  // speech interface
73  player_devaddr_t mSpeechAddr;
74  player_speech_cmd_t mSpeechCmd;
75 
76  // dio interface
77  player_devaddr_t mDioAddr;
78  player_dio_data_t mDioData;
79  player_dio_cmd_t mDioCmd;
80 
81  // power interface
82  player_devaddr_t mPowerAddr;
83  player_power_data_t mPowerData;
84 
85  int32_t mSleep;
86 
87  double mLength;
88  double mWidth;
89  double mWheelBase;
90  double mWheelRadius;
91 
92  acpValue mSpeed;
93  acpValue mPitch;
94  acpValue mVolume;
95 
96  acpGarcia* mGarcia;
97 };
Class for loading configuration file information.
Definition: configfile.h:196
Command: output values (PLAYER_DIO_CMD_VALUES)
Definition: player_interfaces.h:2006
position 2d velocity command
Definition: player_interfaces.h:617
Generic message header.
Definition: player.h:161
Definition: garcia_mixed.h:30
A device address.
Definition: player.h:145
Base class for drivers which oeprate with a thread.
Definition: driver.h:552
Data: voltage (PLAYER_POWER_DATA_STATE)
Definition: player_interfaces.h:291
An autopointer for the message queue.
Definition: message.h:73
Data: ranges (PLAYER_IR_DATA_RANGES)
Definition: player_interfaces.h:2115
position2d position command
Definition: player_interfaces.h:626
virtual void Main()
Main method for driver thread.
Definition: garcia_mixed.cc:320
position2d data
Definition: player_interfaces.h:606
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: garcia_mixed.cc:344
int MainSetup()
Sets up the resources needed by the driver thread.
Definition: garcia_mixed.cc:280
Command: say a string (PLAYER_SPEECH_CMD_SAY)
Definition: player_interfaces.h:1797
void MainQuit()
Cleanup method for driver thread (called when main exits)
Definition: garcia_mixed.cc:308
Data: input values (PLAYER_DIO_DATA_VALUES)
Definition: player_interfaces.h:1994