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