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()
120 strncpy(data->frame, new_frame,
sizeof(data->frame)-1);
121 data->frame[
sizeof(data->frame)-1] = 0;
134 return data->orientation;
149 throw Exception(
"Index value %u out of bounds (0..3)", index);
151 return data->orientation[index];
173 memcpy(data->orientation, new_orientation,
sizeof(
float) * 4);
188 throw Exception(
"Index value %u out of bounds (0..3)", index);
190 data->orientation[index] = new_orientation;
202 return data->orientation_covariance;
217 throw Exception(
"Index value %u out of bounds (0..8)", index);
219 return data->orientation_covariance[index];
241 memcpy(data->orientation_covariance, new_orientation_covariance,
sizeof(
double) * 9);
256 throw Exception(
"Index value %u out of bounds (0..8)", index);
258 data->orientation_covariance[index] = new_orientation_covariance;
270 return data->angular_velocity;
285 throw Exception(
"Index value %u out of bounds (0..2)", index);
287 return data->angular_velocity[index];
309 memcpy(data->angular_velocity, new_angular_velocity,
sizeof(
float) * 3);
324 throw Exception(
"Index value %u out of bounds (0..2)", index);
326 data->angular_velocity[index] = new_angular_velocity;
338 return data->angular_velocity_covariance;
353 throw Exception(
"Index value %u out of bounds (0..8)", index);
355 return data->angular_velocity_covariance[index];
377 memcpy(data->angular_velocity_covariance, new_angular_velocity_covariance,
sizeof(
double) * 9);
392 throw Exception(
"Index value %u out of bounds (0..8)", index);
394 data->angular_velocity_covariance[index] = new_angular_velocity_covariance;
406 return data->linear_acceleration;
421 throw Exception(
"Index value %u out of bounds (0..2)", index);
423 return data->linear_acceleration[index];
445 memcpy(data->linear_acceleration, new_linear_acceleration,
sizeof(
float) * 3);
460 throw Exception(
"Index value %u out of bounds (0..2)", index);
462 data->linear_acceleration[index] = new_linear_acceleration;
474 return data->linear_acceleration_covariance;
489 throw Exception(
"Index value %u out of bounds (0..8)", index);
491 return data->linear_acceleration_covariance[index];
513 memcpy(data->linear_acceleration_covariance, new_linear_acceleration_covariance,
sizeof(
double) * 9);
528 throw Exception(
"Index value %u out of bounds (0..8)", index);
530 data->linear_acceleration_covariance[index] = new_linear_acceleration_covariance;
538 "message type for this interface type.",
type);
553 memcpy(data, oi->data,
sizeof(IMUInterface_data_t));
559 throw UnknownTypeException(
"Unknown enum type %s", enumtype);