24 #include <interfaces/Laser360Interface.h> 26 #include <core/exceptions/software.h> 50 Laser360Interface::Laser360Interface() : Interface()
52 data_size =
sizeof(Laser360Interface_data_t);
54 data = (Laser360Interface_data_t *)
data_ptr;
60 unsigned char tmp_hash[] = {0x5c, 0x1, 0x85, 0x24, 0x85, 0x28, 0x1f, 0xc6, 0xae, 0x4c, 0x46, 0x66, 0xe9, 0xcb, 0xe9, 0x4e};
65 Laser360Interface::~Laser360Interface()
101 strncpy(data->frame, new_frame,
sizeof(data->frame));
114 return data->distances;
129 throw Exception(
"Index value %u out of bounds (0..360)", index);
131 return data->distances[index];
153 memcpy(data->distances, new_distances,
sizeof(
float) * 360);
168 throw Exception(
"Index value %u out of bounds (0..360)", index);
170 data->distances[index] = new_distances;
182 return data->clockwise_angle;
204 data->clockwise_angle = new_clockwise_angle;
213 "message type for this interface type.", type);
228 memcpy(data, oi->data,
sizeof(Laser360Interface_data_t));
Laser360Interface Fawkes BlackBoard Interface.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_frame() const
Get maximum length of frame value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_frame(const char *new_frame)
Set frame value.
bool is_clockwise_angle() const
Get clockwise_angle value.
void set_clockwise_angle(const bool new_clockwise_angle)
Set clockwise_angle value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void set_hash(unsigned char *ihash)
Set hash.
Fawkes library namespace.
unsigned int data_size
Minimal data size to hold data storage.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
void set_distances(unsigned int index, const float new_distances)
Set distances value at given index.
Base class for all Fawkes BlackBoard interfaces.
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.
size_t maxlenof_clockwise_angle() const
Get maximum length of clockwise_angle value.
bool data_changed
Indicator if data has changed.
const char * type() const
Get type of interface.
void * data_ptr
Pointer to local memory storage.
Base class for exceptions in Fawkes.
virtual Message * create_message(const char *type) const
Create message based on type name.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
float * distances() const
Get distances value.
char * frame() const
Get frame value.
size_t maxlenof_distances() const
Get maximum length of distances value.