Fawkes API Fawkes Development Version
|
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 } 00608 /** Get world_x value. 00609 * 00610 This is the X coordinate in the cartesian right-handed world coordinate system. 00611 This coordinate system has its origin in the center of the field, Y pointing to 00612 the opponent's goal and X pointing to the right. 00613 00614 * @return world_x value 00615 */ 00616 float 00617 ObjectPositionInterface::world_x() const 00618 { 00619 return data->world_x; 00620 } 00621 00622 /** Get maximum length of world_x value. 00623 * @return length of world_x value, can be length of the array or number of 00624 * maximum number of characters for a string 00625 */ 00626 size_t 00627 ObjectPositionInterface::maxlenof_world_x() const 00628 { 00629 return 1; 00630 } 00631 00632 /** Set world_x value. 00633 * 00634 This is the X coordinate in the cartesian right-handed world coordinate system. 00635 This coordinate system has its origin in the center of the field, Y pointing to 00636 the opponent's goal and X pointing to the right. 00637 00638 * @param new_world_x new world_x value 00639 */ 00640 void 00641 ObjectPositionInterface::set_world_x(const float new_world_x) 00642 { 00643 data->world_x = new_world_x; 00644 data_changed = true; 00645 } 00646 00647 /** Get world_y value. 00648 * 00649 This is the Y coordinate in the cartesian right-handed world coordinate system. 00650 This coordinate system has its origin in the center of the field, Y pointing to 00651 the opponent's goal and X pointing to the right and Z pointing downwards. 00652 00653 * @return world_y value 00654 */ 00655 float 00656 ObjectPositionInterface::world_y() const 00657 { 00658 return data->world_y; 00659 } 00660 00661 /** Get maximum length of world_y value. 00662 * @return length of world_y value, can be length of the array or number of 00663 * maximum number of characters for a string 00664 */ 00665 size_t 00666 ObjectPositionInterface::maxlenof_world_y() const 00667 { 00668 return 1; 00669 } 00670 00671 /** Set world_y value. 00672 * 00673 This is the Y 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 and Z pointing downwards. 00676 00677 * @param new_world_y new world_y value 00678 */ 00679 void 00680 ObjectPositionInterface::set_world_y(const float new_world_y) 00681 { 00682 data->world_y = new_world_y; 00683 data_changed = true; 00684 } 00685 00686 /** Get world_z value. 00687 * 00688 This is the Z coordinate in the cartesian right-handed world coordinate system. 00689 This coordinate system has its origin in the center of the field, Y pointing to 00690 the opponent's goal and X pointing to the right. 00691 00692 * @return world_z value 00693 */ 00694 float 00695 ObjectPositionInterface::world_z() const 00696 { 00697 return data->world_z; 00698 } 00699 00700 /** Get maximum length of world_z value. 00701 * @return length of world_z value, can be length of the array or number of 00702 * maximum number of characters for a string 00703 */ 00704 size_t 00705 ObjectPositionInterface::maxlenof_world_z() const 00706 { 00707 return 1; 00708 } 00709 00710 /** Set world_z value. 00711 * 00712 This is the Z coordinate in the cartesian right-handed world coordinate system. 00713 This coordinate system has its origin in the center of the field, Y pointing to 00714 the opponent's goal and X pointing to the right. 00715 00716 * @param new_world_z new world_z value 00717 */ 00718 void 00719 ObjectPositionInterface::set_world_z(const float new_world_z) 00720 { 00721 data->world_z = new_world_z; 00722 data_changed = true; 00723 } 00724 00725 /** Get world_xyz_covariance value. 00726 * 00727 Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line, 00728 first three values represent row, next tree values second row and last three values 00729 last row from left to right each. 00730 00731 * @return world_xyz_covariance value 00732 */ 00733 float * 00734 ObjectPositionInterface::world_xyz_covariance() const 00735 { 00736 return data->world_xyz_covariance; 00737 } 00738 00739 /** Get world_xyz_covariance value at given index. 00740 * 00741 Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line, 00742 first three values represent row, next tree values second row and last three values 00743 last row from left to right each. 00744 00745 * @param index index of value 00746 * @return world_xyz_covariance value 00747 * @exception Exception thrown if index is out of bounds 00748 */ 00749 float 00750 ObjectPositionInterface::world_xyz_covariance(unsigned int index) const 00751 { 00752 if (index > 9) { 00753 throw Exception("Index value %u out of bounds (0..9)", index); 00754 } 00755 return data->world_xyz_covariance[index]; 00756 } 00757 00758 /** Get maximum length of world_xyz_covariance value. 00759 * @return length of world_xyz_covariance value, can be length of the array or number of 00760 * maximum number of characters for a string 00761 */ 00762 size_t 00763 ObjectPositionInterface::maxlenof_world_xyz_covariance() const 00764 { 00765 return 9; 00766 } 00767 00768 /** Set world_xyz_covariance value. 00769 * 00770 Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line, 00771 first three values represent row, next tree values second row and last three values 00772 last row from left to right each. 00773 00774 * @param new_world_xyz_covariance new world_xyz_covariance value 00775 */ 00776 void 00777 ObjectPositionInterface::set_world_xyz_covariance(const float * new_world_xyz_covariance) 00778 { 00779 memcpy(data->world_xyz_covariance, new_world_xyz_covariance, sizeof(float) * 9); 00780 data_changed = true; 00781 } 00782 00783 /** Set world_xyz_covariance value at given index. 00784 * 00785 Covariance of WorldX/WorldY/WorldZ values. This is a 3x3 matrix ordered line by line, 00786 first three values represent row, next tree values second row and last three values 00787 last row from left to right each. 00788 00789 * @param new_world_xyz_covariance new world_xyz_covariance value 00790 * @param index index for of the value 00791 */ 00792 void 00793 ObjectPositionInterface::set_world_xyz_covariance(unsigned int index, const float new_world_xyz_covariance) 00794 { 00795 if (index > 9) { 00796 throw Exception("Index value %u out of bounds (0..9)", index); 00797 } 00798 data->world_xyz_covariance[index] = new_world_xyz_covariance; 00799 } 00800 /** Get relative_x value. 00801 * 00802 This is the X coordinate in the cartesian right-handed robot coordinate system. 00803 00804 * @return relative_x value 00805 */ 00806 float 00807 ObjectPositionInterface::relative_x() const 00808 { 00809 return data->relative_x; 00810 } 00811 00812 /** Get maximum length of relative_x value. 00813 * @return length of relative_x value, can be length of the array or number of 00814 * maximum number of characters for a string 00815 */ 00816 size_t 00817 ObjectPositionInterface::maxlenof_relative_x() const 00818 { 00819 return 1; 00820 } 00821 00822 /** Set relative_x value. 00823 * 00824 This is the X coordinate in the cartesian right-handed robot coordinate system. 00825 00826 * @param new_relative_x new relative_x value 00827 */ 00828 void 00829 ObjectPositionInterface::set_relative_x(const float new_relative_x) 00830 { 00831 data->relative_x = new_relative_x; 00832 data_changed = true; 00833 } 00834 00835 /** Get relative_y value. 00836 * 00837 This is the Y coordinate in the cartesian right-handed robot coordinate system. 00838 00839 * @return relative_y value 00840 */ 00841 float 00842 ObjectPositionInterface::relative_y() const 00843 { 00844 return data->relative_y; 00845 } 00846 00847 /** Get maximum length of relative_y value. 00848 * @return length of relative_y value, can be length of the array or number of 00849 * maximum number of characters for a string 00850 */ 00851 size_t 00852 ObjectPositionInterface::maxlenof_relative_y() const 00853 { 00854 return 1; 00855 } 00856 00857 /** Set relative_y value. 00858 * 00859 This is the Y coordinate in the cartesian right-handed robot coordinate system. 00860 00861 * @param new_relative_y new relative_y value 00862 */ 00863 void 00864 ObjectPositionInterface::set_relative_y(const float new_relative_y) 00865 { 00866 data->relative_y = new_relative_y; 00867 data_changed = true; 00868 } 00869 00870 /** Get relative_z value. 00871 * 00872 This is the Z coordinate in the cartesian right-handed robot coordinate system. 00873 00874 * @return relative_z value 00875 */ 00876 float 00877 ObjectPositionInterface::relative_z() const 00878 { 00879 return data->relative_z; 00880 } 00881 00882 /** Get maximum length of relative_z value. 00883 * @return length of relative_z value, can be length of the array or number of 00884 * maximum number of characters for a string 00885 */ 00886 size_t 00887 ObjectPositionInterface::maxlenof_relative_z() const 00888 { 00889 return 1; 00890 } 00891 00892 /** Set relative_z value. 00893 * 00894 This is the Z coordinate in the cartesian right-handed robot coordinate system. 00895 00896 * @param new_relative_z new relative_z value 00897 */ 00898 void 00899 ObjectPositionInterface::set_relative_z(const float new_relative_z) 00900 { 00901 data->relative_z = new_relative_z; 00902 data_changed = true; 00903 } 00904 00905 /** Get relative_xyz_covariance value. 00906 * 00907 Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line, 00908 first three values represent row, next tree values second row and last three values 00909 last row from left to right each. 00910 00911 * @return relative_xyz_covariance value 00912 */ 00913 float * 00914 ObjectPositionInterface::relative_xyz_covariance() const 00915 { 00916 return data->relative_xyz_covariance; 00917 } 00918 00919 /** Get relative_xyz_covariance value at given index. 00920 * 00921 Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line, 00922 first three values represent row, next tree values second row and last three values 00923 last row from left to right each. 00924 00925 * @param index index of value 00926 * @return relative_xyz_covariance value 00927 * @exception Exception thrown if index is out of bounds 00928 */ 00929 float 00930 ObjectPositionInterface::relative_xyz_covariance(unsigned int index) const 00931 { 00932 if (index > 9) { 00933 throw Exception("Index value %u out of bounds (0..9)", index); 00934 } 00935 return data->relative_xyz_covariance[index]; 00936 } 00937 00938 /** Get maximum length of relative_xyz_covariance value. 00939 * @return length of relative_xyz_covariance value, can be length of the array or number of 00940 * maximum number of characters for a string 00941 */ 00942 size_t 00943 ObjectPositionInterface::maxlenof_relative_xyz_covariance() const 00944 { 00945 return 9; 00946 } 00947 00948 /** Set relative_xyz_covariance value. 00949 * 00950 Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line, 00951 first three values represent row, next tree values second row and last three values 00952 last row from left to right each. 00953 00954 * @param new_relative_xyz_covariance new relative_xyz_covariance value 00955 */ 00956 void 00957 ObjectPositionInterface::set_relative_xyz_covariance(const float * new_relative_xyz_covariance) 00958 { 00959 memcpy(data->relative_xyz_covariance, new_relative_xyz_covariance, sizeof(float) * 9); 00960 data_changed = true; 00961 } 00962 00963 /** Set relative_xyz_covariance value at given index. 00964 * 00965 Covariance of relative x/y/z values. This is a 3x3 matrix ordered line by line, 00966 first three values represent row, next tree values second row and last three values 00967 last row from left to right each. 00968 00969 * @param new_relative_xyz_covariance new relative_xyz_covariance value 00970 * @param index index for of the value 00971 */ 00972 void 00973 ObjectPositionInterface::set_relative_xyz_covariance(unsigned int index, const float new_relative_xyz_covariance) 00974 { 00975 if (index > 9) { 00976 throw Exception("Index value %u out of bounds (0..9)", index); 00977 } 00978 data->relative_xyz_covariance[index] = new_relative_xyz_covariance; 00979 } 00980 /** Get extent_x value. 00981 * 00982 Extent of the seen object given in the relative x cartesian coordinate in m. 00983 00984 * @return extent_x value 00985 */ 00986 float 00987 ObjectPositionInterface::extent_x() const 00988 { 00989 return data->extent_x; 00990 } 00991 00992 /** Get maximum length of extent_x value. 00993 * @return length of extent_x value, can be length of the array or number of 00994 * maximum number of characters for a string 00995 */ 00996 size_t 00997 ObjectPositionInterface::maxlenof_extent_x() const 00998 { 00999 return 1; 01000 } 01001 01002 /** Set extent_x value. 01003 * 01004 Extent of the seen object given in the relative x cartesian coordinate in m. 01005 01006 * @param new_extent_x new extent_x value 01007 */ 01008 void 01009 ObjectPositionInterface::set_extent_x(const float new_extent_x) 01010 { 01011 data->extent_x = new_extent_x; 01012 data_changed = true; 01013 } 01014 01015 /** Get extent_y value. 01016 * 01017 Extent of the seen object given in the relative y cartesian coordinate in m. 01018 01019 * @return extent_y value 01020 */ 01021 float 01022 ObjectPositionInterface::extent_y() const 01023 { 01024 return data->extent_y; 01025 } 01026 01027 /** Get maximum length of extent_y value. 01028 * @return length of extent_y value, can be length of the array or number of 01029 * maximum number of characters for a string 01030 */ 01031 size_t 01032 ObjectPositionInterface::maxlenof_extent_y() const 01033 { 01034 return 1; 01035 } 01036 01037 /** Set extent_y value. 01038 * 01039 Extent of the seen object given in the relative y cartesian coordinate in m. 01040 01041 * @param new_extent_y new extent_y value 01042 */ 01043 void 01044 ObjectPositionInterface::set_extent_y(const float new_extent_y) 01045 { 01046 data->extent_y = new_extent_y; 01047 data_changed = true; 01048 } 01049 01050 /** Get extent_z value. 01051 * 01052 Extent of the seen object given in the relative z cartesian coordinate in m. 01053 01054 * @return extent_z value 01055 */ 01056 float 01057 ObjectPositionInterface::extent_z() const 01058 { 01059 return data->extent_z; 01060 } 01061 01062 /** Get maximum length of extent_z value. 01063 * @return length of extent_z value, can be length of the array or number of 01064 * maximum number of characters for a string 01065 */ 01066 size_t 01067 ObjectPositionInterface::maxlenof_extent_z() const 01068 { 01069 return 1; 01070 } 01071 01072 /** Set extent_z value. 01073 * 01074 Extent of the seen object given in the relative z cartesian coordinate in m. 01075 01076 * @param new_extent_z new extent_z value 01077 */ 01078 void 01079 ObjectPositionInterface::set_extent_z(const float new_extent_z) 01080 { 01081 data->extent_z = new_extent_z; 01082 data_changed = true; 01083 } 01084 01085 /** Get world_x_velocity value. 01086 * 01087 Velocity of object in the world coordinate system in X-direction in meter per second. 01088 01089 * @return world_x_velocity value 01090 */ 01091 float 01092 ObjectPositionInterface::world_x_velocity() const 01093 { 01094 return data->world_x_velocity; 01095 } 01096 01097 /** Get maximum length of world_x_velocity value. 01098 * @return length of world_x_velocity value, can be length of the array or number of 01099 * maximum number of characters for a string 01100 */ 01101 size_t 01102 ObjectPositionInterface::maxlenof_world_x_velocity() const 01103 { 01104 return 1; 01105 } 01106 01107 /** Set world_x_velocity value. 01108 * 01109 Velocity of object in the world coordinate system in X-direction in meter per second. 01110 01111 * @param new_world_x_velocity new world_x_velocity value 01112 */ 01113 void 01114 ObjectPositionInterface::set_world_x_velocity(const float new_world_x_velocity) 01115 { 01116 data->world_x_velocity = new_world_x_velocity; 01117 data_changed = true; 01118 } 01119 01120 /** Get world_y_velocity value. 01121 * 01122 Velocity of object in the world coordinate system in Y-direction in meter per second. 01123 01124 * @return world_y_velocity value 01125 */ 01126 float 01127 ObjectPositionInterface::world_y_velocity() const 01128 { 01129 return data->world_y_velocity; 01130 } 01131 01132 /** Get maximum length of world_y_velocity value. 01133 * @return length of world_y_velocity value, can be length of the array or number of 01134 * maximum number of characters for a string 01135 */ 01136 size_t 01137 ObjectPositionInterface::maxlenof_world_y_velocity() const 01138 { 01139 return 1; 01140 } 01141 01142 /** Set world_y_velocity value. 01143 * 01144 Velocity of object in the world coordinate system in Y-direction in meter per second. 01145 01146 * @param new_world_y_velocity new world_y_velocity value 01147 */ 01148 void 01149 ObjectPositionInterface::set_world_y_velocity(const float new_world_y_velocity) 01150 { 01151 data->world_y_velocity = new_world_y_velocity; 01152 data_changed = true; 01153 } 01154 01155 /** Get world_z_velocity value. 01156 * 01157 Velocity of object in the world coordinate system in Z-direction in meter per second. 01158 01159 * @return world_z_velocity value 01160 */ 01161 float 01162 ObjectPositionInterface::world_z_velocity() const 01163 { 01164 return data->world_z_velocity; 01165 } 01166 01167 /** Get maximum length of world_z_velocity value. 01168 * @return length of world_z_velocity value, can be length of the array or number of 01169 * maximum number of characters for a string 01170 */ 01171 size_t 01172 ObjectPositionInterface::maxlenof_world_z_velocity() const 01173 { 01174 return 1; 01175 } 01176 01177 /** Set world_z_velocity value. 01178 * 01179 Velocity of object in the world coordinate system in Z-direction in meter per second. 01180 01181 * @param new_world_z_velocity new world_z_velocity value 01182 */ 01183 void 01184 ObjectPositionInterface::set_world_z_velocity(const float new_world_z_velocity) 01185 { 01186 data->world_z_velocity = new_world_z_velocity; 01187 data_changed = true; 01188 } 01189 01190 /** Get world_xyz_velocity_covariance value. 01191 * 01192 Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line 01193 by line, first three values represent row, next tree values second row and last three 01194 values last row from left to right each. 01195 01196 * @return world_xyz_velocity_covariance value 01197 */ 01198 float * 01199 ObjectPositionInterface::world_xyz_velocity_covariance() const 01200 { 01201 return data->world_xyz_velocity_covariance; 01202 } 01203 01204 /** Get world_xyz_velocity_covariance value at given index. 01205 * 01206 Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line 01207 by line, first three values represent row, next tree values second row and last three 01208 values last row from left to right each. 01209 01210 * @param index index of value 01211 * @return world_xyz_velocity_covariance value 01212 * @exception Exception thrown if index is out of bounds 01213 */ 01214 float 01215 ObjectPositionInterface::world_xyz_velocity_covariance(unsigned int index) const 01216 { 01217 if (index > 9) { 01218 throw Exception("Index value %u out of bounds (0..9)", index); 01219 } 01220 return data->world_xyz_velocity_covariance[index]; 01221 } 01222 01223 /** Get maximum length of world_xyz_velocity_covariance value. 01224 * @return length of world_xyz_velocity_covariance value, can be length of the array or number of 01225 * maximum number of characters for a string 01226 */ 01227 size_t 01228 ObjectPositionInterface::maxlenof_world_xyz_velocity_covariance() const 01229 { 01230 return 9; 01231 } 01232 01233 /** Set world_xyz_velocity_covariance value. 01234 * 01235 Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line 01236 by line, first three values represent row, next tree values second row and last three 01237 values last row from left to right each. 01238 01239 * @param new_world_xyz_velocity_covariance new world_xyz_velocity_covariance value 01240 */ 01241 void 01242 ObjectPositionInterface::set_world_xyz_velocity_covariance(const float * new_world_xyz_velocity_covariance) 01243 { 01244 memcpy(data->world_xyz_velocity_covariance, new_world_xyz_velocity_covariance, sizeof(float) * 9); 01245 data_changed = true; 01246 } 01247 01248 /** Set world_xyz_velocity_covariance value at given index. 01249 * 01250 Covariance of WorldX/WorldY/WorldZ velocity values. This is a 3x3 matrix ordered line 01251 by line, first three values represent row, next tree values second row and last three 01252 values last row from left to right each. 01253 01254 * @param new_world_xyz_velocity_covariance new world_xyz_velocity_covariance value 01255 * @param index index for of the value 01256 */ 01257 void 01258 ObjectPositionInterface::set_world_xyz_velocity_covariance(unsigned int index, const float new_world_xyz_velocity_covariance) 01259 { 01260 if (index > 9) { 01261 throw Exception("Index value %u out of bounds (0..9)", index); 01262 } 01263 data->world_xyz_velocity_covariance[index] = new_world_xyz_velocity_covariance; 01264 } 01265 /** Get relative_x_velocity value. 01266 * 01267 Velocity of object in the world coordinate system in X-direction in meter per second. 01268 01269 * @return relative_x_velocity value 01270 */ 01271 float 01272 ObjectPositionInterface::relative_x_velocity() const 01273 { 01274 return data->relative_x_velocity; 01275 } 01276 01277 /** Get maximum length of relative_x_velocity value. 01278 * @return length of relative_x_velocity value, can be length of the array or number of 01279 * maximum number of characters for a string 01280 */ 01281 size_t 01282 ObjectPositionInterface::maxlenof_relative_x_velocity() const 01283 { 01284 return 1; 01285 } 01286 01287 /** Set relative_x_velocity value. 01288 * 01289 Velocity of object in the world coordinate system in X-direction in meter per second. 01290 01291 * @param new_relative_x_velocity new relative_x_velocity value 01292 */ 01293 void 01294 ObjectPositionInterface::set_relative_x_velocity(const float new_relative_x_velocity) 01295 { 01296 data->relative_x_velocity = new_relative_x_velocity; 01297 data_changed = true; 01298 } 01299 01300 /** Get relative_y_velocity value. 01301 * 01302 Velocity of object in the world coordinate system in Y-direction in meter per second. 01303 01304 * @return relative_y_velocity value 01305 */ 01306 float 01307 ObjectPositionInterface::relative_y_velocity() const 01308 { 01309 return data->relative_y_velocity; 01310 } 01311 01312 /** Get maximum length of relative_y_velocity value. 01313 * @return length of relative_y_velocity value, can be length of the array or number of 01314 * maximum number of characters for a string 01315 */ 01316 size_t 01317 ObjectPositionInterface::maxlenof_relative_y_velocity() const 01318 { 01319 return 1; 01320 } 01321 01322 /** Set relative_y_velocity value. 01323 * 01324 Velocity of object in the world coordinate system in Y-direction in meter per second. 01325 01326 * @param new_relative_y_velocity new relative_y_velocity value 01327 */ 01328 void 01329 ObjectPositionInterface::set_relative_y_velocity(const float new_relative_y_velocity) 01330 { 01331 data->relative_y_velocity = new_relative_y_velocity; 01332 data_changed = true; 01333 } 01334 01335 /** Get relative_z_velocity value. 01336 * 01337 Velocity of object in the world coordinate system in Z-direction in meter per second. 01338 01339 * @return relative_z_velocity value 01340 */ 01341 float 01342 ObjectPositionInterface::relative_z_velocity() const 01343 { 01344 return data->relative_z_velocity; 01345 } 01346 01347 /** Get maximum length of relative_z_velocity value. 01348 * @return length of relative_z_velocity value, can be length of the array or number of 01349 * maximum number of characters for a string 01350 */ 01351 size_t 01352 ObjectPositionInterface::maxlenof_relative_z_velocity() const 01353 { 01354 return 1; 01355 } 01356 01357 /** Set relative_z_velocity value. 01358 * 01359 Velocity of object in the world coordinate system in Z-direction in meter per second. 01360 01361 * @param new_relative_z_velocity new relative_z_velocity value 01362 */ 01363 void 01364 ObjectPositionInterface::set_relative_z_velocity(const float new_relative_z_velocity) 01365 { 01366 data->relative_z_velocity = new_relative_z_velocity; 01367 data_changed = true; 01368 } 01369 01370 /** Get relative_xyz_velocity_covariance value. 01371 * 01372 Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line 01373 by line, first three values represent row, next tree values second row and last three 01374 values last row from left to right each. 01375 01376 * @return relative_xyz_velocity_covariance value 01377 */ 01378 float * 01379 ObjectPositionInterface::relative_xyz_velocity_covariance() const 01380 { 01381 return data->relative_xyz_velocity_covariance; 01382 } 01383 01384 /** Get relative_xyz_velocity_covariance value at given index. 01385 * 01386 Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line 01387 by line, first three values represent row, next tree values second row and last three 01388 values last row from left to right each. 01389 01390 * @param index index of value 01391 * @return relative_xyz_velocity_covariance value 01392 * @exception Exception thrown if index is out of bounds 01393 */ 01394 float 01395 ObjectPositionInterface::relative_xyz_velocity_covariance(unsigned int index) const 01396 { 01397 if (index > 9) { 01398 throw Exception("Index value %u out of bounds (0..9)", index); 01399 } 01400 return data->relative_xyz_velocity_covariance[index]; 01401 } 01402 01403 /** Get maximum length of relative_xyz_velocity_covariance value. 01404 * @return length of relative_xyz_velocity_covariance value, can be length of the array or number of 01405 * maximum number of characters for a string 01406 */ 01407 size_t 01408 ObjectPositionInterface::maxlenof_relative_xyz_velocity_covariance() const 01409 { 01410 return 9; 01411 } 01412 01413 /** Set relative_xyz_velocity_covariance value. 01414 * 01415 Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line 01416 by line, first three values represent row, next tree values second row and last three 01417 values last row from left to right each. 01418 01419 * @param new_relative_xyz_velocity_covariance new relative_xyz_velocity_covariance value 01420 */ 01421 void 01422 ObjectPositionInterface::set_relative_xyz_velocity_covariance(const float * new_relative_xyz_velocity_covariance) 01423 { 01424 memcpy(data->relative_xyz_velocity_covariance, new_relative_xyz_velocity_covariance, sizeof(float) * 9); 01425 data_changed = true; 01426 } 01427 01428 /** Set relative_xyz_velocity_covariance value at given index. 01429 * 01430 Covariance of relative x/y/z velocity values. This is a 3x3 matrix ordered line 01431 by line, first three values represent row, next tree values second row and last three 01432 values last row from left to right each. 01433 01434 * @param new_relative_xyz_velocity_covariance new relative_xyz_velocity_covariance value 01435 * @param index index for of the value 01436 */ 01437 void 01438 ObjectPositionInterface::set_relative_xyz_velocity_covariance(unsigned int index, const float new_relative_xyz_velocity_covariance) 01439 { 01440 if (index > 9) { 01441 throw Exception("Index value %u out of bounds (0..9)", index); 01442 } 01443 data->relative_xyz_velocity_covariance[index] = new_relative_xyz_velocity_covariance; 01444 } 01445 /* =========== message create =========== */ 01446 Message * 01447 ObjectPositionInterface::create_message(const char *type) const 01448 { 01449 throw UnknownTypeException("The given type '%s' does not match any known " 01450 "message type for this interface type.", type); 01451 } 01452 01453 01454 /** Copy values from other interface. 01455 * @param other other interface to copy values from 01456 */ 01457 void 01458 ObjectPositionInterface::copy_values(const Interface *other) 01459 { 01460 const ObjectPositionInterface *oi = dynamic_cast<const ObjectPositionInterface *>(other); 01461 if (oi == NULL) { 01462 throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)", 01463 type(), other->type()); 01464 } 01465 memcpy(data, oi->data, sizeof(ObjectPositionInterface_data_t)); 01466 } 01467 01468 const char * 01469 ObjectPositionInterface::enum_tostring(const char *enumtype, int val) const 01470 { 01471 throw UnknownTypeException("Unknown enum type %s", enumtype); 01472 } 01473 01474 /* =========== messages =========== */ 01475 /** Check if message is valid and can be enqueued. 01476 * @param message Message to check 01477 * @return true if the message is valid, false otherwise. 01478 */ 01479 bool 01480 ObjectPositionInterface::message_valid(const Message *message) const 01481 { 01482 return false; 01483 } 01484 01485 /// @cond INTERNALS 01486 EXPORT_INTERFACE(ObjectPositionInterface) 01487 /// @endcond 01488 01489 01490 } // end namespace fawkes