Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

LaserProxy Class Reference
[Proxies]

#include <playerclient.h>

Inherits ClientProxy.

List of all members.


Detailed Description

The LaserProxy class is used to control a laser device. The latest scan data is held in two arrays: ranges and intensity. The laser scan range, resolution and so on can be configured using the Configure() method.


Public Member Functions

 LaserProxy (PlayerClient *pc, unsigned short index, unsigned char access='c')
int SetLaserState (const unsigned char state)
int Configure (double min_angle, double max_angle, unsigned int scan_res, unsigned int range_res, bool intensity)
int GetConfigure ()
int RangeCount ()
 Get the number of range/intensity readings.

double Ranges (int index)
 An alternate way to access the range data.

double MinLeft ()
double MinRight ()
double operator[] (unsigned int index)
void FillData (player_msghdr_t hdr, const char *buffer)
void Print ()
 Print out the current configuration and laser range/intensity data.

void PrintConfig ()
 Print out the current configuration.


Public Attributes

int scan_count
 Number of points in scan.

double scan_res
double min_angle
double max_angle
double range_res
 Range resolution of scan (mm).

bool intensity
 Whether or not reflectance (i.e., intensity) values are being returned.

double scan [PLAYER_LASER_MAX_SAMPLES][2]
 Scan data (polar): range (m) and bearing (radians).

double point [PLAYER_LASER_MAX_SAMPLES][2]
 Scan data (Cartesian): x,y (m).

unsigned char intensities [PLAYER_LASER_MAX_SAMPLES]
 The reflected intensity values (arbitrary units in range 0-7).

double min_right
double min_left


Constructor & Destructor Documentation

LaserProxy::LaserProxy PlayerClient pc,
unsigned short  index,
unsigned char  access = 'c'
[inline]
 

Constructor. Leave the access field empty to start unconnected.


Member Function Documentation

int LaserProxy::SetLaserState const unsigned char  state  ) 
 

Enable/disable the laser. Set state to 1 to enable, 0 to disable. Note that when laser is disabled the client will still receive laser data, but the ranges will always be the last value read from the laser before it was disabled. Returns 0 on success, -1 if there is a problem. Note: The sicklms200 driver currently does not implement this feature.

int LaserProxy::Configure double  min_angle,
double  max_angle,
unsigned int  scan_res,
unsigned int  range_res,
bool  intensity
 

Configure the laser scan pattern. Angles min_angle and max_angle are measured in radians. scan_res is measured in units of $0.01^{\circ}$; valid values are: 25 ($0.25^{\circ}$), 50 ($0.5^{\circ}$) and $100 (1^{\circ}$). range_res is measured in mm; valid values are: 1, 10, 100. Set intensity to true to enable intensity measurements, or false to disable. Returns the 0 on success, or -1 of there is a problem.

int LaserProxy::GetConfigure  ) 
 

Get the current laser configuration; it is read into the relevant class attributes. Returns the 0 on success, or -1 of there is a problem.

int LaserProxy::RangeCount  )  [inline]
 

Get the number of range/intensity readings.

double LaserProxy::Ranges int  index  )  [inline]
 

An alternate way to access the range data.

double LaserProxy::MinLeft  )  [inline]
 

double LaserProxy::MinRight  )  [inline]
 

double LaserProxy::operator[] unsigned int  index  )  [inline]
 

Range access operator. This operator provides an alternate way of access the range data. For example, given an LaserProxy named lp, the following expressions are equivalent: lp.ranges[0], lp.Ranges(0), and lp[0].

void LaserProxy::FillData player_msghdr_t  hdr,
const char *  buffer
[virtual]
 

All proxies must provide this method. It is used internally to parse new data when it is received.

Reimplemented from ClientProxy.

void LaserProxy::Print  )  [virtual]
 

Print out the current configuration and laser range/intensity data.

Reimplemented from ClientProxy.

void LaserProxy::PrintConfig  ) 
 

Print out the current configuration.


Member Data Documentation

int LaserProxy::scan_count
 

Number of points in scan.

double LaserProxy::scan_res
 

Angular resolution of scan (radians)

double LaserProxy::min_angle
 

Scan range for the latest set of data (radians)

double LaserProxy::max_angle
 

Scan range for the latest set of data (radians)

double LaserProxy::range_res
 

Range resolution of scan (mm).

bool LaserProxy::intensity
 

Whether or not reflectance (i.e., intensity) values are being returned.

double LaserProxy::scan[PLAYER_LASER_MAX_SAMPLES][2]
 

Scan data (polar): range (m) and bearing (radians).

double LaserProxy::point[PLAYER_LASER_MAX_SAMPLES][2]
 

Scan data (Cartesian): x,y (m).

unsigned char LaserProxy::intensities[PLAYER_LASER_MAX_SAMPLES]
 

The reflected intensity values (arbitrary units in range 0-7).

double LaserProxy::min_right
 

double LaserProxy::min_left
 


The documentation for this class was generated from the following file:
Generated on Tue May 3 14:15:51 2005 for Player by doxygen 1.3.6