22 #include "acquisition_thread.h" 24 #include <core/threading/mutex.h> 25 #include <interfaces/IMUInterface.h> 101 std::string &cfg_name, std::string &cfg_prefix)
112 for (
unsigned int i = 0; i < 4; ++i)
orientation_[i] = 0.;
121 IMUAcquisitionThread::~IMUAcquisitionThread()
float angular_velocity_[3]
Pre-allocated angular velocities as array, 3 entries ordered (x,y,z).
void unlock()
Unlock data,.
double orientation_covariance_[9]
Pre-allocated orientation covariance, row major matrix ordered x, y, z.
float orientation_[4]
Pre-allocated orientation quaternion as array, 4 entries ordered (x,y,z,w).
virtual void init()
Initialize the thread.
void set_orientation(unsigned int index, const float new_orientation)
Set orientation value at given index.
void set_auto_timestamping(bool enabled)
Enable or disable automated timestamping.
Fawkes library namespace.
void unlock()
Unlock the mutex.
std::string cfg_name_
Configuration name (third element in config path).
A class for handling time.
fawkes::Time * timestamp_
Time when the most recent data was received.
Thread class encapsulation of pthreads.
void write()
Write from local copy into BlackBoard memory.
void set_linear_acceleration_covariance(unsigned int index, const double new_linear_acceleration_covariance)
Set linear_acceleration_covariance value at given index.
void set_angular_velocity(unsigned int index, const float new_angular_velocity)
Set angular_velocity value at given index.
void set_frame(const char *new_frame)
Set frame value.
bool lock_if_new_data()
Lock data if fresh.
void set_orientation_covariance(unsigned int index, const double new_orientation_covariance)
Set orientation_covariance value at given index.
bool new_data_
Set to true in your loop if new data is available.
std::string cfg_frame_
Coordinate frame for sensor.
std::string cfg_prefix_
Configuration path prefix.
virtual void loop()
Code to execute in the thread.
void set_angular_velocity_covariance(unsigned int index, const double new_angular_velocity_covariance)
Set angular_velocity_covariance value at given index.
IMUAcquisitionThread(const char *thread_name, bool continuous, std::string &cfg_name, std::string &cfg_prefix)
Constructor.
IMUInterface Fawkes BlackBoard Interface.
double angular_velocity_covariance_[9]
Pre-allocated angular velocity covariance, row major matrix ordered x, y, z.
fawkes::Mutex * data_mutex_
Lock while writing to distances or echoes array or marking new data.
virtual void finalize()
Finalize the thread.
void lock()
Lock this mutex.
double linear_acceleration_covariance_[9]
Pre-allocated linear acceleration covariance, row major matrix ordered x, y, z.
bool cfg_continuous_
True if running continuous.
Mutex mutual exclusion lock.
float linear_acceleration_[3]
Pre-allocated linear acceleration as array, 3 entries ordered (x,y,z).
Configuration * config
This is the Configuration member used to access the configuration.
virtual Interface * open_for_writing(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for writing.
void set_linear_acceleration(unsigned int index, const float new_linear_acceleration)
Set linear_acceleration value at given index.
void set_timestamp(const Time *t=NULL)
Set timestamp.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.
BlackBoard * blackboard
This is the BlackBoard instance you can use to interact with the BlackBoard.
virtual void close(Interface *interface)=0
Close interface.