23 #include "sensacq_thread.h"
25 #include "controller.h"
46 :
Thread(
"KatanaSensorAcqusitionThread",
Thread::OPMODE_WAITFORWAKEUP)
75 logger_->
log_warn(
name(),
"Exception while reading sensor data: %s", e.
what());
void set_enabled(bool enabled)
Set whether data acquisition is enabled or not.
virtual void loop()
Code to execute in the thread.
KatanaSensorAcquisitionThread(fawkes::RefPtr< fawkes::KatanaController > katana, fawkes::Logger *logger)
Constructor.
Base class for exceptions in Fawkes.
virtual const char * what() const
Get primary string.
virtual void read_sensor_data()=0
Read all sensor data from device into controller libray.
virtual void log_warn(const char *component, const char *format,...)=0
Log warning message.
void lock()
Lock this mutex.
void unlock()
Unlock the mutex.
Thread class encapsulation of pthreads.
Mutex * loop_mutex
Mutex that is used to protect a call to loop().
const char * name() const
Get name of thread.
Fawkes library namespace.