24#include <interfaces/LaserBoxFilterInterface.h>
26#include <core/exceptions/software.h>
46LaserBoxFilterInterface::LaserBoxFilterInterface() : Interface()
48 data_size =
sizeof(LaserBoxFilterInterface_data_t);
49 data_ptr = malloc(data_size);
50 data = (LaserBoxFilterInterface_data_t *)data_ptr;
51 data_ts = (interface_data_ts_t *)data_ptr;
52 memset(data_ptr, 0, data_size);
53 add_fieldinfo(IFT_UINT32,
"num_boxes", 1, &data->num_boxes);
54 add_messageinfo(
"CreateNewBoxFilterMessage");
55 unsigned char tmp_hash[] = {0xd5, 0xd3, 0x35, 0xa5, 0xf5, 0xeb, 0xfe, 0xe0, 0x2e, 0x9e, 0xda, 0xa8, 0x77, 0x6f, 0x3, 0x74};
60LaserBoxFilterInterface::~LaserBoxFilterInterface()
70LaserBoxFilterInterface::num_boxes()
const
72 return data->num_boxes;
80LaserBoxFilterInterface::maxlenof_num_boxes()
const
90LaserBoxFilterInterface::set_num_boxes(
const uint32_t new_num_boxes)
92 set_field(data->num_boxes, new_num_boxes);
97LaserBoxFilterInterface::create_message(
const char *type)
const
99 if ( strncmp(
"CreateNewBoxFilterMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
103 "message type for this interface type.", type);
112LaserBoxFilterInterface::copy_values(
const Interface *other)
117 type(), other->
type());
119 memcpy(data, oi->data,
sizeof(LaserBoxFilterInterface_data_t));
123LaserBoxFilterInterface::enum_tostring(
const char *enumtype,
int val)
const
142LaserBoxFilterInterface::CreateNewBoxFilterMessage::CreateNewBoxFilterMessage(
const double * ini_p1,
const double * ini_p2,
const double * ini_p3,
const double * ini_p4) :
Message(
"CreateNewBoxFilterMessage")
144 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
147 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
149 memcpy(data->p1, ini_p1,
sizeof(
double) * 2);
150 memcpy(data->p2, ini_p2,
sizeof(
double) * 2);
151 memcpy(data->p3, ini_p3,
sizeof(
double) * 2);
152 memcpy(data->p4, ini_p4,
sizeof(
double) * 2);
161 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
164 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
186 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
211 throw Exception(
"Index value %u out of bounds (0..1)", index);
213 return data->p1[index];
266 throw Exception(
"Index value %u out of bounds (0..1)", index);
268 return data->p2[index];
321 throw Exception(
"Index value %u out of bounds (0..1)", index);
323 return data->p3[index];
376 throw Exception(
"Index value %u out of bounds (0..1)", index);
378 return data->p4[index];
Base class for exceptions in Fawkes.
Base class for all Fawkes BlackBoard interfaces.
const char * type() const
Get type of interface.
void * data_ptr
Pointer to local memory storage.
void set_field(FieldT &field, DataT &data)
Set a field, set data_changed to true and update data_changed accordingly.
CreateNewBoxFilterMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
size_t maxlenof_p3() const
Get maximum length of p3 value.
void set_p4(unsigned int index, const double new_p4)
Set p4 value at given index.
double * p4() const
Get p4 value.
size_t maxlenof_p2() const
Get maximum length of p2 value.
CreateNewBoxFilterMessage()
Constructor.
double * p1() const
Get p1 value.
~CreateNewBoxFilterMessage()
Destructor.
void set_p1(unsigned int index, const double new_p1)
Set p1 value at given index.
void set_p2(unsigned int index, const double new_p2)
Set p2 value at given index.
double * p2() const
Get p2 value.
size_t maxlenof_p1() const
Get maximum length of p1 value.
void set_p3(unsigned int index, const double new_p3)
Set p3 value at given index.
size_t maxlenof_p4() const
Get maximum length of p4 value.
double * p3() const
Get p3 value.
LaserBoxFilterInterface Fawkes BlackBoard Interface.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
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.
void * data_ptr
Pointer to memory that contains local data.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
Fawkes library namespace.
Timestamp data, must be present and first entries for each interface data structs!...