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