Convenient API to locally copy and use LRF measurements so as to minimize update lock usage by different behaviours. More...
#include <Robots/LoBot/io/LoLRFData.H>
Classes | |
class | Reading |
Public Member Functions | |
LRFData (const LaserRangeFinder *) | |
Initialization. | |
LRFData (const LRFData &) | |
Copy. | |
LRFData & | operator= (const LRFData &) |
Assignment. | |
int | distance (int angle) const |
int | operator[] (int angle) const |
std::vector< int > | distances () const |
Return all the distance readings via an STL vector. | |
~LRFData () | |
Clean-up. | |
range< int > | distance_range () const |
What is the device's distance measurement range? | |
int | min_distance () const |
int | max_distance () const |
range< int > | angular_range () const |
Retrieve the device's angular range. | |
int | min_angle () const |
int | max_angle () const |
float | average_distance (int min_angle, int max_angle) const |
Return the average distance in the given angular range. | |
float | average_distance (const range< int > &R) const |
Reading | min_distance (int min_angle, int max_angle) const |
Reading | min_distance (const range< int > &R) const |
Convenient API to locally copy and use LRF measurements so as to minimize update lock usage by different behaviours.
This class provides a convenient API for behaviours to make local copies of the current LRF measurements so that they don't have to hold on to the Robolocust update lock for very long.
Definition at line 77 of file LoLRFData.H.
lobot::LRFData::LRFData | ( | const LaserRangeFinder * | lrf | ) |
Initialization.
Definition at line 61 of file LoLRFData.C.
References Image< T >::begin(), Image< T >::end(), and lobot::LaserRangeFinder::get_distances().
lobot::LRFData::LRFData | ( | const LRFData & | L | ) |
Copy.
Definition at line 70 of file LoLRFData.C.
lobot::LRFData::~LRFData | ( | ) |
Clean-up.
Definition at line 160 of file LoLRFData.C.
range<int> lobot::LRFData::angular_range | ( | ) | const [inline] |
Retrieve the device's angular range.
Definition at line 119 of file LoLRFData.H.
float lobot::LRFData::average_distance | ( | int | min_angle, | |
int | max_angle | |||
) | const |
Return the average distance in the given angular range.
Definition at line 110 of file LoLRFData.C.
int lobot::LRFData::distance | ( | int | angle | ) | const |
What is the distance measurement (in mm) along the specified direction (in degrees)? A negative value is returned if the angle is out of range. Zero degrees corresponds to the front of the device. Directions to the left are positive angles and those to the right are negative.
Definition at line 96 of file LoLRFData.C.
Referenced by operator[]().
range<int> lobot::LRFData::distance_range | ( | ) | const [inline] |
What is the device's distance measurement range?
Definition at line 112 of file LoLRFData.H.
std::vector< int > lobot::LRFData::distances | ( | ) | const |
Return all the distance readings via an STL vector.
Definition at line 104 of file LoLRFData.C.
LRFData::Reading lobot::LRFData::min_distance | ( | int | min_angle, | |
int | max_angle | |||
) | const |
This function returns the reading corresponding to the minimum distance in the given angular range.
Definition at line 131 of file LoLRFData.C.
Assignment.
Definition at line 78 of file LoLRFData.C.
int lobot::LRFData::operator[] | ( | int | angle | ) | const [inline] |
Convenience function to return distance corresponding to some angle. A negative value is returned if the angle is out of range. Zero degrees corresponds to the front of the device. Directions to the left are positive angles and those to the right are negative.
Definition at line 105 of file LoLRFData.H.
References distance().