24 #include <interfaces/Laser1080Interface.h> 26 #include <core/exceptions/software.h> 47 Laser1080Interface::Laser1080Interface() : Interface()
49 data_size =
sizeof(Laser1080Interface_data_t);
51 data = (Laser1080Interface_data_t *)
data_ptr;
57 unsigned char tmp_hash[] = {0xa7, 0xab, 0x1f, 0x20, 0xdb, 0x24, 0xf9, 0x1b, 0x4e, 0xd6, 0x8b, 0xfa, 0x65, 0x25, 0xe5, 0x22};
62 Laser1080Interface::~Laser1080Interface()
98 strncpy(data->frame, new_frame,
sizeof(data->frame));
111 return data->distances;
126 throw Exception(
"Index value %u out of bounds (0..1080)", index);
128 return data->distances[index];
150 memcpy(data->distances, new_distances,
sizeof(
float) * 1080);
165 throw Exception(
"Index value %u out of bounds (0..1080)", 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(Laser1080Interface_data_t));
void * data_ptr
Pointer to memory that contains local data.
bool is_clockwise_angle() const
Get clockwise_angle value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Laser1080Interface Fawkes BlackBoard Interface.
void set_hash(unsigned char *ihash)
Set hash.
virtual void copy_values(const Interface *other)
Copy values from other interface.
Fawkes library namespace.
size_t maxlenof_frame() const
Get maximum length of frame value.
Base class for all Fawkes BlackBoard interfaces.
void set_distances(unsigned int index, const float new_distances)
Set distances value at given index.
size_t maxlenof_clockwise_angle() const
Get maximum length of clockwise_angle value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
char * frame() const
Get frame value.
bool data_changed
Indicator if data has changed.
const char * type() const
Get type of interface.
Base class for exceptions in Fawkes.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual Message * create_message(const char *type) const
Create message based on type name.
void set_clockwise_angle(const bool new_clockwise_angle)
Set clockwise_angle value.
float * distances() const
Get distances value.
void set_frame(const char *new_frame)
Set frame value.
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 info list.
size_t maxlenof_distances() const
Get maximum length of distances value.
const char * type() const
Get message type.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.