23#ifndef _PLUGINS_LASER_ACQUISITION_THREAD_H_
24#define _PLUGINS_LASER_ACQUISITION_THREAD_H_
26#include <aspect/clock.h>
27#include <aspect/configurable.h>
28#include <aspect/logging.h>
29#include <core/threading/thread.h>
virtual void pre_init(fawkes::Configuration *config, fawkes::Logger *logger)=0
Pre initialization.
const float * get_echo_data()
Get echo data.
unsigned int get_echo_data_size()
Get echo data size.
const fawkes::Time * get_timestamp()
Get timestamp of data.
LaserAcquisitionThread(const char *thread_name)
Constructor.
void alloc_echoes(unsigned int num_echoes)
Allocate echoes array.
unsigned int _echoes_size
Assign this the size of the _echoes array.
const float * get_distance_data()
Get distance data.
float * _distances
Allocate a float array and copy your distance values measured in meters here.
fawkes::Mutex * _data_mutex
Lock while writing to distances or echoes array or marking new data.
bool _new_data
Set to true in your loop if new data is available.
void alloc_distances(unsigned int num_distances)
Allocate distances array.
void reset_distances()
Reset all distance values to NaN.
void unlock()
Unlock data,.
unsigned int _distances_size
Assign this the size of the _distances array.
float * _echoes
Allocate a float array and copy your echo values here.
virtual void run()
Stub to see name in backtrace for easier debugging.
unsigned int get_distance_data_size()
Get distance data size.
fawkes::Time * _timestamp
Time when the most recent data was received.
bool lock_if_new_data()
Lock data if fresh.
void reset_echoes()
Reset all distance values to NaN.
Thread aspect that allows to obtain the current time from the clock.
Thread aspect to access configuration data.
Configuration * config
This is the Configuration member used to access the configuration.
Interface for configuration handling.
Thread aspect to log output.
Logger * logger
This is the Logger member used to access the logger.
Mutex mutual exclusion lock.
Thread class encapsulation of pthreads.
A class for handling time.
Fawkes library namespace.