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
position
segwayrmp400
segwayrmp400.h
1
/*
2
* Player - One Hell of a Robot Server
3
* Copyright (C) 2009 Goutham Mallapragda, Anthony Cascone, Rich Mattes & Brian Gerkey
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
*/
20
/*
21
Desc: Segway RMP 400 Driver
22
Authors: Goutham Mallapragada, Anthony Cascone, Rich Mattes
23
Updated: July 21, 2009
24
*/
25
26
#ifndef __SEGWAYRMP400_H_
27
#define __SEGWAYRMP400_H_
28
29
#include <stdio.h>
30
#include <pthread.h>
31
#include <string.h>
32
#include <stdlib.h>
33
#include <math.h>
34
#if !defined (WIN32)
35
#include <unistd.h>
36
#include <netinet/in.h>
37
#endif
38
39
#include <libplayercore/playercore.h>
40
41
43
class
SegwayRMP400
:
public
ThreadedDriver
44
{
45
46
public
:
47
49
SegwayRMP400
(
ConfigFile
* cf,
int
section);
50
52
virtual
int
MainSetup
();
53
55
virtual
void
MainQuit
();
56
57
private
:
58
59
// Devices
60
Device
*
segwayrmp2d
[2];
61
Device
*
segwayrmp3d
[2];
62
63
// Device Addresses
64
player_devaddr_t
segwayrmp2d_id
[2];
65
player_devaddr_t
segwayrmp3d_id
[2];
66
67
player_devaddr_t
position3d_id
;
68
player_devaddr_t
position2d_id
;
69
70
// Device Data Structures
71
player_position2d_data_t
rmp2d_data
[2];
72
player_position3d_data_t
rmp3d_data
[2];
73
74
player_position2d_data_t
position2d_data
;
75
player_position2d_cmd_vel_t
position2d_cmd
;
76
77
player_position3d_data_t
position3d_data
;
78
player_position3d_cmd_vel_t
position3d_cmd
;
79
80
// Flags
81
bool
provide_2d
;
82
bool
provide_3d
;
83
84
int
counter;
86
void
Main
();
87
89
int
ProcessMessage
(
QueuePointer
&resp_queue,
player_msghdr_t
* hdr,
void
* data);
90
92
void
ProcessData
();
93
95
int
HandlePosition3DCmd
(
player_position3d_cmd_vel_t
* cmd);
96
98
int
HandlePosition2DCmd
(
player_position2d_cmd_vel_t
* cmd);
99
101
bool
newfront3d
, newback3d, newfront2d, newback2d;
102
104
bool
fullspeed
;
105
};
106
107
#endif
Last updated 12 September 2005 21:38:45