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;
128 unsigned char tmp_hash[] = {0x9f, 0x72, 0x61, 0x39, 0x9a, 0xb4, 0x79, 0x4c, 0x33, 0x3, 0x3a, 0x75, 0xfc, 0xf0, 0xe5, 0x7e};
133 ObjectPositionInterface::~ObjectPositionInterface()
147 return data->object_type;
169 data->object_type = new_object_type;
208 data->flags = new_flags;
219 return data->visible;
239 data->visible = new_visible;
270 data->valid = new_valid;
287 return data->visibility_history;
313 data->visibility_history = new_visibility_history;
348 data->roll = new_roll;
383 data->pitch = new_pitch;
432 return data->distance;
455 data->distance = new_distance;
469 return data->bearing;
492 data->bearing = new_bearing;
531 data->slope = new_slope;
546 return data->dbs_covariance;
563 throw Exception(
"Index value %u out of bounds (0..9)", index);
565 return data->dbs_covariance[index];
589 memcpy(data->dbs_covariance, new_dbs_covariance,
sizeof(
float) * 9);
606 throw Exception(
"Index value %u out of bounds (0..9)", index);
608 data->dbs_covariance[index] = new_dbs_covariance;
622 return data->world_x;
646 data->world_x = new_world_x;
661 return data->world_y;
685 data->world_y = new_world_y;
700 return data->world_z;
724 data->world_z = new_world_z;
739 return data->world_xyz_covariance;
756 throw Exception(
"Index value %u out of bounds (0..9)", index);
758 return data->world_xyz_covariance[index];
782 memcpy(data->world_xyz_covariance, new_world_xyz_covariance,
sizeof(
float) * 9);
799 throw Exception(
"Index value %u out of bounds (0..9)", index);
801 data->world_xyz_covariance[index] = new_world_xyz_covariance;
813 return data->relative_x;
835 data->relative_x = new_relative_x;
848 return data->relative_y;
870 data->relative_y = new_relative_y;
883 return data->relative_z;
905 data->relative_z = new_relative_z;
920 return data->relative_xyz_covariance;
937 throw Exception(
"Index value %u out of bounds (0..9)", index);
939 return data->relative_xyz_covariance[index];
963 memcpy(data->relative_xyz_covariance, new_relative_xyz_covariance,
sizeof(
float) * 9);
980 throw Exception(
"Index value %u out of bounds (0..9)", index);
982 data->relative_xyz_covariance[index] = new_relative_xyz_covariance;
994 return data->extent_x;
1016 data->extent_x = new_extent_x;
1029 return data->extent_y;
1051 data->extent_y = new_extent_y;
1064 return data->extent_z;
1086 data->extent_z = new_extent_z;
1099 return data->world_x_velocity;
1121 data->world_x_velocity = new_world_x_velocity;
1134 return data->world_y_velocity;
1156 data->world_y_velocity = new_world_y_velocity;
1169 return data->world_z_velocity;
1191 data->world_z_velocity = new_world_z_velocity;
1206 return data->world_xyz_velocity_covariance;
1223 throw Exception(
"Index value %u out of bounds (0..9)", index);
1225 return data->world_xyz_velocity_covariance[index];
1249 memcpy(data->world_xyz_velocity_covariance, new_world_xyz_velocity_covariance,
sizeof(
float) * 9);
1266 throw Exception(
"Index value %u out of bounds (0..9)", index);
1268 data->world_xyz_velocity_covariance[index] = new_world_xyz_velocity_covariance;
1280 return data->relative_x_velocity;
1302 data->relative_x_velocity = new_relative_x_velocity;
1315 return data->relative_y_velocity;
1337 data->relative_y_velocity = new_relative_y_velocity;
1350 return data->relative_z_velocity;
1372 data->relative_z_velocity = new_relative_z_velocity;
1387 return data->relative_xyz_velocity_covariance;
1404 throw Exception(
"Index value %u out of bounds (0..9)", index);
1406 return data->relative_xyz_velocity_covariance[index];
1430 memcpy(data->relative_xyz_velocity_covariance, new_relative_xyz_velocity_covariance,
sizeof(
float) * 9);
1447 throw Exception(
"Index value %u out of bounds (0..9)", index);
1449 data->relative_xyz_velocity_covariance[index] = new_relative_xyz_velocity_covariance;
1457 "message type for this interface type.", type);
1472 memcpy(data, oi->data,
sizeof(ObjectPositionInterface_data_t));
void set_world_y_velocity(const float new_world_y_velocity)
Set world_y_velocity value.
void set_world_z_velocity(const float new_world_z_velocity)
Set world_z_velocity value.
static const uint32_t FLAG_HAS_COVARIANCES
FLAG_HAS_COVARIANCES constant.
float distance() const
Get distance value.
float yaw() const
Get yaw value.
void set_world_x_velocity(const float new_world_x_velocity)
Set world_x_velocity value.
void set_relative_y_velocity(const float new_relative_y_velocity)
Set relative_y_velocity value.
size_t maxlenof_world_z() const
Get maximum length of world_z value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
bool is_valid() const
Get valid value.
size_t maxlenof_relative_x() const
Get maximum length of relative_x value.
size_t maxlenof_world_z_velocity() const
Get maximum length of world_z_velocity value.
size_t maxlenof_valid() const
Get maximum length of valid value.
float extent_x() const
Get extent_x value.
void set_valid(const bool new_valid)
Set valid value.
ObjectPositionInterface Fawkes BlackBoard Interface.
size_t maxlenof_dbs_covariance() const
Get maximum length of dbs_covariance value.
void set_hash(unsigned char *ihash)
Set hash.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
static const uint32_t FLAG_HAS_EULER_ANGLES
FLAG_HAS_EULER_ANGLES constant.
static const uint32_t FLAG_HAS_VOLUME_EXTENT
FLAG_HAS_VOLUME_EXTENT constant.
Fawkes library namespace.
float relative_y_velocity() const
Get relative_y_velocity value.
void set_world_z(const float new_world_z)
Set world_z value.
void set_extent_y(const float new_extent_y)
Set extent_y value.
unsigned int data_size
Minimal data size to hold data storage.
void set_flags(const uint32_t new_flags)
Set flags value.
size_t maxlenof_bearing() const
Get maximum length of bearing value.
size_t maxlenof_world_xyz_velocity_covariance() const
Get maximum length of world_xyz_velocity_covariance value.
static const uint32_t FLAG_IS_FIXED_OBJECT
FLAG_IS_FIXED_OBJECT constant.
void set_distance(const float new_distance)
Set distance value.
void set_roll(const float new_roll)
Set roll value.
void set_relative_y(const float new_relative_y)
Set relative_y value.
static const uint32_t FLAG_HAS_WORLD
FLAG_HAS_WORLD constant.
float * dbs_covariance() const
Get dbs_covariance value.
size_t maxlenof_object_type() const
Get maximum length of object_type value.
Base class for all Fawkes BlackBoard interfaces.
size_t maxlenof_extent_y() const
Get maximum length of extent_y value.
size_t maxlenof_distance() const
Get maximum length of distance value.
static const uint32_t FLAG_HAS_Z_AS_ORI
FLAG_HAS_Z_AS_ORI constant.
static const uint32_t TYPE_SELF
TYPE_SELF constant.
float world_y() const
Get world_y value.
float relative_x_velocity() const
Get relative_x_velocity value.
uint32_t object_type() const
Get object_type 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 field info list.
float world_z_velocity() const
Get world_z_velocity value.
float * relative_xyz_covariance() const
Get relative_xyz_covariance value.
int32_t visibility_history() const
Get visibility_history value.
size_t maxlenof_roll() const
Get maximum length of roll value.
float extent_z() const
Get extent_z value.
bool data_changed
Indicator if data has changed.
bool is_visible() const
Get visible value.
size_t maxlenof_extent_x() const
Get maximum length of extent_x value.
size_t maxlenof_world_y() const
Get maximum length of world_y value.
static const uint32_t FLAG_HAS_RELATIVE_POLAR
FLAG_HAS_RELATIVE_POLAR constant.
static const uint32_t FLAG_HAS_CIRCULAR_EXTENT
FLAG_HAS_CIRCULAR_EXTENT constant.
const char * type() const
Get type of interface.
void * data_ptr
Pointer to local memory storage.
void set_object_type(const uint32_t new_object_type)
Set object_type value.
static const uint32_t FLAG_NONE
FLAG_NONE constant.
static const uint32_t TYPE_GOAL_BLUE
TYPE_GOAL_BLUE constant.
void set_visibility_history(const int32_t new_visibility_history)
Set visibility_history value.
Base class for exceptions in Fawkes.
void set_relative_x_velocity(const float new_relative_x_velocity)
Set relative_x_velocity value.
size_t maxlenof_extent_z() const
Get maximum length of extent_z value.
size_t maxlenof_slope() const
Get maximum length of slope value.
float world_x_velocity() const
Get world_x_velocity value.
float * world_xyz_velocity_covariance() const
Get world_xyz_velocity_covariance value.
size_t maxlenof_relative_y() const
Get maximum length of relative_y value.
void set_relative_z_velocity(const float new_relative_z_velocity)
Set relative_z_velocity value.
static const uint32_t FLAG_HAS_EXTENT
FLAG_HAS_EXTENT constant.
void set_pitch(const float new_pitch)
Set pitch 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.
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.
size_t maxlenof_world_xyz_covariance() const
Get maximum length of world_xyz_covariance value.
size_t maxlenof_relative_x_velocity() const
Get maximum length of relative_x_velocity value.
float extent_y() const
Get extent_y value.
size_t maxlenof_pitch() const
Get maximum length of pitch value.
size_t maxlenof_relative_z() const
Get maximum length of relative_z value.
uint32_t flags() const
Get flags value.
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.
float world_z() const
Get world_z value.
void set_visible(const bool new_visible)
Set visible value.
float * world_xyz_covariance() const
Get world_xyz_covariance value.
void set_bearing(const float new_bearing)
Set bearing value.
float bearing() const
Get bearing value.
static const uint32_t FLAG_HAS_RELATIVE_CARTESIAN
FLAG_HAS_RELATIVE_CARTESIAN constant.
void set_slope(const float new_slope)
Set slope value.
void set_world_x(const float new_world_x)
Set world_x value.
float world_y_velocity() const
Get world_y_velocity value.
void set_relative_x(const float new_relative_x)
Set relative_x value.
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_relative_z_velocity() const
Get maximum length of relative_z_velocity value.
static const uint32_t TYPE_OTHER
TYPE_OTHER constant.
static const uint32_t TYPE_TEAMMEMBER
TYPE_TEAMMEMBER constant.
float roll() const
Get roll value.
size_t maxlenof_relative_xyz_velocity_covariance() const
Get maximum length of relative_xyz_velocity_covariance value.
static const uint32_t TYPE_BALL
TYPE_BALL constant.
static const uint32_t FLAG_HAS_WORLD_VELOCITY
FLAG_HAS_WORLD_VELOCITY constant.
size_t maxlenof_world_x_velocity() const
Get maximum length of world_x_velocity value.
void set_relative_xyz_covariance(unsigned int index, const float new_relative_xyz_covariance)
Set relative_xyz_covariance value at given index.
size_t maxlenof_flags() const
Get maximum length of flags value.
float pitch() const
Get pitch value.
static const uint32_t TYPE_OPPONENT
TYPE_OPPONENT constant.
float world_x() const
Get world_x value.
size_t maxlenof_world_y_velocity() const
Get maximum length of world_y_velocity value.
size_t maxlenof_visibility_history() const
Get maximum length of 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.
float relative_z() const
Get relative_z value.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
static const uint32_t TYPE_GOAL_YELLOW
TYPE_GOAL_YELLOW constant.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
float slope() const
Get slope value.
size_t maxlenof_relative_xyz_covariance() const
Get maximum length of relative_xyz_covariance value.
size_t maxlenof_yaw() const
Get maximum length of yaw value.
virtual Message * create_message(const char *type) const
Create message based on type name.
float relative_z_velocity() const
Get relative_z_velocity value.
size_t maxlenof_visible() const
Get maximum length of visible value.
void set_yaw(const float new_yaw)
Set yaw value.
32 bit unsigned integer field
virtual void copy_values(const Interface *other)
Copy values from other interface.
float * relative_xyz_velocity_covariance() const
Get relative_xyz_velocity_covariance value.
void set_relative_z(const float new_relative_z)
Set relative_z value.
size_t maxlenof_relative_y_velocity() const
Get maximum length of relative_y_velocity value.
float relative_y() const
Get relative_y value.
static const uint32_t TYPE_LINE
TYPE_LINE constant.
float relative_x() const
Get relative_x value.
void set_world_y(const float new_world_y)
Set world_y value.