24 #include <interfaces/Position2DTrackInterface.h> 26 #include <core/exceptions/software.h> 46 Position2DTrackInterface::Position2DTrackInterface() : Interface()
48 data_size =
sizeof(Position2DTrackInterface_data_t);
50 data = (Position2DTrackInterface_data_t *)
data_ptr;
59 unsigned char tmp_hash[] = {0xcd, 0xb8, 0x68, 0x14, 0xff, 0x3, 0xe4, 0xc4, 0x20, 0x43, 0x44, 0xb8, 0x86, 0x87, 0xa3, 0x4c};
64 Position2DTrackInterface::~Position2DTrackInterface()
79 return data->track_x_positions;
95 throw Exception(
"Index value %u out of bounds (0..30)", index);
97 return data->track_x_positions[index];
120 memcpy(data->track_x_positions, new_track_x_positions,
sizeof(
float) * 30);
136 throw Exception(
"Index value %u out of bounds (0..30)", index);
138 data->track_x_positions[index] = new_track_x_positions;
151 return data->track_y_positions;
167 throw Exception(
"Index value %u out of bounds (0..30)", index);
169 return data->track_y_positions[index];
192 memcpy(data->track_y_positions, new_track_y_positions,
sizeof(
float) * 30);
208 throw Exception(
"Index value %u out of bounds (0..30)", index);
210 data->track_y_positions[index] = new_track_y_positions;
223 return data->track_timestamps;
239 throw Exception(
"Index value %u out of bounds (0..30)", index);
241 return data->track_timestamps[index];
264 memcpy(data->track_timestamps, new_track_timestamps,
sizeof(int32_t) * 30);
280 throw Exception(
"Index value %u out of bounds (0..30)", index);
282 data->track_timestamps[index] = new_track_timestamps;
312 data->valid = new_valid;
343 data->length = new_length;
354 return data->track_id;
374 data->track_id = new_track_id;
383 "message type for this interface type.", type);
398 memcpy(data, oi->data,
sizeof(Position2DTrackInterface_data_t));
void set_valid(const bool new_valid)
Set valid value.
void * data_ptr
Pointer to memory that contains local data.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
float * track_x_positions() const
Get track_x_positions value.
void set_track_x_positions(unsigned int index, const float new_track_x_positions)
Set track_x_positions value at given index.
void set_hash(unsigned char *ihash)
Set hash.
Fawkes library namespace.
size_t maxlenof_track_y_positions() const
Get maximum length of track_y_positions value.
size_t maxlenof_valid() const
Get maximum length of valid value.
void set_track_id(const uint32_t new_track_id)
Set track_id value.
uint32_t length() const
Get length value.
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.
Base class for all Fawkes BlackBoard interfaces.
uint32_t track_id() const
Get track_id value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
void set_track_y_positions(unsigned int index, const float new_track_y_positions)
Set track_y_positions value at given index.
void set_track_timestamps(unsigned int index, const int32_t new_track_timestamps)
Set track_timestamps value at given index.
bool data_changed
Indicator if data has changed.
bool is_valid() const
Get valid value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
float * track_y_positions() const
Get track_y_positions value.
const char * type() const
Get type of interface.
Base class for exceptions in Fawkes.
size_t maxlenof_track_x_positions() const
Get maximum length of track_x_positions value.
size_t maxlenof_track_timestamps() const
Get maximum length of track_timestamps value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_length() const
Get maximum length of length value.
void set_length(const uint32_t new_length)
Set length value.
size_t maxlenof_track_id() const
Get maximum length of track_id value.
int32_t * track_timestamps() const
Get track_timestamps 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.
const char * type() const
Get message type.
32 bit unsigned integer field
Position2DTrackInterface Fawkes BlackBoard Interface.