RS4Leuze_laser.h
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2000 Brian Gerkey et al.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef RS4Leuze_laser_h
#define RS4Leuze_laser_h
#include <termios.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
using namespace std;
#define MAX_SCAN_POINTS 529
typedef struct RS4Leuze_laser_readings {
double Reading[MAX_SCAN_POINTS];
} RS4Leuze_laser_readings_t;
//classes
class Claser
{
private:
char *portName;
int serialFD;
termios ttyset;
fd_set rfds;
int selectResult;
unsigned char byte;
unsigned char checksum;
unsigned char option1;
long unsigned int scan_number;
unsigned int output_start;
unsigned int output_stop;
unsigned int scanedPoint;
unsigned char controlByte;
unsigned int points_to_scan;
struct timeval tv;
timeval timeStamp;
public:
//Claser(ClogMsg *lgMsg, bool *laser_ON, char dir_name[80]); /**<Opens serial port*/
Claser(int scan_points);
~Claser();
void closeLaser();
unsigned char readByte();
void sync();
//void readScan(); /**<Sets to scanData array values of last laser scanner*/
void writeConfig();
int scanRead();
void runLaser();
void closeSerial();
void openSerial(bool *laser_ON,int Baud_rate, const char * Port);
RS4Leuze_laser_readings_t scanData;
};
#endif
Claser::serialFD
int serialFD
Serial port file descriptor.
Definition: RS4Leuze_laser.h:56
Claser::selectResult
int selectResult
Laser Message fields.
Definition: RS4Leuze_laser.h:59
Claser::portName
char * portName
Serial Port where laser is connected.
Definition: RS4Leuze_laser.h:55
Claser
Claser implements functions to read data from a laser scanner ROTOSCAN RS4-4 (Leuze corp...
Definition: RS4Leuze_laser.h:52
RS4Leuze_laser_readings
Definition: RS4Leuze_laser.h:44
Claser::timeStamp
timeval timeStamp
Time in microseconds resolution.
Definition: RS4Leuze_laser.h:70
Claser::ttyset
termios ttyset
termios variable to configure serial port
Definition: RS4Leuze_laser.h:57

Last updated 12 September 2005 21:38:45