Fawkes API  Fawkes Development Version
ObjectPositionInterface.cpp
00001 
00002 /***************************************************************************
00003  *  ObjectPositionInterface.cpp - Fawkes BlackBoard Interface - ObjectPositionInterface
00004  *
00005  *  Templated created:   Thu Oct 12 10:49:19 2006
00006  *  Copyright  2007-2008  Tim Niemueller
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <interfaces/ObjectPositionInterface.h>
00025 
00026 #include <core/exceptions/software.h>
00027 
00028 #include <cstring>
00029 #include <cstdlib>
00030 
00031 namespace fawkes {
00032 
00033 /** @class ObjectPositionInterface <interfaces/ObjectPositionInterface.h>
00034  * ObjectPositionInterface Fawkes BlackBoard Interface.
00035  * 
00036       This interface provides access to arbitrary object positions and velocities. You
00037       can use it to store the position of any object in the RoboCup domain. There is a type
00038       indicator for the RoboCup soccer domain to easily distinguish several well
00039       known objects. You may choose not to use this for other application in which case
00040       the value should be other (which is also the default).
00041     
00042  * @ingroup FawkesInterfaces
00043  */
00044 
00045 
00046 /** TYPE_OTHER constant */
00047 const uint32_t ObjectPositionInterface::TYPE_OTHER = 0u;
00048 /** TYPE_BALL constant */
00049 const uint32_t ObjectPositionInterface::TYPE_BALL = 1u;
00050 /** TYPE_OPPONENT constant */
00051 const uint32_t ObjectPositionInterface::TYPE_OPPONENT = 2u;
00052 /** TYPE_TEAMMEMBER constant */
00053 const uint32_t ObjectPositionInterface::TYPE_TEAMMEMBER = 3u;
00054 /** TYPE_LINE constant */
00055 const uint32_t ObjectPositionInterface::TYPE_LINE = 4u;
00056 /** TYPE_SELF constant */
00057 const uint32_t ObjectPositionInterface::TYPE_SELF = 5u;
00058 /** TYPE_GOAL_BLUE constant */
00059 const uint32_t ObjectPositionInterface::TYPE_GOAL_BLUE = 6u;
00060 /** TYPE_GOAL_YELLOW constant */
00061 const uint32_t ObjectPositionInterface::TYPE_GOAL_YELLOW = 7u;
00062 /** FLAG_NONE constant */
00063 const uint32_t ObjectPositionInterface::FLAG_NONE = 0u;
00064 /** FLAG_HAS_WORLD constant */
00065 const uint32_t ObjectPositionInterface::FLAG_HAS_WORLD = 1u;
00066 /** FLAG_HAS_RELATIVE_CARTESIAN constant */
00067 const uint32_t ObjectPositionInterface::FLAG_HAS_RELATIVE_CARTESIAN = 2u;
00068 /** FLAG_HAS_RELATIVE_POLAR constant */
00069 const uint32_t ObjectPositionInterface::FLAG_HAS_RELATIVE_POLAR = 4u;
00070 /** FLAG_HAS_EULER_ANGLES constant */
00071 const uint32_t ObjectPositionInterface::FLAG_HAS_EULER_ANGLES = 8u;
00072 /** FLAG_HAS_EXTENT constant */
00073 const uint32_t ObjectPositionInterface::FLAG_HAS_EXTENT = 16u;
00074 /** FLAG_HAS_VOLUME_EXTENT constant */
00075 const uint32_t ObjectPositionInterface::FLAG_HAS_VOLUME_EXTENT = 32u;
00076 /** FLAG_HAS_CIRCULAR_EXTENT constant */
00077 const uint32_t ObjectPositionInterface::FLAG_HAS_CIRCULAR_EXTENT = 64u;
00078 /** FLAG_HAS_COVARIANCES constant */
00079 const uint32_t ObjectPositionInterface::FLAG_HAS_COVARIANCES = 128u;
00080 /** FLAG_HAS_WORLD_VELOCITY constant */
00081 const uint32_t ObjectPositionInterface::FLAG_HAS_WORLD_VELOCITY = 256u;
00082 /** FLAG_HAS_Z_AS_ORI constant */
00083 const uint32_t ObjectPositionInterface::FLAG_HAS_Z_AS_ORI = 512u;
00084 /** FLAG_IS_FIXED_OBJECT constant */
00085 const uint32_t ObjectPositionInterface::FLAG_IS_FIXED_OBJECT = 1024u;
00086 
00087 /** Constructor */
00088 ObjectPositionInterface::ObjectPositionInterface() : Interface()
00089 {
00090   data_size = sizeof(ObjectPositionInterface_data_t);
00091   data_ptr  = malloc(data_size);
00092   data      = (ObjectPositionInterface_data_t *)data_ptr;
00093   data_ts   = (interface_data_ts_t *)data_ptr;
00094   memset(data_ptr, 0, data_size);
00095   add_fieldinfo(IFT_UINT32, "object_type", 1, &data->object_type);
00096   add_fieldinfo(IFT_UINT32, "flags", 1, &data->flags);
00097   add_fieldinfo(IFT_BOOL, "visible", 1, &data->visible);
00098   add_fieldinfo(IFT_BOOL, "valid", 1, &data->valid);
00099   add_fieldinfo(IFT_INT32, "visibility_history", 1, &data->visibility_history);
00100   add_fieldinfo(IFT_FLOAT, "roll", 1, &data->roll);
00101   add_fieldinfo(IFT_FLOAT, "pitch", 1, &data->pitch);
00102   add_fieldinfo(IFT_FLOAT, "yaw", 1, &data->yaw);
00103   add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
00104   add_fieldinfo(IFT_FLOAT, "bearing", 1, &data->bearing);
00105   add_fieldinfo(IFT_FLOAT, "slope", 1, &data->slope);
00106   add_fieldinfo(IFT_FLOAT, "dbs_covariance", 9, &data->dbs_covariance);
00107   add_fieldinfo(IFT_FLOAT, "world_x", 1, &data->world_x);
00108   add_fieldinfo(IFT_FLOAT, "world_y", 1, &data->world_y);
00109   add_fieldinfo(IFT_FLOAT, "world_z", 1, &data->world_z);
00110   add_fieldinfo(IFT_FLOAT, "world_xyz_covariance", 9, &data->world_xyz_covariance);
00111   add_fieldinfo(IFT_FLOAT, "relative_x", 1, &data->relative_x);
00112   add_fieldinfo(IFT_FLOAT, "relative_y", 1, &data->relative_y);
00113   add_fieldinfo(IFT_FLOAT, "relative_z", 1, &data->relative_z);
00114   add_fieldinfo(IFT_FLOAT, "relative_xyz_covariance", 9, &data->relative_xyz_covariance);
00115   add_fieldinfo(IFT_FLOAT, "extent_x", 1, &data->extent_x);
00116   add_fieldinfo(IFT_FLOAT, "extent_y", 1, &data->extent_y);
00117   add_fieldinfo(IFT_FLOAT, "extent_z", 1, &data->extent_z);
00118   add_fieldinfo(IFT_FLOAT, "world_x_velocity", 1, &data->world_x_velocity);
00119   add_fieldinfo(IFT_FLOAT, "world_y_velocity", 1, &data->world_y_velocity);
00120   add_fieldinfo(IFT_FLOAT, "world_z_velocity", 1, &data->world_z_velocity);
00121   add_fieldinfo(IFT_FLOAT, "world_xyz_velocity_covariance", 9, &data->world_xyz_velocity_covariance);
00122   add_fieldinfo(IFT_FLOAT, "relative_x_velocity", 1, &data->relative_x_velocity);
00123   add_fieldinfo(IFT_FLOAT, "relative_y_velocity", 1, &data->relative_y_velocity);
00124   add_fieldinfo(IFT_FLOAT, "relative_z_velocity", 1, &data->relative_z_velocity);
00125   add_fieldinfo(IFT_FLOAT, "relative_xyz_velocity_covariance", 9, &data->relative_xyz_velocity_covariance);
00126   unsigned char tmp_hash[] = {0x9f, 0x72, 0x61, 0x39, 0x9a, 0xb4, 0x79, 0x4c, 0x33, 0x3, 0x3a, 0x75, 0xfc, 0xf0, 0xe5, 0x7e};
00127   set_hash(tmp_hash);
00128 }
00129 
00130 /** Destructor */
00131 ObjectPositionInterface::~ObjectPositionInterface()
00132 {
00133   free(data_ptr);
00134 }
00135 /* Methods */
00136 /** Get object_type value.
00137  * 
00138       Object type, use constants to define
00139     
00140  * @return object_type value
00141  */
00142 uint32_t
00143 ObjectPositionInterface::object_type() const
00144 {
00145   return data->object_type;
00146 }
00147 
00148 /** Get maximum length of object_type value.
00149  * @return length of object_type value, can be length of the array or number of 
00150  * maximum number of characters for a string
00151  */
00152 size_t
00153 ObjectPositionInterface::maxlenof_object_type() const
00154 {
00155   return 1;
00156 }
00157 
00158 /** Set object_type value.
00159  * 
00160       Object type, use constants to define
00161     
00162  * @param new_object_type new object_type value
00163  */
00164 void
00165 ObjectPositionInterface::set_object_type(const uint32_t new_object_type)
00166 {
00167   data->object_type = new_object_type;
00168   data_changed = true;
00169 }
00170 
00171 /** Get flags value.
00172  * 
00173       Bit-wise concatenated fields of FLAG_* constants. Denotes features that the
00174       writer of this interfaces provides. Use a bit-wise OR to concatenate multiple
00175       flags, use a bit-wise AND to check if a flag has been set.
00176     
00177  * @return flags value
00178  */
00179 uint32_t
00180 ObjectPositionInterface::flags() const
00181 {
00182   return data->flags;
00183 }
00184 
00185 /** Get maximum length of flags value.
00186  * @return length of flags value, can be length of the array or number of 
00187  * maximum number of characters for a string
00188  */
00189 size_t
00190 ObjectPositionInterface::maxlenof_flags() const
00191 {
00192   return 1;
00193 }
00194 
00195 /** Set flags value.
00196  * 
00197       Bit-wise concatenated fields of FLAG_* constants. Denotes features that the
00198       writer of this interfaces provides. Use a bit-wise OR to concatenate multiple
00199       flags, use a bit-wise AND to check if a flag has been set.
00200     
00201  * @param new_flags new flags value
00202  */
00203 void
00204 ObjectPositionInterface::set_flags(const uint32_t new_flags)
00205 {
00206   data->flags = new_flags;
00207   data_changed = true;
00208 }
00209 
00210 /** Get visible value.
00211  * True, if object is visible.
00212  * @return visible value
00213  */
00214 bool
00215 ObjectPositionInterface::is_visible() const
00216 {
00217   return data->visible;
00218 }
00219 
00220 /** Get maximum length of visible value.
00221  * @return length of visible value, can be length of the array or number of 
00222  * maximum number of characters for a string
00223  */
00224 size_t
00225 ObjectPositionInterface::maxlenof_visible() const
00226 {
00227   return 1;
00228 }
00229 
00230 /** Set visible value.
00231  * True, if object is visible.
00232  * @param new_visible new visible value
00233  */
00234 void
00235 ObjectPositionInterface::set_visible(const bool new_visible)
00236 {
00237   data->visible = new_visible;
00238   data_changed = true;
00239 }
00240 
00241 /** Get valid value.
00242  * True, if this position is valid.
00243  * @return valid value
00244  */
00245 bool
00246 ObjectPositionInterface::is_valid() const
00247 {
00248   return data->valid;
00249 }
00250 
00251 /** Get maximum length of valid value.
00252  * @return length of valid value, can be length of the array or number of 
00253  * maximum number of characters for a string
00254  */
00255 size_t
00256 ObjectPositionInterface::maxlenof_valid() const
00257 {
00258   return 1;
00259 }
00260 
00261 /** Set valid value.
00262  * True, if this position is valid.
00263  * @param new_valid new valid value
00264  */
00265 void
00266 ObjectPositionInterface::set_valid(const bool new_valid)
00267 {
00268   data->valid = new_valid;
00269   data_changed = true;
00270 }
00271 
00272 /** Get visibility_history value.
00273  * 
00274       The visibilitiy history indicates the number of consecutive positive or negative
00275       sightings. If the history is negative, there have been as many negative sightings
00276       (object not visible) as the absolute value of the history. A positive value denotes
00277       as many positive sightings. 0 shall only be used during the initialisation of the
00278       interface or if the visibility history is not filled.
00279     
00280  * @return visibility_history value
00281  */
00282 int32_t
00283 ObjectPositionInterface::visibility_history() const
00284 {
00285   return data->visibility_history;
00286 }
00287 
00288 /** Get maximum length of visibility_history value.
00289  * @return length of visibility_history value, can be length of the array or number of 
00290  * maximum number of characters for a string
00291  */
00292 size_t
00293 ObjectPositionInterface::maxlenof_visibility_history() const
00294 {
00295   return 1;
00296 }
00297 
00298 /** Set visibility_history value.
00299  * 
00300       The visibilitiy history indicates the number of consecutive positive or negative
00301       sightings. If the history is negative, there have been as many negative sightings
00302       (object not visible) as the absolute value of the history. A positive value denotes
00303       as many positive sightings. 0 shall only be used during the initialisation of the
00304       interface or if the visibility history is not filled.
00305     
00306  * @param new_visibility_history new visibility_history value
00307  */
00308 void
00309 ObjectPositionInterface::set_visibility_history(const int32_t new_visibility_history)
00310 {
00311   data->visibility_history = new_visibility_history;
00312   data_changed = true;
00313 }
00314 
00315 /** Get roll value.
00316  * 
00317       Roll value for the orientation of the object in space.
00318     
00319  * @return roll value
00320  */
00321 float
00322 ObjectPositionInterface::roll() const
00323 {
00324   return data->roll;
00325 }
00326 
00327 /** Get maximum length of roll value.
00328  * @return length of roll value, can be length of the array or number of 
00329  * maximum number of characters for a string
00330  */
00331 size_t
00332 ObjectPositionInterface::maxlenof_roll() const
00333 {
00334   return 1;
00335 }
00336 
00337 /** Set roll value.
00338  * 
00339       Roll value for the orientation of the object in space.
00340     
00341  * @param new_roll new roll value
00342  */
00343 void
00344 ObjectPositionInterface::set_roll(const float new_roll)
00345 {
00346   data->roll = new_roll;
00347   data_changed = true;
00348 }
00349 
00350 /** Get pitch value.
00351  * 
00352       Pitch value for the orientation of the object in space.
00353     
00354  * @return pitch value
00355  */
00356 float
00357 ObjectPositionInterface::pitch() const
00358 {
00359   return data->pitch;
00360 }
00361 
00362 /** Get maximum length of pitch value.
00363  * @return length of pitch value, can be length of the array or number of 
00364  * maximum number of characters for a string
00365  */
00366 size_t
00367 ObjectPositionInterface::maxlenof_pitch() const
00368 {
00369   return 1;
00370 }
00371 
00372 /** Set pitch value.
00373  * 
00374       Pitch value for the orientation of the object in space.
00375     
00376  * @param new_pitch new pitch value
00377  */
00378 void
00379 ObjectPositionInterface::set_pitch(const float new_pitch)
00380 {
00381   data->pitch = new_pitch;
00382   data_changed = true;
00383 }
00384 
00385 /** Get yaw value.
00386  * 
00387       Yaw value for the orientation of the object in space.
00388     
00389  * @return yaw value
00390  */
00391 float
00392 ObjectPositionInterface::yaw() const
00393 {
00394   return data->yaw;
00395 }
00396 
00397 /** Get maximum length of yaw value.
00398  * @return length of yaw value, can be length of the array or number of 
00399  * maximum number of characters for a string
00400  */
00401 size_t
00402 ObjectPositionInterface::maxlenof_yaw() const
00403 {
00404   return 1;
00405 }
00406 
00407 /** Set yaw value.
00408  * 
00409       Yaw value for the orientation of the object in space.
00410     
00411  * @param new_yaw new yaw value
00412  */
00413 void
00414 ObjectPositionInterface::set_yaw(const float new_yaw)
00415 {
00416   data->yaw = new_yaw;
00417   data_changed = true;
00418 }
00419 
00420 /** Get distance value.
00421  * 
00422       Distance from the robot to the object on the ground plane. The distance is given
00423       in meters.
00424     
00425  * @return distance value
00426  */
00427 float
00428 ObjectPositionInterface::distance() const
00429 {
00430   return data->distance;
00431 }
00432 
00433 /** Get maximum length of distance value.
00434  * @return length of distance value, can be length of the array or number of 
00435  * maximum number of characters for a string
00436  */
00437 size_t
00438 ObjectPositionInterface::maxlenof_distance() const
00439 {
00440   return 1;
00441 }
00442 
00443 /** Set distance value.
00444  * 
00445       Distance from the robot to the object on the ground plane. The distance is given
00446       in meters.
00447     
00448  * @param new_distance new distance value
00449  */
00450 void
00451 ObjectPositionInterface::set_distance(const float new_distance)
00452 {
00453   data->distance = new_distance;
00454   data_changed = true;
00455 }
00456 
00457 /** Get bearing value.
00458  * 
00459       Angle between the robot's forward direction and the object on the ground plane.
00460       This angle is in a local 3D coordinate system to the robot and given in radians.
00461     
00462  * @return bearing value
00463  */
00464 float
00465 ObjectPositionInterface::bearing() const
00466 {
00467   return data->bearing;
00468 }
00469 
00470 /** Get maximum length of bearing value.
00471  * @return length of bearing value, can be length of the array or number of 
00472  * maximum number of characters for a string
00473  */
00474 size_t
00475 ObjectPositionInterface::maxlenof_bearing() const
00476 {
00477   return 1;
00478 }
00479 
00480 /** Set bearing value.
00481  * 
00482       Angle between the robot's forward direction and the object on the ground plane.
00483       This angle is in a local 3D coordinate system to the robot and given in radians.
00484     
00485  * @param new_bearing new bearing value
00486  */
00487 void
00488 ObjectPositionInterface::set_bearing(const float new_bearing)
00489 {
00490   data->bearing = new_bearing;
00491   data_changed = true;
00492 }
00493 
00494 /** Get slope value.
00495  * 
00496       Angle between the robot's center position on the ground plane and the middle point
00497       of the object (e.g. this denotes the height of the object combined with the distance.
00498       The angle is given in radians.
00499     
00500  * @return slope value
00501  */
00502 float
00503 ObjectPositionInterface::slope() const
00504 {
00505   return data->slope;
00506 }
00507 
00508 /** Get maximum length of slope value.
00509  * @return length of slope value, can be length of the array or number of 
00510  * maximum number of characters for a string
00511  */
00512 size_t
00513 ObjectPositionInterface::maxlenof_slope() const
00514 {
00515   return 1;
00516 }
00517 
00518 /** Set slope value.
00519  * 
00520       Angle between the robot's center position on the ground plane and the middle point
00521       of the object (e.g. this denotes the height of the object combined with the distance.
00522       The angle is given in radians.
00523     
00524  * @param new_slope new slope value
00525  */
00526 void
00527 ObjectPositionInterface::set_slope(const float new_slope)
00528 {
00529   data->slope = new_slope;
00530   data_changed = true;
00531 }
00532 
00533 /** Get dbs_covariance value.
00534  * 
00535       Covariance of Distance/Yaw/Pitch values. This is a 3x3 matrix ordered line by line,
00536       first three values represent row, next tree values second row and last three values
00537       last row from left to right each.
00538     
00539  * @return dbs_covariance value
00540  */
00541 float *
00542 ObjectPositionInterface::dbs_covariance() const
00543 {
00544   return data->dbs_covariance;
00545 }
00546 
00547 /** Get dbs_covariance value at given index.
00548  * 
00549       Covariance of Distance/Yaw/Pitch values. This is a 3x3 matrix ordered line by line,
00550       first three values represent row, next tree values second row and last three values
00551       last row from left to right each.
00552     
00553  * @param index index of value
00554  * @return dbs_covariance value
00555  * @exception Exception thrown if index is out of bounds
00556  */
00557 float
00558 ObjectPositionInterface::dbs_covariance(unsigned int index) const
00559 {
00560   if (index > 9) {
00561     throw Exception("Index value %u out of bounds (0..9)", index);
00562   }
00563   return data->dbs_covariance[index];
00564 }
00565 
00566 /** Get maximum length of dbs_covariance value.
00567  * @return length of dbs_covariance value, can be length of the array or number of 
00568  * maximum number of characters for a string
00569  */
00570 size_t
00571 ObjectPositionInterface::maxlenof_dbs_covariance() const
00572 {
00573   return 9;
00574 }
00575 
00576 /** Set dbs_covariance value.
00577  * 
00578       Covariance of Distance/Yaw/Pitch values. This is a 3x3 matrix ordered line by line,
00579       first three values represent row, next tree values second row and last three values
00580       last row from left to right each.
00581     
00582  * @param new_dbs_covariance new dbs_covariance value
00583  */
00584 void
00585 ObjectPositionInterface::set_dbs_covariance(const float * new_dbs_covariance)
00586 {
00587   memcpy(data->dbs_covariance, new_dbs_covariance, sizeof(float) * 9);
00588   data_changed = true;
00589 }
00590 
00591 /** Set dbs_covariance value at given index.
00592  * 
00593       Covariance of Distance/Yaw/Pitch values. This is a 3x3 matrix ordered line by line,
00594       first three values represent row, next tree values second row and last three values
00595       last row from left to right each.
00596     
00597  * @param new_dbs_covariance new dbs_covariance value
00598  * @param index index for of the value
00599  */
00600 void
00601 ObjectPositionInterface::set_dbs_covariance(unsigned int index, const float new_dbs_covariance)
00602 {
00603   if (index > 9) {
00604     throw Exception("Index value %u out of bounds (0..9)", index);
00605   }
00606   data->dbs_covariance[index] = new_dbs_covariance;
00607   data_changed = true;
00608 }
00609 /** Get world_x value.
00610  * 
00611       This is the X coordinate in the cartesian right-handed world coordinate system.
00612       This coordinate system has its origin in the center of the field, Y pointing to
00613       the opponent's goal and X pointing to the right.
00614     
00615  * @return world_x value
00616  */
00617 float
00618 ObjectPositionInterface::world_x() const
00619 {
00620   return data->world_x;
00621 }
00622 
00623 /** Get maximum length of world_x value.
00624  * @return length of world_x value, can be length of the array or number of 
00625  * maximum number of characters for a string
00626  */
00627 size_t
00628 ObjectPositionInterface::maxlenof_world_x() const
00629 {
00630   return 1;
00631 }
00632 
00633 /** Set world_x value.
00634  * 
00635       This is the X coordinate in the cartesian right-handed world coordinate system.
00636       This coordinate system has its origin in the center of the field, Y pointing to
00637       the opponent's goal and X pointing to the right.
00638     
00639  * @param new_world_x new world_x value
00640  */
00641 void
00642 ObjectPositionInterface::set_world_x(const float new_world_x)
00643 {
00644   data->world_x = new_world_x;
00645   data_changed = true;
00646 }
00647 
00648 /** Get world_y value.
00649  * 
00650       This is the Y coordinate in the cartesian right-handed world coordinate system.
00651       This coordinate system has its origin in the center of the field, Y pointing to
00652       the opponent's goal and X pointing to the right and Z pointing downwards.
00653     
00654  * @return world_y value
00655  */
00656 float
00657 ObjectPositionInterface::world_y() const
00658 {
00659   return data->world_y;
00660 }
00661 
00662 /** Get maximum length of world_y value.
00663  * @return length of world_y value, can be length of the array or number of 
00664  * maximum number of characters for a string
00665  */
00666 size_t
00667 ObjectPositionInterface::maxlenof_world_y() const
00668 {
00669   return 1;
00670 }
00671 
00672 /** Set world_y value.
00673  * 
00674       This is the Y coordinate in the cartesian right-handed world coordinate system.
00675       This coordinate system has its origin in the center of the field, Y pointing to
00676       the opponent's goal and X pointing to the right and Z pointing downwards.
00677     
00678  * @param new_world_y new world_y value
00679  */
00680 void
00681 ObjectPositionInterface::set_world_y(const float new_world_y)
00682 {
00683   data->world_y = new_world_y;
00684   data_changed = true;
00685 }
00686 
00687 /** Get world_z value.
00688  * 
00689       This is the Z coordinate in the cartesian right-handed world coordinate system.
00690       This coordinate system has its origin in the center of the field, Y pointing to
00691       the opponent's goal and X pointing to the right.
00692     
00693  * @return world_z value
00694  */
00695 float
00696 ObjectPositionInterface::world_z() const
00697 {
00698   return data->world_z;
00699 }
00700 
00701 /** Get maximum length of world_z value.
00702  * @return length of world_z value, can be length of the array or number of 
00703  * maximum number of characters for a string
00704  */
00705 size_t
00706 ObjectPositionInterface::maxlenof_world_z() const
00707 {
00708   return 1;
00709 }
00710 
00711 /** Set world_z value.
00712  * 
00713       This is the Z coordinate in the cartesian right-handed world coordinate system.
00714       This coordinate system has its origin in the center of the field, Y pointing to
00715       the opponent's goal and X pointing to the right.
00716     
00717  * @param new_world_z new world_z value
00718  */
00719 void
00720 ObjectPositionInterface::set_world_z(const float new_world_z)
00721 {
00722   data->world_z = new_world_z;
00723   data_changed = true;
00724 }
00725 
00726 /** Get world_xyz_covariance value.
00727  * 
00728       Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line,
00729       first three values represent row, next tree values second row and last three values
00730       last row from left to right each.
00731     
00732  * @return world_xyz_covariance value
00733  */
00734 float *
00735 ObjectPositionInterface::world_xyz_covariance() const
00736 {
00737   return data->world_xyz_covariance;
00738 }
00739 
00740 /** Get world_xyz_covariance value at given index.
00741  * 
00742       Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line,
00743       first three values represent row, next tree values second row and last three values
00744       last row from left to right each.
00745     
00746  * @param index index of value
00747  * @return world_xyz_covariance value
00748  * @exception Exception thrown if index is out of bounds
00749  */
00750 float
00751 ObjectPositionInterface::world_xyz_covariance(unsigned int index) const
00752 {
00753   if (index > 9) {
00754     throw Exception("Index value %u out of bounds (0..9)", index);
00755   }
00756   return data->world_xyz_covariance[index];
00757 }
00758 
00759 /** Get maximum length of world_xyz_covariance value.
00760  * @return length of world_xyz_covariance value, can be length of the array or number of 
00761  * maximum number of characters for a string
00762  */
00763 size_t
00764 ObjectPositionInterface::maxlenof_world_xyz_covariance() const
00765 {
00766   return 9;
00767 }
00768 
00769 /** Set world_xyz_covariance value.
00770  * 
00771       Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line,
00772       first three values represent row, next tree values second row and last three values
00773       last row from left to right each.
00774     
00775  * @param new_world_xyz_covariance new world_xyz_covariance value
00776  */
00777 void
00778 ObjectPositionInterface::set_world_xyz_covariance(const float * new_world_xyz_covariance)
00779 {
00780   memcpy(data->world_xyz_covariance, new_world_xyz_covariance, sizeof(float) * 9);
00781   data_changed = true;
00782 }
00783 
00784 /** Set world_xyz_covariance value at given index.
00785  * 
00786       Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line,
00787       first three values represent row, next tree values second row and last three values
00788       last row from left to right each.
00789     
00790  * @param new_world_xyz_covariance new world_xyz_covariance value
00791  * @param index index for of the value
00792  */
00793 void
00794 ObjectPositionInterface::set_world_xyz_covariance(unsigned int index, const float new_world_xyz_covariance)
00795 {
00796   if (index > 9) {
00797     throw Exception("Index value %u out of bounds (0..9)", index);
00798   }
00799   data->world_xyz_covariance[index] = new_world_xyz_covariance;
00800   data_changed = true;
00801 }
00802 /** Get relative_x value.
00803  * 
00804       This is the X coordinate in the cartesian right-handed robot coordinate system.
00805     
00806  * @return relative_x value
00807  */
00808 float
00809 ObjectPositionInterface::relative_x() const
00810 {
00811   return data->relative_x;
00812 }
00813 
00814 /** Get maximum length of relative_x value.
00815  * @return length of relative_x value, can be length of the array or number of 
00816  * maximum number of characters for a string
00817  */
00818 size_t
00819 ObjectPositionInterface::maxlenof_relative_x() const
00820 {
00821   return 1;
00822 }
00823 
00824 /** Set relative_x value.
00825  * 
00826       This is the X coordinate in the cartesian right-handed robot coordinate system.
00827     
00828  * @param new_relative_x new relative_x value
00829  */
00830 void
00831 ObjectPositionInterface::set_relative_x(const float new_relative_x)
00832 {
00833   data->relative_x = new_relative_x;
00834   data_changed = true;
00835 }
00836 
00837 /** Get relative_y value.
00838  * 
00839       This is the Y coordinate in the cartesian right-handed robot coordinate system.
00840     
00841  * @return relative_y value
00842  */
00843 float
00844 ObjectPositionInterface::relative_y() const
00845 {
00846   return data->relative_y;
00847 }
00848 
00849 /** Get maximum length of relative_y value.
00850  * @return length of relative_y value, can be length of the array or number of 
00851  * maximum number of characters for a string
00852  */
00853 size_t
00854 ObjectPositionInterface::maxlenof_relative_y() const
00855 {
00856   return 1;
00857 }
00858 
00859 /** Set relative_y value.
00860  * 
00861       This is the Y coordinate in the cartesian right-handed robot coordinate system.
00862     
00863  * @param new_relative_y new relative_y value
00864  */
00865 void
00866 ObjectPositionInterface::set_relative_y(const float new_relative_y)
00867 {
00868   data->relative_y = new_relative_y;
00869   data_changed = true;
00870 }
00871 
00872 /** Get relative_z value.
00873  * 
00874       This is the Z coordinate in the cartesian right-handed robot coordinate system.
00875     
00876  * @return relative_z value
00877  */
00878 float
00879 ObjectPositionInterface::relative_z() const
00880 {
00881   return data->relative_z;
00882 }
00883 
00884 /** Get maximum length of relative_z value.
00885  * @return length of relative_z value, can be length of the array or number of 
00886  * maximum number of characters for a string
00887  */
00888 size_t
00889 ObjectPositionInterface::maxlenof_relative_z() const
00890 {
00891   return 1;
00892 }
00893 
00894 /** Set relative_z value.
00895  * 
00896       This is the Z coordinate in the cartesian right-handed robot coordinate system.
00897     
00898  * @param new_relative_z new relative_z value
00899  */
00900 void
00901 ObjectPositionInterface::set_relative_z(const float new_relative_z)
00902 {
00903   data->relative_z = new_relative_z;
00904   data_changed = true;
00905 }
00906 
00907 /** Get relative_xyz_covariance value.
00908  * 
00909       Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line,
00910       first three values represent row, next tree values second row and last three values
00911       last row from left to right each.
00912     
00913  * @return relative_xyz_covariance value
00914  */
00915 float *
00916 ObjectPositionInterface::relative_xyz_covariance() const
00917 {
00918   return data->relative_xyz_covariance;
00919 }
00920 
00921 /** Get relative_xyz_covariance value at given index.
00922  * 
00923       Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line,
00924       first three values represent row, next tree values second row and last three values
00925       last row from left to right each.
00926     
00927  * @param index index of value
00928  * @return relative_xyz_covariance value
00929  * @exception Exception thrown if index is out of bounds
00930  */
00931 float
00932 ObjectPositionInterface::relative_xyz_covariance(unsigned int index) const
00933 {
00934   if (index > 9) {
00935     throw Exception("Index value %u out of bounds (0..9)", index);
00936   }
00937   return data->relative_xyz_covariance[index];
00938 }
00939 
00940 /** Get maximum length of relative_xyz_covariance value.
00941  * @return length of relative_xyz_covariance value, can be length of the array or number of 
00942  * maximum number of characters for a string
00943  */
00944 size_t
00945 ObjectPositionInterface::maxlenof_relative_xyz_covariance() const
00946 {
00947   return 9;
00948 }
00949 
00950 /** Set relative_xyz_covariance value.
00951  * 
00952       Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line,
00953       first three values represent row, next tree values second row and last three values
00954       last row from left to right each.
00955     
00956  * @param new_relative_xyz_covariance new relative_xyz_covariance value
00957  */
00958 void
00959 ObjectPositionInterface::set_relative_xyz_covariance(const float * new_relative_xyz_covariance)
00960 {
00961   memcpy(data->relative_xyz_covariance, new_relative_xyz_covariance, sizeof(float) * 9);
00962   data_changed = true;
00963 }
00964 
00965 /** Set relative_xyz_covariance value at given index.
00966  * 
00967       Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line,
00968       first three values represent row, next tree values second row and last three values
00969       last row from left to right each.
00970     
00971  * @param new_relative_xyz_covariance new relative_xyz_covariance value
00972  * @param index index for of the value
00973  */
00974 void
00975 ObjectPositionInterface::set_relative_xyz_covariance(unsigned int index, const float new_relative_xyz_covariance)
00976 {
00977   if (index > 9) {
00978     throw Exception("Index value %u out of bounds (0..9)", index);
00979   }
00980   data->relative_xyz_covariance[index] = new_relative_xyz_covariance;
00981   data_changed = true;
00982 }
00983 /** Get extent_x value.
00984  * 
00985       Extent of the seen object given in the relative x cartesian coordinate in m.
00986     
00987  * @return extent_x value
00988  */
00989 float
00990 ObjectPositionInterface::extent_x() const
00991 {
00992   return data->extent_x;
00993 }
00994 
00995 /** Get maximum length of extent_x value.
00996  * @return length of extent_x value, can be length of the array or number of 
00997  * maximum number of characters for a string
00998  */
00999 size_t
01000 ObjectPositionInterface::maxlenof_extent_x() const
01001 {
01002   return 1;
01003 }
01004 
01005 /** Set extent_x value.
01006  * 
01007       Extent of the seen object given in the relative x cartesian coordinate in m.
01008     
01009  * @param new_extent_x new extent_x value
01010  */
01011 void
01012 ObjectPositionInterface::set_extent_x(const float new_extent_x)
01013 {
01014   data->extent_x = new_extent_x;
01015   data_changed = true;
01016 }
01017 
01018 /** Get extent_y value.
01019  * 
01020       Extent of the seen object given in the relative y cartesian coordinate in m.
01021     
01022  * @return extent_y value
01023  */
01024 float
01025 ObjectPositionInterface::extent_y() const
01026 {
01027   return data->extent_y;
01028 }
01029 
01030 /** Get maximum length of extent_y value.
01031  * @return length of extent_y value, can be length of the array or number of 
01032  * maximum number of characters for a string
01033  */
01034 size_t
01035 ObjectPositionInterface::maxlenof_extent_y() const
01036 {
01037   return 1;
01038 }
01039 
01040 /** Set extent_y value.
01041  * 
01042       Extent of the seen object given in the relative y cartesian coordinate in m.
01043     
01044  * @param new_extent_y new extent_y value
01045  */
01046 void
01047 ObjectPositionInterface::set_extent_y(const float new_extent_y)
01048 {
01049   data->extent_y = new_extent_y;
01050   data_changed = true;
01051 }
01052 
01053 /** Get extent_z value.
01054  * 
01055       Extent of the seen object given in the relative z cartesian coordinate in m.
01056     
01057  * @return extent_z value
01058  */
01059 float
01060 ObjectPositionInterface::extent_z() const
01061 {
01062   return data->extent_z;
01063 }
01064 
01065 /** Get maximum length of extent_z value.
01066  * @return length of extent_z value, can be length of the array or number of 
01067  * maximum number of characters for a string
01068  */
01069 size_t
01070 ObjectPositionInterface::maxlenof_extent_z() const
01071 {
01072   return 1;
01073 }
01074 
01075 /** Set extent_z value.
01076  * 
01077       Extent of the seen object given in the relative z cartesian coordinate in m.
01078     
01079  * @param new_extent_z new extent_z value
01080  */
01081 void
01082 ObjectPositionInterface::set_extent_z(const float new_extent_z)
01083 {
01084   data->extent_z = new_extent_z;
01085   data_changed = true;
01086 }
01087 
01088 /** Get world_x_velocity value.
01089  * 
01090       Velocity of object in the world coordinate system in X-direction in meter per second.
01091     
01092  * @return world_x_velocity value
01093  */
01094 float
01095 ObjectPositionInterface::world_x_velocity() const
01096 {
01097   return data->world_x_velocity;
01098 }
01099 
01100 /** Get maximum length of world_x_velocity value.
01101  * @return length of world_x_velocity value, can be length of the array or number of 
01102  * maximum number of characters for a string
01103  */
01104 size_t
01105 ObjectPositionInterface::maxlenof_world_x_velocity() const
01106 {
01107   return 1;
01108 }
01109 
01110 /** Set world_x_velocity value.
01111  * 
01112       Velocity of object in the world coordinate system in X-direction in meter per second.
01113     
01114  * @param new_world_x_velocity new world_x_velocity value
01115  */
01116 void
01117 ObjectPositionInterface::set_world_x_velocity(const float new_world_x_velocity)
01118 {
01119   data->world_x_velocity = new_world_x_velocity;
01120   data_changed = true;
01121 }
01122 
01123 /** Get world_y_velocity value.
01124  * 
01125       Velocity of object in the world coordinate system in Y-direction in meter per second.
01126     
01127  * @return world_y_velocity value
01128  */
01129 float
01130 ObjectPositionInterface::world_y_velocity() const
01131 {
01132   return data->world_y_velocity;
01133 }
01134 
01135 /** Get maximum length of world_y_velocity value.
01136  * @return length of world_y_velocity value, can be length of the array or number of 
01137  * maximum number of characters for a string
01138  */
01139 size_t
01140 ObjectPositionInterface::maxlenof_world_y_velocity() const
01141 {
01142   return 1;
01143 }
01144 
01145 /** Set world_y_velocity value.
01146  * 
01147       Velocity of object in the world coordinate system in Y-direction in meter per second.
01148     
01149  * @param new_world_y_velocity new world_y_velocity value
01150  */
01151 void
01152 ObjectPositionInterface::set_world_y_velocity(const float new_world_y_velocity)
01153 {
01154   data->world_y_velocity = new_world_y_velocity;
01155   data_changed = true;
01156 }
01157 
01158 /** Get world_z_velocity value.
01159  * 
01160       Velocity of object in the world coordinate system in Z-direction in meter per second.
01161     
01162  * @return world_z_velocity value
01163  */
01164 float
01165 ObjectPositionInterface::world_z_velocity() const
01166 {
01167   return data->world_z_velocity;
01168 }
01169 
01170 /** Get maximum length of world_z_velocity value.
01171  * @return length of world_z_velocity value, can be length of the array or number of 
01172  * maximum number of characters for a string
01173  */
01174 size_t
01175 ObjectPositionInterface::maxlenof_world_z_velocity() const
01176 {
01177   return 1;
01178 }
01179 
01180 /** Set world_z_velocity value.
01181  * 
01182       Velocity of object in the world coordinate system in Z-direction in meter per second.
01183     
01184  * @param new_world_z_velocity new world_z_velocity value
01185  */
01186 void
01187 ObjectPositionInterface::set_world_z_velocity(const float new_world_z_velocity)
01188 {
01189   data->world_z_velocity = new_world_z_velocity;
01190   data_changed = true;
01191 }
01192 
01193 /** Get world_xyz_velocity_covariance value.
01194  * 
01195       Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line
01196       by line, first three values represent row, next tree values second row and last three
01197       values last row from left to right each.
01198     
01199  * @return world_xyz_velocity_covariance value
01200  */
01201 float *
01202 ObjectPositionInterface::world_xyz_velocity_covariance() const
01203 {
01204   return data->world_xyz_velocity_covariance;
01205 }
01206 
01207 /** Get world_xyz_velocity_covariance value at given index.
01208  * 
01209       Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line
01210       by line, first three values represent row, next tree values second row and last three
01211       values last row from left to right each.
01212     
01213  * @param index index of value
01214  * @return world_xyz_velocity_covariance value
01215  * @exception Exception thrown if index is out of bounds
01216  */
01217 float
01218 ObjectPositionInterface::world_xyz_velocity_covariance(unsigned int index) const
01219 {
01220   if (index > 9) {
01221     throw Exception("Index value %u out of bounds (0..9)", index);
01222   }
01223   return data->world_xyz_velocity_covariance[index];
01224 }
01225 
01226 /** Get maximum length of world_xyz_velocity_covariance value.
01227  * @return length of world_xyz_velocity_covariance value, can be length of the array or number of 
01228  * maximum number of characters for a string
01229  */
01230 size_t
01231 ObjectPositionInterface::maxlenof_world_xyz_velocity_covariance() const
01232 {
01233   return 9;
01234 }
01235 
01236 /** Set world_xyz_velocity_covariance value.
01237  * 
01238       Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line
01239       by line, first three values represent row, next tree values second row and last three
01240       values last row from left to right each.
01241     
01242  * @param new_world_xyz_velocity_covariance new world_xyz_velocity_covariance value
01243  */
01244 void
01245 ObjectPositionInterface::set_world_xyz_velocity_covariance(const float * new_world_xyz_velocity_covariance)
01246 {
01247   memcpy(data->world_xyz_velocity_covariance, new_world_xyz_velocity_covariance, sizeof(float) * 9);
01248   data_changed = true;
01249 }
01250 
01251 /** Set world_xyz_velocity_covariance value at given index.
01252  * 
01253       Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line
01254       by line, first three values represent row, next tree values second row and last three
01255       values last row from left to right each.
01256     
01257  * @param new_world_xyz_velocity_covariance new world_xyz_velocity_covariance value
01258  * @param index index for of the value
01259  */
01260 void
01261 ObjectPositionInterface::set_world_xyz_velocity_covariance(unsigned int index, const float new_world_xyz_velocity_covariance)
01262 {
01263   if (index > 9) {
01264     throw Exception("Index value %u out of bounds (0..9)", index);
01265   }
01266   data->world_xyz_velocity_covariance[index] = new_world_xyz_velocity_covariance;
01267   data_changed = true;
01268 }
01269 /** Get relative_x_velocity value.
01270  * 
01271       Velocity of object in the world coordinate system in X-direction in meter per second.
01272     
01273  * @return relative_x_velocity value
01274  */
01275 float
01276 ObjectPositionInterface::relative_x_velocity() const
01277 {
01278   return data->relative_x_velocity;
01279 }
01280 
01281 /** Get maximum length of relative_x_velocity value.
01282  * @return length of relative_x_velocity value, can be length of the array or number of 
01283  * maximum number of characters for a string
01284  */
01285 size_t
01286 ObjectPositionInterface::maxlenof_relative_x_velocity() const
01287 {
01288   return 1;
01289 }
01290 
01291 /** Set relative_x_velocity value.
01292  * 
01293       Velocity of object in the world coordinate system in X-direction in meter per second.
01294     
01295  * @param new_relative_x_velocity new relative_x_velocity value
01296  */
01297 void
01298 ObjectPositionInterface::set_relative_x_velocity(const float new_relative_x_velocity)
01299 {
01300   data->relative_x_velocity = new_relative_x_velocity;
01301   data_changed = true;
01302 }
01303 
01304 /** Get relative_y_velocity value.
01305  * 
01306       Velocity of object in the world coordinate system in Y-direction in meter per second.
01307     
01308  * @return relative_y_velocity value
01309  */
01310 float
01311 ObjectPositionInterface::relative_y_velocity() const
01312 {
01313   return data->relative_y_velocity;
01314 }
01315 
01316 /** Get maximum length of relative_y_velocity value.
01317  * @return length of relative_y_velocity value, can be length of the array or number of 
01318  * maximum number of characters for a string
01319  */
01320 size_t
01321 ObjectPositionInterface::maxlenof_relative_y_velocity() const
01322 {
01323   return 1;
01324 }
01325 
01326 /** Set relative_y_velocity value.
01327  * 
01328       Velocity of object in the world coordinate system in Y-direction in meter per second.
01329     
01330  * @param new_relative_y_velocity new relative_y_velocity value
01331  */
01332 void
01333 ObjectPositionInterface::set_relative_y_velocity(const float new_relative_y_velocity)
01334 {
01335   data->relative_y_velocity = new_relative_y_velocity;
01336   data_changed = true;
01337 }
01338 
01339 /** Get relative_z_velocity value.
01340  * 
01341       Velocity of object in the world coordinate system in Z-direction in meter per second.
01342     
01343  * @return relative_z_velocity value
01344  */
01345 float
01346 ObjectPositionInterface::relative_z_velocity() const
01347 {
01348   return data->relative_z_velocity;
01349 }
01350 
01351 /** Get maximum length of relative_z_velocity value.
01352  * @return length of relative_z_velocity value, can be length of the array or number of 
01353  * maximum number of characters for a string
01354  */
01355 size_t
01356 ObjectPositionInterface::maxlenof_relative_z_velocity() const
01357 {
01358   return 1;
01359 }
01360 
01361 /** Set relative_z_velocity value.
01362  * 
01363       Velocity of object in the world coordinate system in Z-direction in meter per second.
01364     
01365  * @param new_relative_z_velocity new relative_z_velocity value
01366  */
01367 void
01368 ObjectPositionInterface::set_relative_z_velocity(const float new_relative_z_velocity)
01369 {
01370   data->relative_z_velocity = new_relative_z_velocity;
01371   data_changed = true;
01372 }
01373 
01374 /** Get relative_xyz_velocity_covariance value.
01375  * 
01376       Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line
01377       by line, first three values represent row, next tree values second row and last three
01378       values last row from left to right each.
01379     
01380  * @return relative_xyz_velocity_covariance value
01381  */
01382 float *
01383 ObjectPositionInterface::relative_xyz_velocity_covariance() const
01384 {
01385   return data->relative_xyz_velocity_covariance;
01386 }
01387 
01388 /** Get relative_xyz_velocity_covariance value at given index.
01389  * 
01390       Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line
01391       by line, first three values represent row, next tree values second row and last three
01392       values last row from left to right each.
01393     
01394  * @param index index of value
01395  * @return relative_xyz_velocity_covariance value
01396  * @exception Exception thrown if index is out of bounds
01397  */
01398 float
01399 ObjectPositionInterface::relative_xyz_velocity_covariance(unsigned int index) const
01400 {
01401   if (index > 9) {
01402     throw Exception("Index value %u out of bounds (0..9)", index);
01403   }
01404   return data->relative_xyz_velocity_covariance[index];
01405 }
01406 
01407 /** Get maximum length of relative_xyz_velocity_covariance value.
01408  * @return length of relative_xyz_velocity_covariance value, can be length of the array or number of 
01409  * maximum number of characters for a string
01410  */
01411 size_t
01412 ObjectPositionInterface::maxlenof_relative_xyz_velocity_covariance() const
01413 {
01414   return 9;
01415 }
01416 
01417 /** Set relative_xyz_velocity_covariance value.
01418  * 
01419       Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line
01420       by line, first three values represent row, next tree values second row and last three
01421       values last row from left to right each.
01422     
01423  * @param new_relative_xyz_velocity_covariance new relative_xyz_velocity_covariance value
01424  */
01425 void
01426 ObjectPositionInterface::set_relative_xyz_velocity_covariance(const float * new_relative_xyz_velocity_covariance)
01427 {
01428   memcpy(data->relative_xyz_velocity_covariance, new_relative_xyz_velocity_covariance, sizeof(float) * 9);
01429   data_changed = true;
01430 }
01431 
01432 /** Set relative_xyz_velocity_covariance value at given index.
01433  * 
01434       Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line
01435       by line, first three values represent row, next tree values second row and last three
01436       values last row from left to right each.
01437     
01438  * @param new_relative_xyz_velocity_covariance new relative_xyz_velocity_covariance value
01439  * @param index index for of the value
01440  */
01441 void
01442 ObjectPositionInterface::set_relative_xyz_velocity_covariance(unsigned int index, const float new_relative_xyz_velocity_covariance)
01443 {
01444   if (index > 9) {
01445     throw Exception("Index value %u out of bounds (0..9)", index);
01446   }
01447   data->relative_xyz_velocity_covariance[index] = new_relative_xyz_velocity_covariance;
01448   data_changed = true;
01449 }
01450 /* =========== message create =========== */
01451 Message *
01452 ObjectPositionInterface::create_message(const char *type) const
01453 {
01454   throw UnknownTypeException("The given type '%s' does not match any known "
01455                              "message type for this interface type.", type);
01456 }
01457 
01458 
01459 /** Copy values from other interface.
01460  * @param other other interface to copy values from
01461  */
01462 void
01463 ObjectPositionInterface::copy_values(const Interface *other)
01464 {
01465   const ObjectPositionInterface *oi = dynamic_cast<const ObjectPositionInterface *>(other);
01466   if (oi == NULL) {
01467     throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
01468                                 type(), other->type());
01469   }
01470   memcpy(data, oi->data, sizeof(ObjectPositionInterface_data_t));
01471 }
01472 
01473 const char *
01474 ObjectPositionInterface::enum_tostring(const char *enumtype, int val) const
01475 {
01476   throw UnknownTypeException("Unknown enum type %s", enumtype);
01477 }
01478 
01479 /* =========== messages =========== */
01480 /** Check if message is valid and can be enqueued.
01481  * @param message Message to check
01482  * @return true if the message is valid, false otherwise.
01483  */
01484 bool
01485 ObjectPositionInterface::message_valid(const Message *message) const
01486 {
01487   return false;
01488 }
01489 
01490 /// @cond INTERNALS
01491 EXPORT_INTERFACE(ObjectPositionInterface)
01492 /// @endcond
01493 
01494 
01495 } // end namespace fawkes