23 #include "acquisition_thread.h"
25 #include <core/threading/mutex.h>
31 using namespace fawkes;
87 LaserAcquisitionThread::~LaserAcquisitionThread()
175 std::numeric_limits<float>::quiet_NaN(),
unsigned int get_distance_data_size()
Get distance data size.
void unlock()
Unlock the mutex.
Thread class encapsulation of pthreads.
void alloc_distances(unsigned int num_distances)
Allocate distances array.
fawkes::Mutex * _data_mutex
Lock while writing to distances or echoes array or marking new data.
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.
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.