Fawkes API
Fawkes Development Version
|
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;
58 unsigned char tmp_hash[] = {0x48, 0xe9, 0x35, 0x74, 0x18, 0x14, 0x46, 0x31, 0x6e, 0x5c, 0x76, 0x2e, 0x39, 0x1, 0x5, 0x30};
63 Position2DTrackInterface::~Position2DTrackInterface()
78 return data->track_x_positions;
94 throw Exception(
"Index value %u out of bounds (0..29)", index);
96 return data->track_x_positions[index];
145 return data->track_y_positions;
161 throw Exception(
"Index value %u out of bounds (0..29)", index);
163 return data->track_y_positions[index];
212 return data->track_timestamps;
228 throw Exception(
"Index value %u out of bounds (0..29)", index);
230 return data->track_timestamps[index];
306 return data->track_id;
334 "message type for this interface type.",
type);
349 memcpy(data, oi->data,
sizeof(Position2DTrackInterface_data_t));
size_t maxlenof_track_x_positions() const
Get maximum length of track_x_positions value.
void * data_ptr
Pointer to local memory storage.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_track_timestamps() const
Get maximum length of track_timestamps value.
size_t maxlenof_length() const
Get maximum length of length value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_length(const uint32_t new_length)
Set length value.
void * data_ptr
Pointer to memory that contains local data.
size_t maxlenof_track_id() const
Get maximum length of track_id value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
@ IFT_UINT32
32 bit unsigned integer field
const char * type() const
Get type of interface.
int32_t * track_timestamps() const
Get track_timestamps value.
bool data_changed
Indicator if data has changed.
@ IFT_INT32
32 bit integer field
Fawkes library namespace.
void set_hash(unsigned char *ihash)
Set hash.
unsigned int data_size
Size of memory needed to hold all data.
Base class for all Fawkes BlackBoard interfaces.
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_track_id(const uint32_t new_track_id)
Set track_id value.
virtual Message * create_message(const char *type) const
Create message based on type name.
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_track_y_positions() const
Get maximum length of track_y_positions value.
uint32_t length() const
Get length value.
uint32_t track_id() const
Get track_id value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Position2DTrackInterface Fawkes BlackBoard Interface.
float * track_y_positions() const
Get track_y_positions value.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
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.
Base class for exceptions in Fawkes.