Fawkes API
Fawkes Development Version
|
24 #include <interfaces/IMUInterface.h>
26 #include <core/exceptions/software.h>
65 IMUInterface::IMUInterface() : Interface()
69 data = (IMUInterface_data_t *)
data_ptr;
79 unsigned char tmp_hash[] = {0x9d, 0xf6, 0xde, 0x9d, 0x32, 0xe3, 0xf, 0x11, 0xac, 0xdc, 0x5d, 0x92, 0x27, 0x89, 0x27, 0x7e};
84 IMUInterface::~IMUInterface()
132 return data->orientation;
147 throw Exception(
"Index value %u out of bounds (0..3)", index);
149 return data->orientation[index];
195 return data->orientation_covariance;
210 throw Exception(
"Index value %u out of bounds (0..8)", index);
212 return data->orientation_covariance[index];
258 return data->angular_velocity;
273 throw Exception(
"Index value %u out of bounds (0..2)", index);
275 return data->angular_velocity[index];
321 return data->angular_velocity_covariance;
336 throw Exception(
"Index value %u out of bounds (0..8)", index);
338 return data->angular_velocity_covariance[index];
384 return data->linear_acceleration;
399 throw Exception(
"Index value %u out of bounds (0..2)", index);
401 return data->linear_acceleration[index];
447 return data->linear_acceleration_covariance;
462 throw Exception(
"Index value %u out of bounds (0..8)", index);
464 return data->linear_acceleration_covariance[index];
506 "message type for this interface type.",
type);
521 memcpy(data, oi->data,
sizeof(IMUInterface_data_t));
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void * data_ptr
Pointer to local memory storage.
void set_orientation_covariance(unsigned int index, const double new_orientation_covariance)
Set orientation_covariance value at given index.
void set_frame(const char *new_frame)
Set frame value.
size_t maxlenof_angular_velocity() const
Get maximum length of angular_velocity value.
double * linear_acceleration_covariance() const
Get linear_acceleration_covariance value.
void set_angular_velocity_covariance(unsigned int index, const double new_angular_velocity_covariance)
Set angular_velocity_covariance value at given index.
IMUInterface Fawkes BlackBoard Interface.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
float * angular_velocity() const
Get angular_velocity value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_linear_acceleration_covariance() const
Get maximum length of linear_acceleration_covariance value.
double * orientation_covariance() const
Get orientation_covariance value.
char * frame() const
Get frame value.
const char * type() const
Get type of interface.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the field info list.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
size_t maxlenof_orientation() const
Get maximum length of orientation value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual Message * create_message(const char *type) const
Create message based on type name.
bool data_changed
Indicator if data has changed.
void set_linear_acceleration(unsigned int index, const float new_linear_acceleration)
Set linear_acceleration value at given index.
float * linear_acceleration() const
Get linear_acceleration value.
float * orientation() const
Get orientation value.
Fawkes library namespace.
void set_hash(unsigned char *ihash)
Set hash.
Base class for all Fawkes BlackBoard interfaces.
double * angular_velocity_covariance() const
Get angular_velocity_covariance value.
void set_orientation(unsigned int index, const float new_orientation)
Set orientation value at given index.
size_t maxlenof_angular_velocity_covariance() const
Get maximum length of angular_velocity_covariance value.
size_t maxlenof_frame() const
Get maximum length of frame value.
unsigned int data_size
Minimal data size to hold data storage.
size_t maxlenof_orientation_covariance() const
Get maximum length of orientation_covariance value.
size_t maxlenof_linear_acceleration() const
Get maximum length of linear_acceleration value.
void set_linear_acceleration_covariance(unsigned int index, const double new_linear_acceleration_covariance)
Set linear_acceleration_covariance value at given index.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
void set_angular_velocity(unsigned int index, const float new_angular_velocity)
Set angular_velocity value at given index.
Base class for exceptions in Fawkes.