22 #include "acquisition_thread.h" 24 #include <core/threading/mutex.h> 91 LaserAcquisitionThread::~LaserAcquisitionThread()
190 std::numeric_limits<float>::quiet_NaN());
218 _distances[i] = std::numeric_limits<float>::quiet_NaN();
232 _echoes[i] = std::numeric_limits<float>::quiet_NaN();
unsigned int get_distance_data_size()
Get distance data size.
Fawkes library namespace.
void unlock()
Unlock the mutex.
A class for handling time.
Thread class encapsulation of pthreads.
void reset_distances()
Reset all distance values to NaN.
void alloc_distances(unsigned int num_distances)
Allocate distances array.
fawkes::Time * _timestamp
Time when the most recent data was received.
fawkes::Mutex * _data_mutex
Lock while writing to distances or echoes array or marking new data.
void reset_echoes()
Reset all distance values to NaN.
unsigned int get_echo_data_size()
Get echo data size.
unsigned int _distances_size
Assign this the size of the _distances array.
LaserAcquisitionThread(const char *thread_name)
Constructor.
float * _distances
Allocate a float array and copy your distance values measured in meters here.
const float * get_distance_data()
Get distance data.
unsigned int _echoes_size
Assign this the size of the _echoes array.
void unlock()
Unlock data,.
bool _new_data
Set to true in your loop if new data is available.
const fawkes::Time * get_timestamp()
Get timestamp of data.
void alloc_echoes(unsigned int num_echoes)
Allocate echoes array.
void lock()
Lock this mutex.
Mutex mutual exclusion lock.
bool lock_if_new_data()
Lock data if fresh.
const float * get_echo_data()
Get echo data.
float * _echoes
Allocate a float array and copy your echo values here.