24 #include <interfaces/ObjectPositionInterface.h> 26 #include <core/exceptions/software.h> 88 ObjectPositionInterface::ObjectPositionInterface() : Interface()
90 data_size =
sizeof(ObjectPositionInterface_data_t);
92 data = (ObjectPositionInterface_data_t *)
data_ptr;
125 add_fieldinfo(
IFT_FLOAT,
"relative_xyz_velocity_covariance", 9, &data->relative_xyz_velocity_covariance,
"");
126 unsigned char tmp_hash[] = {0x9f, 0x72, 0x61, 0x39, 0x9a, 0xb4, 0x79, 0x4c, 0x33, 0x3, 0x3a, 0x75, 0xfc, 0xf0, 0xe5, 0x7e};
131 ObjectPositionInterface::~ObjectPositionInterface()
145 return data->object_type;
167 data->object_type = new_object_type;
206 data->flags = new_flags;
217 return data->visible;
237 data->visible = new_visible;
268 data->valid = new_valid;
285 return data->visibility_history;
311 data->visibility_history = new_visibility_history;
346 data->roll = new_roll;
381 data->pitch = new_pitch;
430 return data->distance;
453 data->distance = new_distance;
467 return data->bearing;
490 data->bearing = new_bearing;
529 data->slope = new_slope;
544 return data->dbs_covariance;
561 throw Exception(
"Index value %u out of bounds (0..9)", index);
563 return data->dbs_covariance[index];
587 memcpy(data->dbs_covariance, new_dbs_covariance,
sizeof(
float) * 9);
604 throw Exception(
"Index value %u out of bounds (0..9)", index);
606 data->dbs_covariance[index] = new_dbs_covariance;
620 return data->world_x;
644 data->world_x = new_world_x;
659 return data->world_y;
683 data->world_y = new_world_y;
698 return data->world_z;
722 data->world_z = new_world_z;
737 return data->world_xyz_covariance;
754 throw Exception(
"Index value %u out of bounds (0..9)", index);
756 return data->world_xyz_covariance[index];
780 memcpy(data->world_xyz_covariance, new_world_xyz_covariance,
sizeof(
float) * 9);
797 throw Exception(
"Index value %u out of bounds (0..9)", index);
799 data->world_xyz_covariance[index] = new_world_xyz_covariance;
811 return data->relative_x;
833 data->relative_x = new_relative_x;
846 return data->relative_y;
868 data->relative_y = new_relative_y;
881 return data->relative_z;
903 data->relative_z = new_relative_z;
918 return data->relative_xyz_covariance;
935 throw Exception(
"Index value %u out of bounds (0..9)", index);
937 return data->relative_xyz_covariance[index];
961 memcpy(data->relative_xyz_covariance, new_relative_xyz_covariance,
sizeof(
float) * 9);
978 throw Exception(
"Index value %u out of bounds (0..9)", index);
980 data->relative_xyz_covariance[index] = new_relative_xyz_covariance;
992 return data->extent_x;
1014 data->extent_x = new_extent_x;
1027 return data->extent_y;
1049 data->extent_y = new_extent_y;
1062 return data->extent_z;
1084 data->extent_z = new_extent_z;
1097 return data->world_x_velocity;
1119 data->world_x_velocity = new_world_x_velocity;
1132 return data->world_y_velocity;
1154 data->world_y_velocity = new_world_y_velocity;
1167 return data->world_z_velocity;
1189 data->world_z_velocity = new_world_z_velocity;
1204 return data->world_xyz_velocity_covariance;
1221 throw Exception(
"Index value %u out of bounds (0..9)", index);
1223 return data->world_xyz_velocity_covariance[index];
1247 memcpy(data->world_xyz_velocity_covariance, new_world_xyz_velocity_covariance,
sizeof(
float) * 9);
1264 throw Exception(
"Index value %u out of bounds (0..9)", index);
1266 data->world_xyz_velocity_covariance[index] = new_world_xyz_velocity_covariance;
1278 return data->relative_x_velocity;
1300 data->relative_x_velocity = new_relative_x_velocity;
1313 return data->relative_y_velocity;
1335 data->relative_y_velocity = new_relative_y_velocity;
1348 return data->relative_z_velocity;
1370 data->relative_z_velocity = new_relative_z_velocity;
1385 return data->relative_xyz_velocity_covariance;
1402 throw Exception(
"Index value %u out of bounds (0..9)", index);
1404 return data->relative_xyz_velocity_covariance[index];
1428 memcpy(data->relative_xyz_velocity_covariance, new_relative_xyz_velocity_covariance,
sizeof(
float) * 9);
1445 throw Exception(
"Index value %u out of bounds (0..9)", index);
1447 data->relative_xyz_velocity_covariance[index] = new_relative_xyz_velocity_covariance;
1455 "message type for this interface type.", type);
1470 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.
float relative_y() const
Get relative_y value.
static const uint32_t FLAG_HAS_COVARIANCES
FLAG_HAS_COVARIANCES constant.
float relative_x_velocity() const
Get relative_x_velocity value.
uint32_t object_type() const
Get object_type value.
void set_world_x_velocity(const float new_world_x_velocity)
Set world_x_velocity value.
void * data_ptr
Pointer to memory that contains local data.
virtual Message * create_message(const char *type) const
Create message based on type name.
void set_relative_y_velocity(const float new_relative_y_velocity)
Set relative_y_velocity value.
float * world_xyz_velocity_covariance() const
Get world_xyz_velocity_covariance value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
float relative_x() const
Get relative_x value.
void set_valid(const bool new_valid)
Set valid value.
ObjectPositionInterface Fawkes BlackBoard Interface.
void set_hash(unsigned char *ihash)
Set hash.
const char * type() const
Get message type.
size_t maxlenof_world_z() const
Get maximum length of world_z value.
size_t maxlenof_relative_y() const
Get maximum length of relative_y value.
size_t maxlenof_distance() const
Get maximum length of distance value.
static const uint32_t FLAG_HAS_EULER_ANGLES
FLAG_HAS_EULER_ANGLES constant.
size_t maxlenof_world_xyz_covariance() const
Get maximum length of world_xyz_covariance value.
static const uint32_t FLAG_HAS_VOLUME_EXTENT
FLAG_HAS_VOLUME_EXTENT constant.
Fawkes library namespace.
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.
size_t maxlenof_pitch() const
Get maximum length of pitch value.
size_t maxlenof_bearing() const
Get maximum length of bearing value.
void set_flags(const uint32_t new_flags)
Set flags value.
uint32_t flags() const
Get flags value.
size_t maxlenof_extent_y() const
Get maximum length of extent_y value.
size_t maxlenof_extent_z() const
Get maximum length of extent_z value.
size_t maxlenof_visibility_history() const
Get maximum length of visibility_history value.
float world_x_velocity() const
Get world_x_velocity value.
static const uint32_t FLAG_IS_FIXED_OBJECT
FLAG_IS_FIXED_OBJECT constant.
float world_z() const
Get world_z value.
size_t maxlenof_world_xyz_velocity_covariance() const
Get maximum length of world_xyz_velocity_covariance value.
float yaw() const
Get yaw value.
void set_distance(const float new_distance)
Set distance value.
void set_roll(const float new_roll)
Set roll value.
size_t maxlenof_dbs_covariance() const
Get maximum length of dbs_covariance value.
void set_relative_y(const float new_relative_y)
Set relative_y value.
float slope() const
Get slope value.
static const uint32_t FLAG_HAS_WORLD
FLAG_HAS_WORLD constant.
Base class for all Fawkes BlackBoard interfaces.
float bearing() const
Get bearing value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
static const uint32_t FLAG_HAS_Z_AS_ORI
FLAG_HAS_Z_AS_ORI constant.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_yaw() const
Get maximum length of yaw value.
float extent_x() const
Get extent_x value.
static const uint32_t TYPE_SELF
TYPE_SELF constant.
float world_x() const
Get world_x value.
float relative_z_velocity() const
Get relative_z_velocity value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
float world_y_velocity() const
Get world_y_velocity value.
size_t maxlenof_relative_xyz_covariance() const
Get maximum length of relative_xyz_covariance value.
size_t maxlenof_world_y() const
Get maximum length of world_y value.
bool data_changed
Indicator if data has changed.
size_t maxlenof_world_z_velocity() const
Get maximum length of world_z_velocity value.
static const uint32_t FLAG_HAS_RELATIVE_POLAR
FLAG_HAS_RELATIVE_POLAR constant.
size_t maxlenof_slope() const
Get maximum length of slope value.
static const uint32_t FLAG_HAS_CIRCULAR_EXTENT
FLAG_HAS_CIRCULAR_EXTENT constant.
size_t maxlenof_relative_y_velocity() const
Get maximum length of relative_y_velocity value.
void set_object_type(const uint32_t new_object_type)
Set object_type value.
static const uint32_t FLAG_NONE
FLAG_NONE constant.
size_t maxlenof_world_x_velocity() const
Get maximum length of world_x_velocity value.
size_t maxlenof_relative_z_velocity() const
Get maximum length of relative_z_velocity value.
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.
float relative_z() const
Get relative_z value.
Base class for exceptions in Fawkes.
void set_relative_x_velocity(const float new_relative_x_velocity)
Set relative_x_velocity value.
float * dbs_covariance() const
Get dbs_covariance value.
float pitch() const
Get pitch value.
bool is_visible() const
Get visible value.
void set_relative_z_velocity(const float new_relative_z_velocity)
Set relative_z_velocity value.
size_t maxlenof_relative_x() const
Get maximum length of relative_x 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.
float roll() const
Get roll value.
void set_extent_x(const float new_extent_x)
Set extent_x value.
float world_z_velocity() const
Get world_z_velocity value.
size_t maxlenof_valid() const
Get maximum length of valid value.
float extent_z() const
Get extent_z value.
float distance() const
Get distance 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.
size_t maxlenof_object_type() const
Get maximum length of object_type value.
void set_visible(const bool new_visible)
Set visible value.
void set_bearing(const float new_bearing)
Set bearing value.
float * relative_xyz_covariance() const
Get relative_xyz_covariance value.
static const uint32_t FLAG_HAS_RELATIVE_CARTESIAN
FLAG_HAS_RELATIVE_CARTESIAN constant.
int32_t visibility_history() const
Get visibility_history value.
size_t maxlenof_relative_z() const
Get maximum length of relative_z value.
void set_slope(const float new_slope)
Set slope value.
float extent_y() const
Get extent_y value.
void set_world_x(const float new_world_x)
Set world_x value.
size_t maxlenof_world_x() const
Get maximum length of world_x value.
size_t maxlenof_extent_x() const
Get maximum length of extent_x 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_x_velocity() const
Get maximum length of relative_x_velocity value.
float * relative_xyz_velocity_covariance() const
Get relative_xyz_velocity_covariance value.
float world_y() const
Get world_y value.
static const uint32_t TYPE_OTHER
TYPE_OTHER constant.
static const uint32_t TYPE_TEAMMEMBER
TYPE_TEAMMEMBER constant.
static const uint32_t TYPE_BALL
TYPE_BALL constant.
bool is_valid() const
Get valid value.
static const uint32_t FLAG_HAS_WORLD_VELOCITY
FLAG_HAS_WORLD_VELOCITY constant.
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_roll() const
Get maximum length of roll value.
float * world_xyz_covariance() const
Get world_xyz_covariance value.
size_t maxlenof_visible() const
Get maximum length of visible value.
static const uint32_t TYPE_OPPONENT
TYPE_OPPONENT constant.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0)
Add an entry to the info list.
size_t maxlenof_world_y_velocity() const
Get maximum length of world_y_velocity 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_y_velocity() const
Get relative_y_velocity value.
static const uint32_t TYPE_GOAL_YELLOW
TYPE_GOAL_YELLOW constant.
const char * type() const
Get type of interface.
size_t maxlenof_flags() const
Get maximum length of flags value.
void set_yaw(const float new_yaw)
Set yaw value.
32 bit unsigned integer field
size_t maxlenof_relative_xyz_velocity_covariance() const
Get maximum length of relative_xyz_velocity_covariance value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
void set_relative_z(const float new_relative_z)
Set relative_z value.
static const uint32_t TYPE_LINE
TYPE_LINE constant.
void set_world_y(const float new_world_y)
Set world_y value.