Fawkes API
Fawkes Development Version
|
24 #include <interfaces/LocalizationInterface.h>
26 #include <core/exceptions/software.h>
48 LocalizationInterface::LocalizationInterface() : Interface()
50 data_size =
sizeof(LocalizationInterface_data_t);
52 data = (LocalizationInterface_data_t *)
data_ptr;
57 unsigned char tmp_hash[] = {0x7f, 0x9, 0xec, 0xd1, 00, 0x3f, 0x3, 0xb7, 0x95, 0xce, 0xe, 0x1d, 0x6f, 0x48, 0x6c, 0xad};
62 LocalizationInterface::~LocalizationInterface()
101 if ( strncmp(
"SetInitialPoseMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
105 "message type for this interface type.",
type);
121 memcpy(data, oi->data,
sizeof(LocalizationInterface_data_t));
146 data_size =
sizeof(SetInitialPoseMessage_data_t);
149 data = (SetInitialPoseMessage_data_t *)
data_ptr;
151 strncpy(data->frame, ini_frame, 32-1);
152 data->frame[32-1] = 0;
153 memcpy(data->rotation, ini_rotation,
sizeof(
double) * 4);
154 memcpy(data->translation, ini_translation,
sizeof(
double) * 3);
155 memcpy(data->covariance, ini_covariance,
sizeof(
double) * 36);
164 data_size =
sizeof(SetInitialPoseMessage_data_t);
167 data = (SetInitialPoseMessage_data_t *)
data_ptr;
189 data = (SetInitialPoseMessage_data_t *)
data_ptr;
237 return data->rotation;
252 throw Exception(
"Index value %u out of bounds (0..3)", index);
254 return data->rotation[index];
300 return data->translation;
315 throw Exception(
"Index value %u out of bounds (0..2)", index);
317 return data->translation[index];
352 change_field(data->translation, index, new_translation);
366 return data->covariance;
384 throw Exception(
"Index value %u out of bounds (0..35)", index);
386 return data->covariance[index];
void * data_ptr
Pointer to local memory storage.
double * covariance() const
Get covariance value.
virtual Message * clone() const
Clone this message.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void * data_ptr
Pointer to memory that contains local data.
double * translation() const
Get translation value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
message_data_ts_t * data_ts
data timestamp aliasing pointer
char * map() const
Get map value.
SetInitialPoseMessage Fawkes BlackBoard Interface Message.
const char * type() const
Get type of interface.
void set_rotation(unsigned int index, const double new_rotation)
Set rotation value at given index.
~SetInitialPoseMessage()
Destructor.
size_t maxlenof_map() const
Get maximum length of map value.
Timestamp data, must be present and first entries for each interface data structs!...
bool data_changed
Indicator if data has changed.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_frame() const
Get maximum length of frame value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
SetInitialPoseMessage()
Constructor.
LocalizationInterface Fawkes BlackBoard Interface.
void set_covariance(unsigned int index, const double new_covariance)
Set covariance value at given index.
Fawkes library namespace.
void set_hash(unsigned char *ihash)
Set hash.
unsigned int data_size
Size of memory needed to hold all data.
Base class for all Fawkes BlackBoard interfaces.
void set_map(const char *new_map)
Set map value.
void set_frame(const char *new_frame)
Set frame value.
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 info list.
char * frame() const
Get frame value.
double * rotation() const
Get rotation value.
size_t maxlenof_translation() const
Get maximum length of translation value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
void set_translation(unsigned int index, const double new_translation)
Set translation value at given index.
size_t maxlenof_rotation() const
Get maximum length of rotation value.
size_t maxlenof_covariance() const
Get maximum length of covariance value.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
virtual Message * create_message(const char *type) const
Create message based on type name.
Base class for exceptions in Fawkes.