24#include <interfaces/TransformInterface.h>
26#include <core/exceptions/software.h>
53TransformInterface::TransformInterface() : Interface()
55 data_size =
sizeof(TransformInterface_data_t);
56 data_ptr = malloc(data_size);
57 data = (TransformInterface_data_t *)data_ptr;
58 data_ts = (interface_data_ts_t *)data_ptr;
59 memset(data_ptr, 0, data_size);
60 add_fieldinfo(IFT_STRING,
"frame", 64, data->frame);
61 add_fieldinfo(IFT_STRING,
"child_frame", 64, data->child_frame);
62 add_fieldinfo(IFT_BOOL,
"static_transform", 1, &data->static_transform);
63 add_fieldinfo(IFT_DOUBLE,
"translation", 3, &data->translation);
64 add_fieldinfo(IFT_DOUBLE,
"rotation", 4, &data->rotation);
65 unsigned char tmp_hash[] = {0xb6, 0xb0, 0xd3, 0x96, 0xda, 0x61, 0xdd, 0xd3, 0x6, 0x9e, 0x66, 0x4d, 0x14, 0x54, 0x5e, 0xfb};
70TransformInterface::~TransformInterface()
83TransformInterface::frame()
const
93TransformInterface::maxlenof_frame()
const
106TransformInterface::set_frame(
const char * new_frame)
108 set_field(data->frame, new_frame);
119TransformInterface::child_frame()
const
121 return data->child_frame;
129TransformInterface::maxlenof_child_frame()
const
142TransformInterface::set_child_frame(
const char * new_child_frame)
144 set_field(data->child_frame, new_child_frame);
155TransformInterface::is_static_transform()
const
157 return data->static_transform;
165TransformInterface::maxlenof_static_transform()
const
178TransformInterface::set_static_transform(
const bool new_static_transform)
180 set_field(data->static_transform, new_static_transform);
192TransformInterface::translation()
const
194 return data->translation;
208TransformInterface::translation(
unsigned int index)
const
211 throw Exception(
"Index value %u out of bounds (0..2)", index);
213 return data->translation[index];
221TransformInterface::maxlenof_translation()
const
235TransformInterface::set_translation(
const double * new_translation)
237 set_field(data->translation, new_translation);
250TransformInterface::set_translation(
unsigned int index,
const double new_translation)
252 set_field(data->translation, index, new_translation);
264TransformInterface::rotation()
const
266 return data->rotation;
281TransformInterface::rotation(
unsigned int index)
const
284 throw Exception(
"Index value %u out of bounds (0..3)", index);
286 return data->rotation[index];
294TransformInterface::maxlenof_rotation()
const
309TransformInterface::set_rotation(
const double * new_rotation)
311 set_field(data->rotation, new_rotation);
325TransformInterface::set_rotation(
unsigned int index,
const double new_rotation)
327 set_field(data->rotation, index, new_rotation);
331TransformInterface::create_message(
const char *type)
const
334 "message type for this interface type.", type);
347 type(), other->
type());
349 memcpy(data, oi->data,
sizeof(TransformInterface_data_t));
353TransformInterface::enum_tostring(
const char *enumtype,
int val)
const
364TransformInterface::message_valid(
const Message *message)
const
Base class for exceptions in Fawkes.
Base class for all Fawkes BlackBoard interfaces.
const char * type() const
Get type of interface.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Fawkes library namespace.