24#include <interfaces/Laser360Interface.h>
26#include <core/exceptions/software.h>
50Laser360Interface::Laser360Interface() : Interface()
52 data_size =
sizeof(Laser360Interface_data_t);
53 data_ptr = malloc(data_size);
54 data = (Laser360Interface_data_t *)data_ptr;
55 data_ts = (interface_data_ts_t *)data_ptr;
56 memset(data_ptr, 0, data_size);
57 add_fieldinfo(IFT_STRING,
"frame", 32, data->frame);
58 add_fieldinfo(IFT_FLOAT,
"distances", 360, &data->distances);
59 add_fieldinfo(IFT_BOOL,
"clockwise_angle", 1, &data->clockwise_angle);
60 unsigned char tmp_hash[] = {0x5c, 0x1, 0x85, 0x24, 0x85, 0x28, 0x1f, 0xc6, 0xae, 0x4c, 0x46, 0x66, 0xe9, 0xcb, 0xe9, 0x4e};
65Laser360Interface::~Laser360Interface()
77Laser360Interface::frame()
const
87Laser360Interface::maxlenof_frame()
const
99Laser360Interface::set_frame(
const char * new_frame)
101 set_field(data->frame, new_frame);
111Laser360Interface::distances()
const
113 return data->distances;
125Laser360Interface::distances(
unsigned int index)
const
128 throw Exception(
"Index value %u out of bounds (0..359)", index);
130 return data->distances[index];
138Laser360Interface::maxlenof_distances()
const
150Laser360Interface::set_distances(
const float * new_distances)
152 set_field(data->distances, new_distances);
163Laser360Interface::set_distances(
unsigned int index,
const float new_distances)
165 set_field(data->distances, index, new_distances);
174Laser360Interface::is_clockwise_angle()
const
176 return data->clockwise_angle;
184Laser360Interface::maxlenof_clockwise_angle()
const
196Laser360Interface::set_clockwise_angle(
const bool new_clockwise_angle)
198 set_field(data->clockwise_angle, new_clockwise_angle);
203Laser360Interface::create_message(
const char *type)
const
206 "message type for this interface type.", type);
219 type(), other->
type());
221 memcpy(data, oi->data,
sizeof(Laser360Interface_data_t));
225Laser360Interface::enum_tostring(
const char *enumtype,
int val)
const
236Laser360Interface::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.
Laser360Interface Fawkes BlackBoard Interface.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Fawkes library namespace.