hokuyo_aist::ScanData Class Reference
Structure to store data returned from the laser scanner.
More...
#include <scan_data.h>
Inherited by ScanDataWrap.
List of all members.
|
Public Member Functions |
| ScanData () |
| ScanData (uint32_t *const ranges_buffer, unsigned int ranges_length, uint32_t *const intensities_buffer=0, unsigned int intensities_length=0) |
| ScanData (ScanData const &rhs) |
| This copy constructor performs a deep copy of present data.
|
const uint32_t * | ranges () const |
| Return a pointer to array of range readings in millimetres.
|
const uint32_t * | intensities () const |
| Return a pointer to an array of intensity readings.
|
unsigned int | ranges_length () const |
| Get the number of range samples in the data.
|
unsigned int | intensities_length () const |
| Get the number of intensity samples in the data.
|
bool | get_error_status () const |
| Indicates if one or more steps had an error.
|
std::string | error_code_to_string (uint32_t error_code) |
| Return a string representing the error for the given error code.
|
unsigned int | laser_time_stamp () const |
| Get the raw time stamp of the data in milliseconds.
|
unsigned long long | system_time_stamp () const |
| Get the system time stamp of the data in milliseconds.
|
LaserModel | model () const |
| Get the model of the laser that produced this scan.
|
bool | buffers_provided () const |
| Check if the buffers are being provided instead of automatic.
|
ScanData & | operator= (ScanData const &rhs) |
| Assignment operator.
|
uint32_t | operator[] (unsigned int index) |
| Subscript operator.
|
std::string | as_string () |
| Format the entire object into a string.
|
void | clean_up () |
| Force the data to clean up.
|
Detailed Description
Structure to store data returned from the laser scanner.
Constructor & Destructor Documentation
This constructor creates an empty ScanData with no data currently allocated.
ScanData::ScanData |
( |
uint32_t *const |
ranges_buffer, |
|
|
unsigned int |
ranges_length, |
|
|
uint32_t *const |
intensities_buffer = 0 , |
|
|
unsigned int |
intensities_length = 0 | |
|
) |
| | |
This constructor uses a provided data buffer rather than allocating automatically.
If the intensity pointer is 0, no data will be provided of that type.
- Parameters:
-
| ranges_buffer | A pointer to a data area to store range data in. It is the caller's responsibility to ensure that it is big enough. |
| ranges_length | The size of the ranges buffer. Used only for copy constructor and similar. |
| intensities_buffer | A pointer to a data area to store intensity data in. It is the caller's responsibility to ensure that it is big enough. |
| intensities_length | The size of the intensities buffer. Used only for copy constructor and similar. |
Member Function Documentation
bool hokuyo_aist::ScanData::get_error_status |
( |
|
) |
const [inline] |
Indicates if one or more steps had an error.
A step's value will be less than 20 if it had an error. Use error_code_to_string to get a textual representation of the error.
Referenced by operator=(), and ScanData().
unsigned int hokuyo_aist::ScanData::laser_time_stamp |
( |
|
) |
const [inline] |
Get the raw time stamp of the data in milliseconds.
This value is only available using SCIP version 2).
Referenced by operator=(), and ScanData().
Assignment operator.
If the rhs has provided buffers, the lhs will not receive the same buffers. Instead, it will copy the data into its own buffers. If the lhs has provided buffers, it is the caller's responsibility to ensure they will be big enough to receive the data from the rhs, except in the case of 0 buffers (no data will be copied for 0 buffers).
References buffers_provided(), get_error_status(), intensities(), intensities_length(), laser_time_stamp(), model(), ranges(), ranges_length(), and system_time_stamp().
uint32_t ScanData::operator[] |
( |
unsigned int |
index |
) |
|
Subscript operator.
Provides direct access to an element of the range data.
const uint32_t* hokuyo_aist::ScanData::ranges |
( |
|
) |
const [inline] |
Return a pointer to array of range readings in millimetres.
Values less than 20mm indicate an error. Check the error value for the data to see a probable cause for the error. Most of the time, it will just be an out-of-range reading.
Referenced by operator=(), and ScanData().
unsigned long long hokuyo_aist::ScanData::system_time_stamp |
( |
|
) |
const [inline] |
Get the system time stamp of the data in milliseconds.
This value is only available using SCIP version 2).
Referenced by operator=(), and ScanData().
The documentation for this class was generated from the following files: