24 #include <interfaces/Laser720Interface.h>
26 #include <core/exceptions/software.h>
47 Laser720Interface::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};
62 Laser720Interface::~Laser720Interface()
74 Laser720Interface::frame()
const
84 Laser720Interface::maxlenof_frame()
const
96 Laser720Interface::set_frame(
const char * new_frame)
108 Laser720Interface::distances()
const
110 return data->distances;
122 Laser720Interface::distances(
unsigned int index)
const
125 throw Exception(
"Index value %u out of bounds (0..719)", index);
127 return data->distances[index];
135 Laser720Interface::maxlenof_distances()
const
147 Laser720Interface::set_distances(
const float * new_distances)
149 data_changed |=
change_field(data->distances, new_distances);
160 Laser720Interface::set_distances(
unsigned int index,
const float new_distances)
162 data_changed |=
change_field(data->distances, index, new_distances);
171 Laser720Interface::is_clockwise_angle()
const
173 return data->clockwise_angle;
181 Laser720Interface::maxlenof_clockwise_angle()
const
193 Laser720Interface::set_clockwise_angle(
const bool new_clockwise_angle)
195 data_changed |=
change_field(data->clockwise_angle, new_clockwise_angle);
200 Laser720Interface::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));
222 Laser720Interface::enum_tostring(
const char *enumtype,
int val)
const
233 Laser720Interface::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.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.