24 #include <interfaces/LaserBoxFilterInterface.h> 26 #include <core/exceptions/software.h> 46 LaserBoxFilterInterface::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};
60 LaserBoxFilterInterface::~LaserBoxFilterInterface()
70 LaserBoxFilterInterface::num_boxes()
const 72 return data->num_boxes;
80 LaserBoxFilterInterface::maxlenof_num_boxes()
const 90 LaserBoxFilterInterface::set_num_boxes(
const uint32_t new_num_boxes)
92 data->num_boxes = new_num_boxes;
98 LaserBoxFilterInterface::create_message(
const char *type)
const 100 if ( strncmp(
"CreateNewBoxFilterMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
104 "message type for this interface type.", type);
113 LaserBoxFilterInterface::copy_values(
const Interface *other)
118 type(), other->
type());
120 memcpy(data, oi->data,
sizeof(LaserBoxFilterInterface_data_t));
124 LaserBoxFilterInterface::enum_tostring(
const char *enumtype,
int val)
const 143 LaserBoxFilterInterface::CreateNewBoxFilterMessage::CreateNewBoxFilterMessage(
const double * ini_p1,
const double * ini_p2,
const double * ini_p3,
const double * ini_p4) :
Message(
"CreateNewBoxFilterMessage")
145 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
148 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
150 memcpy(data->p1, ini_p1,
sizeof(
double) * 2);
151 memcpy(data->p2, ini_p2,
sizeof(
double) * 2);
152 memcpy(data->p3, ini_p3,
sizeof(
double) * 2);
153 memcpy(data->p4, ini_p4,
sizeof(
double) * 2);
162 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
165 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
187 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
212 throw Exception(
"Index value %u out of bounds (0..2)", index);
214 return data->p1[index];
234 memcpy(data->p1, new_p1,
sizeof(
double) * 2);
246 throw Exception(
"Index value %u out of bounds (0..2)", index);
248 data->p1[index] = new_p1;
270 throw Exception(
"Index value %u out of bounds (0..2)", index);
272 return data->p2[index];
292 memcpy(data->p2, new_p2,
sizeof(
double) * 2);
304 throw Exception(
"Index value %u out of bounds (0..2)", index);
306 data->p2[index] = new_p2;
328 throw Exception(
"Index value %u out of bounds (0..2)", index);
330 return data->p3[index];
350 memcpy(data->p3, new_p3,
sizeof(
double) * 2);
362 throw Exception(
"Index value %u out of bounds (0..2)", index);
364 data->p3[index] = new_p3;
386 throw Exception(
"Index value %u out of bounds (0..2)", index);
388 return data->p4[index];
408 memcpy(data->p4, new_p4,
sizeof(
double) * 2);
420 throw Exception(
"Index value %u out of bounds (0..2)", index);
422 data->p4[index] = new_p4;
size_t maxlenof_p3() const
Get maximum length of p3 value.
void * data_ptr
Pointer to memory that contains local data.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_p3(unsigned int index, const double new_p3)
Set p3 value at given index.
Fawkes library namespace.
Timestamp data, must be present and first entries for each interface data structs!...
double * p4() const
Get p4 value.
size_t maxlenof_p1() const
Get maximum length of p1 value.
void set_p1(unsigned int index, const double new_p1)
Set p1 value at given index.
Base class for all Fawkes BlackBoard interfaces.
double * p1() const
Get p1 value.
LaserBoxFilterInterface Fawkes BlackBoard Interface.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
CreateNewBoxFilterMessage()
Constructor.
const char * type() const
Get type of interface.
void * data_ptr
Pointer to local memory storage.
Base class for exceptions in Fawkes.
~CreateNewBoxFilterMessage()
Destructor.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_p2() const
Get maximum length of p2 value.
CreateNewBoxFilterMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
double * p2() const
Get p2 value.
double * p3() const
Get p3 value.
size_t maxlenof_p4() const
Get maximum length of p4 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.
void set_p4(unsigned int index, const double new_p4)
Set p4 value at given index.
void set_p2(unsigned int index, const double new_p2)
Set p2 value at given index.