24 #include <interfaces/Laser720Interface.h> 26 #include <core/exceptions/software.h> 47 Laser720Interface::Laser720Interface() : Interface()
49 data_size =
sizeof(Laser720Interface_data_t);
51 data = (Laser720Interface_data_t *)
data_ptr;
57 unsigned char tmp_hash[] = {0xca, 0x5e, 0xf1, 0x60, 0x74, 0x77, 0x8d, 0x9b, 0x5c, 0x81, 0x53, 0x5f, 0xc1, 0xf6, 0x89, 0x69};
62 Laser720Interface::~Laser720Interface()
98 strncpy(data->frame, new_frame,
sizeof(data->frame));
111 return data->distances;
126 throw Exception(
"Index value %u out of bounds (0..720)", index);
128 return data->distances[index];
150 memcpy(data->distances, new_distances,
sizeof(
float) * 720);
165 throw Exception(
"Index value %u out of bounds (0..720)", index);
167 data->distances[index] = new_distances;
179 return data->clockwise_angle;
201 data->clockwise_angle = new_clockwise_angle;
210 "message type for this interface type.", type);
225 memcpy(data, oi->data,
sizeof(Laser720Interface_data_t));
size_t maxlenof_distances() const
Get maximum length of distances value.
size_t maxlenof_frame() const
Get maximum length of frame value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
virtual Message * create_message(const char *type) const
Create message based on type name.
void set_hash(unsigned char *ihash)
Set hash.
void set_frame(const char *new_frame)
Set frame value.
Fawkes library namespace.
unsigned int data_size
Minimal data size to hold data storage.
Base class for all Fawkes BlackBoard interfaces.
virtual void copy_values(const Interface *other)
Copy values from other interface.
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 field info list.
bool data_changed
Indicator if data has changed.
size_t maxlenof_clockwise_angle() const
Get maximum length of clockwise_angle value.
const char * type() const
Get type of interface.
void * data_ptr
Pointer to local memory storage.
Base class for exceptions in Fawkes.
char * frame() const
Get frame value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void set_distances(unsigned int index, const float new_distances)
Set distances value at given index.
float * distances() const
Get distances value.
void set_clockwise_angle(const bool new_clockwise_angle)
Set clockwise_angle value.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
Laser720Interface Fawkes BlackBoard Interface.
bool is_clockwise_angle() const
Get clockwise_angle value.