Next: 2.11 LocalizeProxy
Up: 2. Class Reference
Previous: 2.9 IRProxy
Contents
Subsections
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.
int scan_count;
Number of points in scan
double scan_res;
Angular resolution of scan (radians)
double min_angle, max_angle;
Scan range for the latest set of data (radians)
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).
LaserProxy(PlayerClient* pc, unsigned short index,
unsigned char access='c')
Constructor. Leave the access field empty to start unconnected.
int 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 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.01o; valid values are: 25 (
0.25o), 50 (
0.5o) and
100(1o). 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 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 RangeCount()
Get the number of range/intensity readings.
double Ranges (int index)
An alternate way to access the range data.
double operator [] (unsigned int index)
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 Print()
Print out the current configuration and laser range/intensity data.
void PrintConfig()
Print out the current configuration
Next: 2.11 LocalizeProxy
Up: 2. Class Reference
Previous: 2.9 IRProxy
Contents
2004-05-31