Player
Frontpage
Contents
User
Installation
Quick start
Supported devices
Tutorials
Utilities
Client libraries
FAQ
Help
Developer
Architecture
libplayercore
interfaces
libplayerdrivers
drivers
libplayercommon
libplayerutils
libplayersd
libplayertcp
libplayerxdr
TODO
Online
Homepage
Download
Project
Bugs
Help
server
drivers
mixed
garcia
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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
30
class
GarciaDriver
:
public
ThreadedDriver
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
};
Last updated 12 September 2005 21:38:45