Claser Class Reference

Claser implements functions to read data from a laser scanner ROTOSCAN RS4-4 (Leuze corp.) connected to a serial port. More...

#include <RS4Leuze_laser.h>

Collaboration diagram for Claser:
Collaboration graph

Detailed Description

Claser implements functions to read data from a laser scanner ROTOSCAN RS4-4 (Leuze corp.) connected to a serial port.

Public Member Functions

 Claser (int scan_points)
 Opens serial port. More...
 
 ~Claser ()
 Destructor.
 
void closeLaser ()
 Closes serial Port and data file.
 
unsigned char readByte ()
 Reads one byte and updates checksum message. More...
 
void sync ()
 sync function synchronizes with the start of the laser data
 
void writeConfig ()
 Write configuration parameters to laser scanner device.
 
int scanRead ()
 reads one scan and puts it in scanData array More...
 
void runLaser ()
 Return the scan reading from the laser.
 
void closeSerial ()
 Closes serial Port.
 
void openSerial (bool *laser_ON, int Baud_rate, const char *Port)
 Opens serial Port and get the default paarameters or those given in the .cfg file.
 

Public Attributes

RS4Leuze_laser_readings_t scanData
 

Private Attributes

char * portName
 Serial Port where laser is connected.
 
int serialFD
 Serial port file descriptor.
 
termios ttyset
 termios variable to configure serial port
 
fd_set rfds
 
int selectResult
 Laser Message fields.
 
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
 termios variable time interval
 
timeval timeStamp
 Time in microseconds resolution.
 

Constructor & Destructor Documentation

◆ Claser()

Claser::Claser ( int  scan_points)

Opens serial port.

laser.cpp V 2.0 -> RS4Leuze_laser.cpp

Modified by Ernesto Homar Teniente Aviles Date 20 APril 2007 Default constructor.

Member Function Documentation

◆ readByte()

unsigned char Claser::readByte ( )

Reads one byte and updates checksum message.

Reads one byte from serialFD and updates checksum.

References serialFD.

Referenced by scanRead().

◆ scanRead()

int Claser::scanRead ( )

reads one scan and puts it in scanData array

scanRead reads a whole message of a laser scan, loads it to scanData vector and prints it to laserDataFile.

If success returns 0 and returns 1 if failure.

References PLAYER_ERROR, readByte(), and serialFD.

Referenced by runLaser().

Here is the call graph for this function:

The documentation for this class was generated from the following files: