24#include <interfaces/Laser720Interface.h>
26#include <core/exceptions/software.h>
47Laser720Interface::Laser720Interface() : Interface()
49 data_size =
sizeof(Laser720Interface_data_t);
50 data_ptr = malloc(data_size);
51 data = (Laser720Interface_data_t *)data_ptr;
52 data_ts = (interface_data_ts_t *)data_ptr;
53 memset(data_ptr, 0, data_size);
54 add_fieldinfo(IFT_STRING,
"frame", 32, data->frame);
55 add_fieldinfo(IFT_FLOAT,
"distances", 720, &data->distances);
56 add_fieldinfo(IFT_BOOL,
"clockwise_angle", 1, &data->clockwise_angle);
57 unsigned char tmp_hash[] = {0xca, 0x5e, 0xf1, 0x60, 0x74, 0x77, 0x8d, 0x9b, 0x5c, 0x81, 0x53, 0x5f, 0xc1, 0xf6, 0x89, 0x69};
62Laser720Interface::~Laser720Interface()
74Laser720Interface::frame()
const
84Laser720Interface::maxlenof_frame()
const
96Laser720Interface::set_frame(
const char * new_frame)
98 set_field(data->frame, new_frame);
108Laser720Interface::distances()
const
110 return data->distances;
122Laser720Interface::distances(
unsigned int index)
const
125 throw Exception(
"Index value %u out of bounds (0..719)", index);
127 return data->distances[index];
135Laser720Interface::maxlenof_distances()
const
147Laser720Interface::set_distances(
const float * new_distances)
149 set_field(data->distances, new_distances);
160Laser720Interface::set_distances(
unsigned int index,
const float new_distances)
162 set_field(data->distances, index, new_distances);
171Laser720Interface::is_clockwise_angle()
const
173 return data->clockwise_angle;
181Laser720Interface::maxlenof_clockwise_angle()
const
193Laser720Interface::set_clockwise_angle(
const bool new_clockwise_angle)
195 set_field(data->clockwise_angle, new_clockwise_angle);
200Laser720Interface::create_message(
const char *type)
const
203 "message type for this interface type.", type);
216 type(), other->
type());
218 memcpy(data, oi->data,
sizeof(Laser720Interface_data_t));
222Laser720Interface::enum_tostring(
const char *enumtype,
int val)
const
233Laser720Interface::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.
Laser720Interface Fawkes BlackBoard Interface.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Fawkes library namespace.