24#include <interfaces/Laser1080Interface.h>
26#include <core/exceptions/software.h>
47Laser1080Interface::Laser1080Interface() : Interface()
49 data_size =
sizeof(Laser1080Interface_data_t);
50 data_ptr = malloc(data_size);
51 data = (Laser1080Interface_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", 1080, &data->distances);
56 add_fieldinfo(IFT_BOOL,
"clockwise_angle", 1, &data->clockwise_angle);
57 unsigned char tmp_hash[] = {0xa7, 0xab, 0x1f, 0x20, 0xdb, 0x24, 0xf9, 0x1b, 0x4e, 0xd6, 0x8b, 0xfa, 0x65, 0x25, 0xe5, 0x22};
62Laser1080Interface::~Laser1080Interface()
74Laser1080Interface::frame()
const
84Laser1080Interface::maxlenof_frame()
const
96Laser1080Interface::set_frame(
const char * new_frame)
98 set_field(data->frame, new_frame);
108Laser1080Interface::distances()
const
110 return data->distances;
122Laser1080Interface::distances(
unsigned int index)
const
125 throw Exception(
"Index value %u out of bounds (0..1079)", index);
127 return data->distances[index];
135Laser1080Interface::maxlenof_distances()
const
147Laser1080Interface::set_distances(
const float * new_distances)
149 set_field(data->distances, new_distances);
160Laser1080Interface::set_distances(
unsigned int index,
const float new_distances)
162 set_field(data->distances, index, new_distances);
171Laser1080Interface::is_clockwise_angle()
const
173 return data->clockwise_angle;
181Laser1080Interface::maxlenof_clockwise_angle()
const
193Laser1080Interface::set_clockwise_angle(
const bool new_clockwise_angle)
195 set_field(data->clockwise_angle, new_clockwise_angle);
200Laser1080Interface::create_message(
const char *type)
const
203 "message type for this interface type.", type);
216 type(), other->
type());
218 memcpy(data, oi->data,
sizeof(Laser1080Interface_data_t));
222Laser1080Interface::enum_tostring(
const char *enumtype,
int val)
const
233Laser1080Interface::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.
Laser1080Interface Fawkes BlackBoard Interface.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Fawkes library namespace.