23 #ifndef __PLUGINS_LASER_ACQUISITION_THREAD_H_ 24 #define __PLUGINS_LASER_ACQUISITION_THREAD_H_ 26 #include <core/threading/thread.h> 27 #include <aspect/logging.h> 28 #include <aspect/configurable.h> 29 #include <aspect/clock.h> 62 protected:
virtual void run() { Thread::run(); }
unsigned int get_distance_data_size()
Get distance data size.
Thread aspect that allows to obtain the current time from the clock.
Fawkes library namespace.
virtual void pre_init(fawkes::Configuration *config, fawkes::Logger *logger)=0
Pre initialization.
A class for handling time.
Thread class encapsulation of pthreads.
Logger * logger
This is the Logger member used to access the logger.
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.
Thread aspect to log output.
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.
Thread aspect to access configuration data.
void alloc_echoes(unsigned int num_echoes)
Allocate echoes array.
Mutex mutual exclusion lock.
bool lock_if_new_data()
Lock data if fresh.
Configuration * config
This is the Configuration member used to access the configuration.
Interface for configuration handling.
const float * get_echo_data()
Get echo data.
float * _echoes
Allocate a float array and copy your echo values here.
virtual void run()
Stub to see name in backtrace for easier debugging.