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
laser
RS4Leuze_laser.h
1
/*
2
* Player - One Hell of a Robot Server
3
* Copyright (C) 2000 Brian Gerkey et al.
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
28
#ifndef RS4Leuze_laser_h
29
#define RS4Leuze_laser_h
30
31
#include <termios.h>
32
#include <sys/types.h>
33
#include <sys/stat.h>
34
#include <fcntl.h>
35
#include <time.h>
36
#include <sys/time.h>
37
#include <stdlib.h>
38
39
using namespace
std;
40
41
#define MAX_SCAN_POINTS 529
42
43
44
typedef
struct
RS4Leuze_laser_readings
{
45
double
Reading[MAX_SCAN_POINTS];
46
}
RS4Leuze_laser_readings_t
;
47
48
//classes
52
class
Claser
53
{
54
private
:
55
char
*
portName
;
56
int
serialFD
;
57
termios
ttyset
;
58
fd_set rfds;
59
int
selectResult
;
60
unsigned
char
byte;
61
unsigned
char
checksum;
62
unsigned
char
option1;
63
long
unsigned
int
scan_number;
64
unsigned
int
output_start;
65
unsigned
int
output_stop;
66
unsigned
int
scanedPoint;
67
unsigned
char
controlByte;
68
unsigned
int
points_to_scan;
69
struct
timeval tv;
70
timeval
timeStamp
;
72
public
:
73
74
//Claser(ClogMsg *lgMsg, bool *laser_ON, char dir_name[80]); /**<Opens serial port*/
75
Claser
(
int
scan_points);
76
~
Claser
();
77
void
closeLaser();
78
unsigned
char
readByte();
79
void
sync();
80
//void readScan(); /**<Sets to scanData array values of last laser scanner*/
81
void
writeConfig();
82
int
scanRead();
83
void
runLaser();
84
void
closeSerial();
85
void
openSerial(
bool
*laser_ON,
int
Baud_rate,
const
char
* Port);
86
RS4Leuze_laser_readings_t
scanData;
87
88
};
89
90
#endif
91
92
Last updated 12 September 2005 21:38:45