fromranger.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2000 Brian Gerkey & Kasper Stoy
4  * gerkey@usc.edu kaspers@robotics.usc.edu
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 
23 //
24 // Desc: Base class for ranger-> interface converter drivers.
25 // Author: Geoffrey Biggs
26 // Date: 06/05/2007
27 //
29 
30 #include <libplayercore/playercore.h>
31 
32 class FromRanger : public Driver
33 {
34  public:
35  FromRanger (ConfigFile* cf, int section);
36  ~FromRanger (void);
37 
38  // Message processor - must be called first by child classes if overridden
39  virtual int ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data);
40 
41  virtual int Setup (void);
42  virtual int Shutdown (void);
43 
44  protected:
45  // Input device
46  Device *inputDevice; // Input device interface
47  player_devaddr_t inputDeviceAddr; // Input device address
48 };
Request to get an integer property.
Definition: player.h:458
char * string
The string to say.
Definition: player_interfaces.h:1802
#define PLAYER_WARN1(msg, a)
Error message macros.
Definition: error.h:90
QueuePointer ret_queue
Last requester's queue.
Definition: driver.h:186
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: fromranger.cc:68
uint32_t data_count
Size of data as stored in buffer (bytes)
Definition: player_interfaces.h:3447
#define PLAYER_GET_STRPROP_REQ
String property get request subtype.
Definition: player.h:438
String Property Class.
Definition: property.h:170
double proll
roll [rad]
Definition: player.h:237
virtual void Publish(player_devaddr_t addr, QueuePointer &queue, uint8_t type, uint8_t subtype, void *src=NULL, size_t deprecated=0, double *timestamp=NULL, bool copy=true)
Publish a message via one of this driver's interfaces.
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
Definition: Nclient.h:370
double px
X [m].
Definition: player.h:231
#define PLAYER_SET_STRPROP_REQ
String property set request subtype.
Definition: player.h:440
Generic message header.
Definition: player.h:161
double pz
Z [m].
Definition: player.h:235
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
Data: state (PLAYER_POSITION3D_DATA_STATE)
Definition: player_interfaces.h:2476
player_pose3d_t pos
(x, y, z, roll, pitch, yaw) position [m, m, m, rad, rad, rad]
Definition: player_interfaces.h:2479
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:74
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
virtual int Setup(void)
Initialize the driver.
Definition: fromranger.cc:51
#define PLAYER_POSITION3D_DATA_STATE
Data subtype: state.
Definition: player_interfaces.h:2432
double pyaw
yaw [rad]
Definition: player.h:241
virtual void Main(void)=0
Main method for driver thread.
int ReadInt(int section, const char *name, int value)
Read an integer value.
#define PLAYER_OPAQUE_DATA_STATE
Data subtype: generic state.
Definition: player_interfaces.h:3429
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
QueuePointer InQueue
Queue for all incoming messages for this driver.
Definition: driver.h:285
#define PLAYER_ERROR2(msg, a, b)
Error message macros.
Definition: error.h:83
int32_t value
The property value.
Definition: player.h:465
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
void PutMsg(QueuePointer &resp_queue, uint8_t type, uint8_t subtype, void *src, size_t deprecated, double *timestamp)
Send a message to this device.
#define PLAYER_WARN2(msg, a, b)
Error message macros.
Definition: error.h:91
Definition: fromranger.h:32
#define PLAYER_SPEECH_CMD_SAY
Command subtype: say a string.
Definition: player_interfaces.h:1789
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
double ppitch
pitch [rad]
Definition: player.h:239
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
#define PLAYER_MSGTYPE_RESP_NACK
A negative response message.
Definition: player.h:125
Integer property class.
Definition: property.h:114
#define PLAYER_GET_INTPROP_REQ
Integer property get request subtype.
Definition: player.h:430
Class for loading configuration file information.
Definition: configfile.h:196
#define PLAYER_CAPABILITIES_REQ
Capability request message type.
Definition: player.h:397
A device address.
Definition: player.h:145
An autopointer for the message queue.
Definition: message.h:73
double py
Y [m].
Definition: player.h:233
char * key
The property key.
Definition: player.h:485
#define PLAYER_ERROR1(msg, a)
Error message macros.
Definition: error.h:82
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:81
player_devaddr_t device_addr
Default device address (single-interface drivers)
Definition: driver.h:269
Base class for drivers which oeprate with a thread.
Definition: driver.h:552
#define PLAYER_GET_DBLPROP_REQ
Double property get request subtype.
Definition: player.h:434
virtual int Shutdown(void)
Finalize the driver.
Definition: fromranger.cc:58
Command: say a string (PLAYER_SPEECH_CMD_SAY)
Definition: player_interfaces.h:1797
char * key
The property key.
Definition: player.h:463
#define PLAYER_WARN(msg)
Warning message macros.
Definition: error.h:89
#define PLAYER_SET_DBLPROP_REQ
Double property set request subtype.
Definition: player.h:436
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:99
#define PLAYER_OPAQUE_CMD_DATA
Cmd subtype: generic command.
Definition: player_interfaces.h:3432
data
Definition: player_interfaces.h:3444
Base class for all drivers.
Definition: driver.h:108
Request to get a string property.
Definition: player.h:480
uint32_t string_count
Length of string.
Definition: player_interfaces.h:1800
#define PLAYER_SET_INTPROP_REQ
Integer property set request subtype.
Definition: player.h:432
player_devaddr_t addr
Device to which this message pertains.
Definition: player.h:164
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76
uint8_t * data
The data we will be sending.
Definition: player_interfaces.h:3449