24#include <interfaces/Position2DTrackInterface.h>
26#include <core/exceptions/software.h>
46Position2DTrackInterface::Position2DTrackInterface() : Interface()
48 data_size =
sizeof(Position2DTrackInterface_data_t);
49 data_ptr = malloc(data_size);
50 data = (Position2DTrackInterface_data_t *)data_ptr;
51 data_ts = (interface_data_ts_t *)data_ptr;
52 memset(data_ptr, 0, data_size);
53 add_fieldinfo(IFT_FLOAT,
"track_x_positions", 30, &data->track_x_positions);
54 add_fieldinfo(IFT_FLOAT,
"track_y_positions", 30, &data->track_y_positions);
55 add_fieldinfo(IFT_INT32,
"track_timestamps", 30, &data->track_timestamps);
56 add_fieldinfo(IFT_UINT32,
"length", 1, &data->length);
57 add_fieldinfo(IFT_UINT32,
"track_id", 1, &data->track_id);
58 unsigned char tmp_hash[] = {0x48, 0xe9, 0x35, 0x74, 0x18, 0x14, 0x46, 0x31, 0x6e, 0x5c, 0x76, 0x2e, 0x39, 0x1, 0x5, 0x30};
63Position2DTrackInterface::~Position2DTrackInterface()
76Position2DTrackInterface::track_x_positions()
const
78 return data->track_x_positions;
91Position2DTrackInterface::track_x_positions(
unsigned int index)
const
94 throw Exception(
"Index value %u out of bounds (0..29)", index);
96 return data->track_x_positions[index];
104Position2DTrackInterface::maxlenof_track_x_positions()
const
117Position2DTrackInterface::set_track_x_positions(
const float * new_track_x_positions)
119 set_field(data->track_x_positions, new_track_x_positions);
131Position2DTrackInterface::set_track_x_positions(
unsigned int index,
const float new_track_x_positions)
133 set_field(data->track_x_positions, index, new_track_x_positions);
143Position2DTrackInterface::track_y_positions()
const
145 return data->track_y_positions;
158Position2DTrackInterface::track_y_positions(
unsigned int index)
const
161 throw Exception(
"Index value %u out of bounds (0..29)", index);
163 return data->track_y_positions[index];
171Position2DTrackInterface::maxlenof_track_y_positions()
const
184Position2DTrackInterface::set_track_y_positions(
const float * new_track_y_positions)
186 set_field(data->track_y_positions, new_track_y_positions);
198Position2DTrackInterface::set_track_y_positions(
unsigned int index,
const float new_track_y_positions)
200 set_field(data->track_y_positions, index, new_track_y_positions);
210Position2DTrackInterface::track_timestamps()
const
212 return data->track_timestamps;
225Position2DTrackInterface::track_timestamps(
unsigned int index)
const
228 throw Exception(
"Index value %u out of bounds (0..29)", index);
230 return data->track_timestamps[index];
238Position2DTrackInterface::maxlenof_track_timestamps()
const
251Position2DTrackInterface::set_track_timestamps(
const int32_t * new_track_timestamps)
253 set_field(data->track_timestamps, new_track_timestamps);
265Position2DTrackInterface::set_track_timestamps(
unsigned int index,
const int32_t new_track_timestamps)
267 set_field(data->track_timestamps, index, new_track_timestamps);
274Position2DTrackInterface::length()
const
284Position2DTrackInterface::maxlenof_length()
const
294Position2DTrackInterface::set_length(
const uint32_t new_length)
296 set_field(data->length, new_length);
304Position2DTrackInterface::track_id()
const
306 return data->track_id;
314Position2DTrackInterface::maxlenof_track_id()
const
324Position2DTrackInterface::set_track_id(
const uint32_t new_track_id)
326 set_field(data->track_id, new_track_id);
331Position2DTrackInterface::create_message(
const char *type)
const
334 "message type for this interface type.", type);
342Position2DTrackInterface::copy_values(
const Interface *other)
347 type(), other->
type());
349 memcpy(data, oi->data,
sizeof(Position2DTrackInterface_data_t));
353Position2DTrackInterface::enum_tostring(
const char *enumtype,
int val)
const
364Position2DTrackInterface::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.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Position2DTrackInterface Fawkes BlackBoard Interface.
Fawkes library namespace.