Fawkes API
Fawkes Development Version
|
24 #include <interfaces/ObjectPositionInterface.h>
26 #include <core/exceptions/software.h>
90 ObjectPositionInterface::ObjectPositionInterface() : Interface()
92 data_size =
sizeof(ObjectPositionInterface_data_t);
94 data = (ObjectPositionInterface_data_t *)
data_ptr;
127 unsigned char tmp_hash[] = {0x65, 0xac, 0x82, 0xde, 0xcd, 0x8b, 0x12, 0x81, 0x7b, 0xe6, 0x61, 0xdd, 0x30, 0x55, 0xd, 0x38};
132 ObjectPositionInterface::~ObjectPositionInterface()
146 return data->object_type;
216 return data->visible;
252 return data->visibility_history;
393 return data->distance;
429 return data->bearing;
504 return data->dbs_covariance;
521 throw Exception(
"Index value %u out of bounds (0..8)", index);
523 return data->dbs_covariance[index];
575 return data->world_x;
613 return data->world_y;
651 return data->world_z;
689 return data->world_xyz_covariance;
706 throw Exception(
"Index value %u out of bounds (0..8)", index);
708 return data->world_xyz_covariance[index];
758 return data->relative_x;
792 return data->relative_y;
826 return data->relative_z;
862 return data->relative_xyz_covariance;
879 throw Exception(
"Index value %u out of bounds (0..8)", index);
881 return data->relative_xyz_covariance[index];
931 return data->extent_x;
965 return data->extent_y;
999 return data->extent_z;
1033 return data->world_x_velocity;
1067 return data->world_y_velocity;
1101 return data->world_z_velocity;
1137 return data->world_xyz_velocity_covariance;
1154 throw Exception(
"Index value %u out of bounds (0..8)", index);
1156 return data->world_xyz_velocity_covariance[index];
1206 return data->relative_x_velocity;
1240 return data->relative_y_velocity;
1274 return data->relative_z_velocity;
1310 return data->relative_xyz_velocity_covariance;
1327 throw Exception(
"Index value %u out of bounds (0..8)", index);
1329 return data->relative_xyz_velocity_covariance[index];
1375 "message type for this interface type.",
type);
1390 memcpy(data, oi->data,
sizeof(ObjectPositionInterface_data_t));
float relative_z_velocity() const
Get relative_z_velocity value.
float pitch() const
Get pitch value.
float * relative_xyz_velocity_covariance() const
Get relative_xyz_velocity_covariance value.
void set_relative_z_velocity(const float new_relative_z_velocity)
Set relative_z_velocity value.
void * data_ptr
Pointer to local memory storage.
static const uint32_t TYPE_OTHER
TYPE_OTHER constant.
static const uint32_t FLAG_HAS_Z_AS_ORI
FLAG_HAS_Z_AS_ORI constant.
void set_world_x(const float new_world_x)
Set world_x value.
size_t maxlenof_dbs_covariance() const
Get maximum length of dbs_covariance value.
size_t maxlenof_relative_xyz_velocity_covariance() const
Get maximum length of relative_xyz_velocity_covariance value.
float * world_xyz_covariance() const
Get world_xyz_covariance value.
static const uint32_t TYPE_TEAMMEMBER
TYPE_TEAMMEMBER constant.
static const uint32_t TYPE_SELF
TYPE_SELF constant.
float relative_x() const
Get relative_x value.
size_t maxlenof_world_z_velocity() const
Get maximum length of world_z_velocity value.
size_t maxlenof_extent_z() const
Get maximum length of extent_z value.
float world_y() const
Get world_y value.
size_t maxlenof_relative_y() const
Get maximum length of relative_y value.
float * world_xyz_velocity_covariance() const
Get world_xyz_velocity_covariance value.
float * dbs_covariance() const
Get dbs_covariance value.
void set_pitch(const float new_pitch)
Set pitch value.
size_t maxlenof_visible() const
Get maximum length of visible value.
float distance() const
Get distance value.
static const uint32_t FLAG_HAS_WORLD_VELOCITY
FLAG_HAS_WORLD_VELOCITY constant.
size_t maxlenof_slope() const
Get maximum length of slope value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_relative_y_velocity() const
Get maximum length of relative_y_velocity value.
uint32_t object_type() const
Get object_type value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
size_t maxlenof_flags() const
Get maximum length of flags value.
size_t maxlenof_relative_z_velocity() const
Get maximum length of relative_z_velocity value.
float bearing() const
Get bearing value.
float extent_z() const
Get extent_z value.
float world_y_velocity() const
Get world_y_velocity value.
float world_x() const
Get world_x value.
float world_z_velocity() const
Get world_z_velocity value.
@ IFT_UINT32
32 bit unsigned integer field
size_t maxlenof_extent_x() const
Get maximum length of extent_x value.
void set_world_y_velocity(const float new_world_y_velocity)
Set world_y_velocity value.
size_t maxlenof_relative_x_velocity() const
Get maximum length of relative_x_velocity value.
void set_world_y(const float new_world_y)
Set world_y value.
void set_extent_z(const float new_extent_z)
Set extent_z value.
void set_dbs_covariance(unsigned int index, const float new_dbs_covariance)
Set dbs_covariance value at given index.
float extent_x() const
Get extent_x value.
const char * type() const
Get type of interface.
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.
void set_extent_y(const float new_extent_y)
Set extent_y value.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
float relative_x_velocity() const
Get relative_x_velocity value.
size_t maxlenof_world_xyz_velocity_covariance() const
Get maximum length of world_xyz_velocity_covariance value.
static const uint32_t TYPE_GOAL_BLUE
TYPE_GOAL_BLUE constant.
size_t maxlenof_world_y_velocity() const
Get maximum length of world_y_velocity value.
void set_roll(const float new_roll)
Set roll value.
void set_slope(const float new_slope)
Set slope value.
size_t maxlenof_world_xyz_covariance() const
Get maximum length of world_xyz_covariance value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
void set_world_z_velocity(const float new_world_z_velocity)
Set world_z_velocity value.
size_t maxlenof_bearing() const
Get maximum length of bearing value.
static const uint32_t FLAG_NONE
FLAG_NONE constant.
static const uint32_t FLAG_HAS_EULER_ANGLES
FLAG_HAS_EULER_ANGLES constant.
void set_relative_xyz_velocity_covariance(unsigned int index, const float new_relative_xyz_velocity_covariance)
Set relative_xyz_velocity_covariance value at given index.
size_t maxlenof_extent_y() const
Get maximum length of extent_y value.
bool data_changed
Indicator if data has changed.
void set_extent_x(const float new_extent_x)
Set extent_x value.
size_t maxlenof_world_x() const
Get maximum length of world_x value.
void set_object_type(const uint32_t new_object_type)
Set object_type value.
@ IFT_INT32
32 bit integer field
void set_world_x_velocity(const float new_world_x_velocity)
Set world_x_velocity value.
void set_relative_y(const float new_relative_y)
Set relative_y value.
static const uint32_t FLAG_HAS_EXTENT
FLAG_HAS_EXTENT constant.
float extent_y() const
Get extent_y value.
float world_x_velocity() const
Get world_x_velocity value.
Fawkes library namespace.
float relative_z() const
Get relative_z value.
static const uint32_t FLAG_HAS_VOLUME_EXTENT
FLAG_HAS_VOLUME_EXTENT constant.
size_t maxlenof_distance() const
Get maximum length of distance value.
static const uint32_t FLAG_HAS_CIRCULAR_EXTENT
FLAG_HAS_CIRCULAR_EXTENT constant.
void set_hash(unsigned char *ihash)
Set hash.
float yaw() const
Get yaw value.
float roll() const
Get roll value.
size_t maxlenof_world_x_velocity() const
Get maximum length of world_x_velocity value.
static const uint32_t TYPE_LINE
TYPE_LINE constant.
static const uint32_t TYPE_OPPONENT
TYPE_OPPONENT constant.
size_t maxlenof_world_y() const
Get maximum length of world_y value.
size_t maxlenof_relative_x() const
Get maximum length of relative_x value.
size_t maxlenof_world_z() const
Get maximum length of world_z value.
Base class for all Fawkes BlackBoard interfaces.
float world_z() const
Get world_z value.
static const uint32_t FLAG_IS_FIXED_OBJECT
FLAG_IS_FIXED_OBJECT constant.
void set_world_z(const float new_world_z)
Set world_z value.
static const uint32_t FLAG_HAS_RELATIVE_CARTESIAN
FLAG_HAS_RELATIVE_CARTESIAN constant.
static const uint32_t FLAG_HAS_RELATIVE_POLAR
FLAG_HAS_RELATIVE_POLAR constant.
void set_yaw(const float new_yaw)
Set yaw value.
void set_relative_x_velocity(const float new_relative_x_velocity)
Set relative_x_velocity value.
void set_flags(const uint32_t new_flags)
Set flags value.
void set_relative_z(const float new_relative_z)
Set relative_z value.
static const uint32_t TYPE_GOAL_YELLOW
TYPE_GOAL_YELLOW constant.
size_t maxlenof_pitch() const
Get maximum length of pitch value.
size_t maxlenof_visibility_history() const
Get maximum length of visibility_history value.
float relative_y_velocity() const
Get relative_y_velocity value.
size_t maxlenof_relative_xyz_covariance() const
Get maximum length of relative_xyz_covariance value.
unsigned int data_size
Minimal data size to hold data storage.
static const uint32_t TYPE_BALL
TYPE_BALL constant.
size_t maxlenof_relative_z() const
Get maximum length of relative_z value.
void set_relative_y_velocity(const float new_relative_y_velocity)
Set relative_y_velocity value.
void set_relative_xyz_covariance(unsigned int index, const float new_relative_xyz_covariance)
Set relative_xyz_covariance value at given index.
void set_world_xyz_velocity_covariance(unsigned int index, const float new_world_xyz_velocity_covariance)
Set world_xyz_velocity_covariance value at given index.
int32_t visibility_history() const
Get visibility_history value.
void set_world_xyz_covariance(unsigned int index, const float new_world_xyz_covariance)
Set world_xyz_covariance value at given index.
uint32_t flags() const
Get flags value.
void set_bearing(const float new_bearing)
Set bearing value.
size_t maxlenof_object_type() const
Get maximum length of object_type value.
static const uint32_t FLAG_HAS_COVARIANCES
FLAG_HAS_COVARIANCES constant.
float * relative_xyz_covariance() const
Get relative_xyz_covariance value.
void set_distance(const float new_distance)
Set distance value.
float slope() const
Get slope value.
size_t maxlenof_yaw() const
Get maximum length of yaw value.
bool is_visible() const
Get visible value.
static const uint32_t FLAG_HAS_WORLD
FLAG_HAS_WORLD constant.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_roll() const
Get maximum length of roll value.
void set_relative_x(const float new_relative_x)
Set relative_x value.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
void set_visibility_history(const int32_t new_visibility_history)
Set visibility_history value.
float relative_y() const
Get relative_y value.
void set_visible(const bool new_visible)
Set visible value.
virtual Message * create_message(const char *type) const
Create message based on type name.
ObjectPositionInterface Fawkes BlackBoard Interface.
Base class for exceptions in Fawkes.