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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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];
47 
48 //classes
52 class Claser
53 {
54  private:
55  char *portName;
56  int serialFD;
57  termios ttyset;
58  fd_set rfds;
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);
87 
88 };
89 
90 #endif
91 
92 
int serialFD
Serial port file descriptor.
Definition: RS4Leuze_laser.h:56
Definition: playerclient.h:313
int selectResult
Laser Message fields.
Definition: RS4Leuze_laser.h:59
char * portName
Serial Port where laser is connected.
Definition: RS4Leuze_laser.h:55
Claser implements functions to read data from a laser scanner ROTOSCAN RS4-4 (Leuze corp...
Definition: RS4Leuze_laser.h:52
Definition: RS4Leuze_laser.h:44
timeval timeStamp
Time in microseconds resolution.
Definition: RS4Leuze_laser.h:70
termios ttyset
termios variable to configure serial port
Definition: RS4Leuze_laser.h:57