Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * NaoJointPositionInterface.cpp - Fawkes BlackBoard Interface - NaoJointPositionInterface 00004 * 00005 * Templated created: Thu Oct 12 10:49:19 2006 00006 * Copyright 2008-2011 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/NaoJointPositionInterface.h> 00025 00026 #include <core/exceptions/software.h> 00027 00028 #include <cstring> 00029 #include <cstdlib> 00030 00031 namespace fawkes { 00032 00033 /** @class NaoJointPositionInterface <interfaces/NaoJointPositionInterface.h> 00034 * NaoJointPositionInterface Fawkes BlackBoard Interface. 00035 * 00036 This interface provides access to Nao joint positions and movements. 00037 00038 * @ingroup FawkesInterfaces 00039 */ 00040 00041 00042 /** SERVO_head_yaw constant */ 00043 const uint32_t NaoJointPositionInterface::SERVO_head_yaw = 1u; 00044 /** SERVO_head_pitch constant */ 00045 const uint32_t NaoJointPositionInterface::SERVO_head_pitch = 2u; 00046 /** SERVO_l_shoulder_pitch constant */ 00047 const uint32_t NaoJointPositionInterface::SERVO_l_shoulder_pitch = 4u; 00048 /** SERVO_l_shoulder_roll constant */ 00049 const uint32_t NaoJointPositionInterface::SERVO_l_shoulder_roll = 8u; 00050 /** SERVO_l_elbow_yaw constant */ 00051 const uint32_t NaoJointPositionInterface::SERVO_l_elbow_yaw = 16u; 00052 /** SERVO_l_elbow_roll constant */ 00053 const uint32_t NaoJointPositionInterface::SERVO_l_elbow_roll = 32u; 00054 /** SERVO_l_wrist_yaw constant */ 00055 const uint32_t NaoJointPositionInterface::SERVO_l_wrist_yaw = 64u; 00056 /** SERVO_l_hand constant */ 00057 const uint32_t NaoJointPositionInterface::SERVO_l_hand = 128u; 00058 /** SERVO_l_hip_yaw_pitch constant */ 00059 const uint32_t NaoJointPositionInterface::SERVO_l_hip_yaw_pitch = 256u; 00060 /** SERVO_l_hip_roll constant */ 00061 const uint32_t NaoJointPositionInterface::SERVO_l_hip_roll = 512u; 00062 /** SERVO_l_hip_pitch constant */ 00063 const uint32_t NaoJointPositionInterface::SERVO_l_hip_pitch = 1024u; 00064 /** SERVO_l_knee_pitch constant */ 00065 const uint32_t NaoJointPositionInterface::SERVO_l_knee_pitch = 2048u; 00066 /** SERVO_l_ankle_pitch constant */ 00067 const uint32_t NaoJointPositionInterface::SERVO_l_ankle_pitch = 4096u; 00068 /** SERVO_l_ankle_roll constant */ 00069 const uint32_t NaoJointPositionInterface::SERVO_l_ankle_roll = 8192u; 00070 /** SERVO_r_shoulder_pitch constant */ 00071 const uint32_t NaoJointPositionInterface::SERVO_r_shoulder_pitch = 16384u; 00072 /** SERVO_r_shoulder_roll constant */ 00073 const uint32_t NaoJointPositionInterface::SERVO_r_shoulder_roll = 32768u; 00074 /** SERVO_r_elbow_yaw constant */ 00075 const uint32_t NaoJointPositionInterface::SERVO_r_elbow_yaw = 65536u; 00076 /** SERVO_r_elbow_roll constant */ 00077 const uint32_t NaoJointPositionInterface::SERVO_r_elbow_roll = 131072u; 00078 /** SERVO_r_wrist_yaw constant */ 00079 const uint32_t NaoJointPositionInterface::SERVO_r_wrist_yaw = 262144u; 00080 /** SERVO_r_hand constant */ 00081 const uint32_t NaoJointPositionInterface::SERVO_r_hand = 524288u; 00082 /** SERVO_r_hip_yaw_pitch constant */ 00083 const uint32_t NaoJointPositionInterface::SERVO_r_hip_yaw_pitch = 1048576u; 00084 /** SERVO_r_hip_roll constant */ 00085 const uint32_t NaoJointPositionInterface::SERVO_r_hip_roll = 2097152u; 00086 /** SERVO_r_hip_pitch constant */ 00087 const uint32_t NaoJointPositionInterface::SERVO_r_hip_pitch = 4194304u; 00088 /** SERVO_r_knee_pitch constant */ 00089 const uint32_t NaoJointPositionInterface::SERVO_r_knee_pitch = 8388608u; 00090 /** SERVO_r_ankle_pitch constant */ 00091 const uint32_t NaoJointPositionInterface::SERVO_r_ankle_pitch = 16777216u; 00092 /** SERVO_r_ankle_roll constant */ 00093 const uint32_t NaoJointPositionInterface::SERVO_r_ankle_roll = 33554432u; 00094 /** SERVO_min constant */ 00095 const uint32_t NaoJointPositionInterface::SERVO_min = 1u; 00096 /** SERVO_max constant */ 00097 const uint32_t NaoJointPositionInterface::SERVO_max = 33554432u; 00098 00099 /** Constructor */ 00100 NaoJointPositionInterface::NaoJointPositionInterface() : Interface() 00101 { 00102 data_size = sizeof(NaoJointPositionInterface_data_t); 00103 data_ptr = malloc(data_size); 00104 data = (NaoJointPositionInterface_data_t *)data_ptr; 00105 data_ts = (interface_data_ts_t *)data_ptr; 00106 memset(data_ptr, 0, data_size); 00107 add_fieldinfo(IFT_ENUM, "robot_type", 1, &data->robot_type, "RobotType"); 00108 add_fieldinfo(IFT_UINT8, "robot_version", 4, &data->robot_version); 00109 add_fieldinfo(IFT_FLOAT, "head_yaw", 1, &data->head_yaw); 00110 add_fieldinfo(IFT_FLOAT, "head_pitch", 1, &data->head_pitch); 00111 add_fieldinfo(IFT_FLOAT, "l_shoulder_pitch", 1, &data->l_shoulder_pitch); 00112 add_fieldinfo(IFT_FLOAT, "l_shoulder_roll", 1, &data->l_shoulder_roll); 00113 add_fieldinfo(IFT_FLOAT, "l_elbow_yaw", 1, &data->l_elbow_yaw); 00114 add_fieldinfo(IFT_FLOAT, "l_elbow_roll", 1, &data->l_elbow_roll); 00115 add_fieldinfo(IFT_FLOAT, "l_wrist_yaw", 1, &data->l_wrist_yaw); 00116 add_fieldinfo(IFT_FLOAT, "l_hand", 1, &data->l_hand); 00117 add_fieldinfo(IFT_FLOAT, "l_hip_yaw_pitch", 1, &data->l_hip_yaw_pitch); 00118 add_fieldinfo(IFT_FLOAT, "l_hip_roll", 1, &data->l_hip_roll); 00119 add_fieldinfo(IFT_FLOAT, "l_hip_pitch", 1, &data->l_hip_pitch); 00120 add_fieldinfo(IFT_FLOAT, "l_knee_pitch", 1, &data->l_knee_pitch); 00121 add_fieldinfo(IFT_FLOAT, "l_ankle_pitch", 1, &data->l_ankle_pitch); 00122 add_fieldinfo(IFT_FLOAT, "l_ankle_roll", 1, &data->l_ankle_roll); 00123 add_fieldinfo(IFT_FLOAT, "r_shoulder_pitch", 1, &data->r_shoulder_pitch); 00124 add_fieldinfo(IFT_FLOAT, "r_shoulder_roll", 1, &data->r_shoulder_roll); 00125 add_fieldinfo(IFT_FLOAT, "r_elbow_yaw", 1, &data->r_elbow_yaw); 00126 add_fieldinfo(IFT_FLOAT, "r_elbow_roll", 1, &data->r_elbow_roll); 00127 add_fieldinfo(IFT_FLOAT, "r_wrist_yaw", 1, &data->r_wrist_yaw); 00128 add_fieldinfo(IFT_FLOAT, "r_hand", 1, &data->r_hand); 00129 add_fieldinfo(IFT_FLOAT, "r_hip_yaw_pitch", 1, &data->r_hip_yaw_pitch); 00130 add_fieldinfo(IFT_FLOAT, "r_hip_roll", 1, &data->r_hip_roll); 00131 add_fieldinfo(IFT_FLOAT, "r_hip_pitch", 1, &data->r_hip_pitch); 00132 add_fieldinfo(IFT_FLOAT, "r_knee_pitch", 1, &data->r_knee_pitch); 00133 add_fieldinfo(IFT_FLOAT, "r_ankle_pitch", 1, &data->r_ankle_pitch); 00134 add_fieldinfo(IFT_FLOAT, "r_ankle_roll", 1, &data->r_ankle_roll); 00135 add_fieldinfo(IFT_INT32, "time", 1, &data->time); 00136 add_messageinfo("SetServoMessage"); 00137 add_messageinfo("SetServosMessage"); 00138 add_messageinfo("MoveServoMessage"); 00139 add_messageinfo("MoveServosMessage"); 00140 unsigned char tmp_hash[] = {0x87, 0x3b, 0x41, 0x5d, 0x94, 0x57, 0x82, 0x55, 0x3, 0xbb, 0x3e, 0xf, 0x89, 0x50, 0x6b, 0x46}; 00141 set_hash(tmp_hash); 00142 } 00143 00144 /** Destructor */ 00145 NaoJointPositionInterface::~NaoJointPositionInterface() 00146 { 00147 free(data_ptr); 00148 } 00149 /** Convert RobotType constant to string. 00150 * @param value value to convert to string 00151 * @return constant value as string. 00152 */ 00153 const char * 00154 NaoJointPositionInterface::tostring_RobotType(RobotType value) const 00155 { 00156 switch (value) { 00157 case ROBOTYPE_ACADEMIC: return "ROBOTYPE_ACADEMIC"; 00158 case ROBOTYPE_ROBOCUP: return "ROBOTYPE_ROBOCUP"; 00159 default: return "UNKNOWN"; 00160 } 00161 } 00162 /* Methods */ 00163 /** Get robot_type value. 00164 * Robot type. 00165 * @return robot_type value 00166 */ 00167 NaoJointPositionInterface::RobotType 00168 NaoJointPositionInterface::robot_type() const 00169 { 00170 return (NaoJointPositionInterface::RobotType)data->robot_type; 00171 } 00172 00173 /** Get maximum length of robot_type value. 00174 * @return length of robot_type value, can be length of the array or number of 00175 * maximum number of characters for a string 00176 */ 00177 size_t 00178 NaoJointPositionInterface::maxlenof_robot_type() const 00179 { 00180 return 1; 00181 } 00182 00183 /** Set robot_type value. 00184 * Robot type. 00185 * @param new_robot_type new robot_type value 00186 */ 00187 void 00188 NaoJointPositionInterface::set_robot_type(const RobotType new_robot_type) 00189 { 00190 data->robot_type = new_robot_type; 00191 data_changed = true; 00192 } 00193 00194 /** Get robot_version value. 00195 * 00196 Robot version. Fields are in ascending array index major, minor, micro and 00197 patch level. Currently only the first two are used by Aldebaran, but due to 00198 struct alignment we add two extra bytes. 00199 00200 * @return robot_version value 00201 */ 00202 uint8_t * 00203 NaoJointPositionInterface::robot_version() const 00204 { 00205 return data->robot_version; 00206 } 00207 00208 /** Get robot_version value at given index. 00209 * 00210 Robot version. Fields are in ascending array index major, minor, micro and 00211 patch level. Currently only the first two are used by Aldebaran, but due to 00212 struct alignment we add two extra bytes. 00213 00214 * @param index index of value 00215 * @return robot_version value 00216 * @exception Exception thrown if index is out of bounds 00217 */ 00218 uint8_t 00219 NaoJointPositionInterface::robot_version(unsigned int index) const 00220 { 00221 if (index > 4) { 00222 throw Exception("Index value %u out of bounds (0..4)", index); 00223 } 00224 return data->robot_version[index]; 00225 } 00226 00227 /** Get maximum length of robot_version value. 00228 * @return length of robot_version value, can be length of the array or number of 00229 * maximum number of characters for a string 00230 */ 00231 size_t 00232 NaoJointPositionInterface::maxlenof_robot_version() const 00233 { 00234 return 4; 00235 } 00236 00237 /** Set robot_version value. 00238 * 00239 Robot version. Fields are in ascending array index major, minor, micro and 00240 patch level. Currently only the first two are used by Aldebaran, but due to 00241 struct alignment we add two extra bytes. 00242 00243 * @param new_robot_version new robot_version value 00244 */ 00245 void 00246 NaoJointPositionInterface::set_robot_version(const uint8_t * new_robot_version) 00247 { 00248 memcpy(data->robot_version, new_robot_version, sizeof(uint8_t) * 4); 00249 data_changed = true; 00250 } 00251 00252 /** Set robot_version value at given index. 00253 * 00254 Robot version. Fields are in ascending array index major, minor, micro and 00255 patch level. Currently only the first two are used by Aldebaran, but due to 00256 struct alignment we add two extra bytes. 00257 00258 * @param new_robot_version new robot_version value 00259 * @param index index for of the value 00260 */ 00261 void 00262 NaoJointPositionInterface::set_robot_version(unsigned int index, const uint8_t new_robot_version) 00263 { 00264 if (index > 4) { 00265 throw Exception("Index value %u out of bounds (0..4)", index); 00266 } 00267 data->robot_version[index] = new_robot_version; 00268 data_changed = true; 00269 } 00270 /** Get head_yaw value. 00271 * Head yaw 00272 * @return head_yaw value 00273 */ 00274 float 00275 NaoJointPositionInterface::head_yaw() const 00276 { 00277 return data->head_yaw; 00278 } 00279 00280 /** Get maximum length of head_yaw value. 00281 * @return length of head_yaw value, can be length of the array or number of 00282 * maximum number of characters for a string 00283 */ 00284 size_t 00285 NaoJointPositionInterface::maxlenof_head_yaw() const 00286 { 00287 return 1; 00288 } 00289 00290 /** Set head_yaw value. 00291 * Head yaw 00292 * @param new_head_yaw new head_yaw value 00293 */ 00294 void 00295 NaoJointPositionInterface::set_head_yaw(const float new_head_yaw) 00296 { 00297 data->head_yaw = new_head_yaw; 00298 data_changed = true; 00299 } 00300 00301 /** Get head_pitch value. 00302 * Head pitch 00303 * @return head_pitch value 00304 */ 00305 float 00306 NaoJointPositionInterface::head_pitch() const 00307 { 00308 return data->head_pitch; 00309 } 00310 00311 /** Get maximum length of head_pitch value. 00312 * @return length of head_pitch value, can be length of the array or number of 00313 * maximum number of characters for a string 00314 */ 00315 size_t 00316 NaoJointPositionInterface::maxlenof_head_pitch() const 00317 { 00318 return 1; 00319 } 00320 00321 /** Set head_pitch value. 00322 * Head pitch 00323 * @param new_head_pitch new head_pitch value 00324 */ 00325 void 00326 NaoJointPositionInterface::set_head_pitch(const float new_head_pitch) 00327 { 00328 data->head_pitch = new_head_pitch; 00329 data_changed = true; 00330 } 00331 00332 /** Get l_shoulder_pitch value. 00333 * Left shoulder pitch 00334 * @return l_shoulder_pitch value 00335 */ 00336 float 00337 NaoJointPositionInterface::l_shoulder_pitch() const 00338 { 00339 return data->l_shoulder_pitch; 00340 } 00341 00342 /** Get maximum length of l_shoulder_pitch value. 00343 * @return length of l_shoulder_pitch value, can be length of the array or number of 00344 * maximum number of characters for a string 00345 */ 00346 size_t 00347 NaoJointPositionInterface::maxlenof_l_shoulder_pitch() const 00348 { 00349 return 1; 00350 } 00351 00352 /** Set l_shoulder_pitch value. 00353 * Left shoulder pitch 00354 * @param new_l_shoulder_pitch new l_shoulder_pitch value 00355 */ 00356 void 00357 NaoJointPositionInterface::set_l_shoulder_pitch(const float new_l_shoulder_pitch) 00358 { 00359 data->l_shoulder_pitch = new_l_shoulder_pitch; 00360 data_changed = true; 00361 } 00362 00363 /** Get l_shoulder_roll value. 00364 * Left shoulder roll 00365 * @return l_shoulder_roll value 00366 */ 00367 float 00368 NaoJointPositionInterface::l_shoulder_roll() const 00369 { 00370 return data->l_shoulder_roll; 00371 } 00372 00373 /** Get maximum length of l_shoulder_roll value. 00374 * @return length of l_shoulder_roll value, can be length of the array or number of 00375 * maximum number of characters for a string 00376 */ 00377 size_t 00378 NaoJointPositionInterface::maxlenof_l_shoulder_roll() const 00379 { 00380 return 1; 00381 } 00382 00383 /** Set l_shoulder_roll value. 00384 * Left shoulder roll 00385 * @param new_l_shoulder_roll new l_shoulder_roll value 00386 */ 00387 void 00388 NaoJointPositionInterface::set_l_shoulder_roll(const float new_l_shoulder_roll) 00389 { 00390 data->l_shoulder_roll = new_l_shoulder_roll; 00391 data_changed = true; 00392 } 00393 00394 /** Get l_elbow_yaw value. 00395 * Left elbow yaw 00396 * @return l_elbow_yaw value 00397 */ 00398 float 00399 NaoJointPositionInterface::l_elbow_yaw() const 00400 { 00401 return data->l_elbow_yaw; 00402 } 00403 00404 /** Get maximum length of l_elbow_yaw value. 00405 * @return length of l_elbow_yaw value, can be length of the array or number of 00406 * maximum number of characters for a string 00407 */ 00408 size_t 00409 NaoJointPositionInterface::maxlenof_l_elbow_yaw() const 00410 { 00411 return 1; 00412 } 00413 00414 /** Set l_elbow_yaw value. 00415 * Left elbow yaw 00416 * @param new_l_elbow_yaw new l_elbow_yaw value 00417 */ 00418 void 00419 NaoJointPositionInterface::set_l_elbow_yaw(const float new_l_elbow_yaw) 00420 { 00421 data->l_elbow_yaw = new_l_elbow_yaw; 00422 data_changed = true; 00423 } 00424 00425 /** Get l_elbow_roll value. 00426 * Left elbow roll 00427 * @return l_elbow_roll value 00428 */ 00429 float 00430 NaoJointPositionInterface::l_elbow_roll() const 00431 { 00432 return data->l_elbow_roll; 00433 } 00434 00435 /** Get maximum length of l_elbow_roll value. 00436 * @return length of l_elbow_roll value, can be length of the array or number of 00437 * maximum number of characters for a string 00438 */ 00439 size_t 00440 NaoJointPositionInterface::maxlenof_l_elbow_roll() const 00441 { 00442 return 1; 00443 } 00444 00445 /** Set l_elbow_roll value. 00446 * Left elbow roll 00447 * @param new_l_elbow_roll new l_elbow_roll value 00448 */ 00449 void 00450 NaoJointPositionInterface::set_l_elbow_roll(const float new_l_elbow_roll) 00451 { 00452 data->l_elbow_roll = new_l_elbow_roll; 00453 data_changed = true; 00454 } 00455 00456 /** Get l_wrist_yaw value. 00457 * Left wrist yaw 00458 * @return l_wrist_yaw value 00459 */ 00460 float 00461 NaoJointPositionInterface::l_wrist_yaw() const 00462 { 00463 return data->l_wrist_yaw; 00464 } 00465 00466 /** Get maximum length of l_wrist_yaw value. 00467 * @return length of l_wrist_yaw value, can be length of the array or number of 00468 * maximum number of characters for a string 00469 */ 00470 size_t 00471 NaoJointPositionInterface::maxlenof_l_wrist_yaw() const 00472 { 00473 return 1; 00474 } 00475 00476 /** Set l_wrist_yaw value. 00477 * Left wrist yaw 00478 * @param new_l_wrist_yaw new l_wrist_yaw value 00479 */ 00480 void 00481 NaoJointPositionInterface::set_l_wrist_yaw(const float new_l_wrist_yaw) 00482 { 00483 data->l_wrist_yaw = new_l_wrist_yaw; 00484 data_changed = true; 00485 } 00486 00487 /** Get l_hand value. 00488 * Left hand 00489 * @return l_hand value 00490 */ 00491 float 00492 NaoJointPositionInterface::l_hand() const 00493 { 00494 return data->l_hand; 00495 } 00496 00497 /** Get maximum length of l_hand value. 00498 * @return length of l_hand value, can be length of the array or number of 00499 * maximum number of characters for a string 00500 */ 00501 size_t 00502 NaoJointPositionInterface::maxlenof_l_hand() const 00503 { 00504 return 1; 00505 } 00506 00507 /** Set l_hand value. 00508 * Left hand 00509 * @param new_l_hand new l_hand value 00510 */ 00511 void 00512 NaoJointPositionInterface::set_l_hand(const float new_l_hand) 00513 { 00514 data->l_hand = new_l_hand; 00515 data_changed = true; 00516 } 00517 00518 /** Get l_hip_yaw_pitch value. 00519 * Left hip yaw pitch 00520 * @return l_hip_yaw_pitch value 00521 */ 00522 float 00523 NaoJointPositionInterface::l_hip_yaw_pitch() const 00524 { 00525 return data->l_hip_yaw_pitch; 00526 } 00527 00528 /** Get maximum length of l_hip_yaw_pitch value. 00529 * @return length of l_hip_yaw_pitch value, can be length of the array or number of 00530 * maximum number of characters for a string 00531 */ 00532 size_t 00533 NaoJointPositionInterface::maxlenof_l_hip_yaw_pitch() const 00534 { 00535 return 1; 00536 } 00537 00538 /** Set l_hip_yaw_pitch value. 00539 * Left hip yaw pitch 00540 * @param new_l_hip_yaw_pitch new l_hip_yaw_pitch value 00541 */ 00542 void 00543 NaoJointPositionInterface::set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch) 00544 { 00545 data->l_hip_yaw_pitch = new_l_hip_yaw_pitch; 00546 data_changed = true; 00547 } 00548 00549 /** Get l_hip_roll value. 00550 * Left hip roll 00551 * @return l_hip_roll value 00552 */ 00553 float 00554 NaoJointPositionInterface::l_hip_roll() const 00555 { 00556 return data->l_hip_roll; 00557 } 00558 00559 /** Get maximum length of l_hip_roll value. 00560 * @return length of l_hip_roll value, can be length of the array or number of 00561 * maximum number of characters for a string 00562 */ 00563 size_t 00564 NaoJointPositionInterface::maxlenof_l_hip_roll() const 00565 { 00566 return 1; 00567 } 00568 00569 /** Set l_hip_roll value. 00570 * Left hip roll 00571 * @param new_l_hip_roll new l_hip_roll value 00572 */ 00573 void 00574 NaoJointPositionInterface::set_l_hip_roll(const float new_l_hip_roll) 00575 { 00576 data->l_hip_roll = new_l_hip_roll; 00577 data_changed = true; 00578 } 00579 00580 /** Get l_hip_pitch value. 00581 * Left hip pitch 00582 * @return l_hip_pitch value 00583 */ 00584 float 00585 NaoJointPositionInterface::l_hip_pitch() const 00586 { 00587 return data->l_hip_pitch; 00588 } 00589 00590 /** Get maximum length of l_hip_pitch value. 00591 * @return length of l_hip_pitch value, can be length of the array or number of 00592 * maximum number of characters for a string 00593 */ 00594 size_t 00595 NaoJointPositionInterface::maxlenof_l_hip_pitch() const 00596 { 00597 return 1; 00598 } 00599 00600 /** Set l_hip_pitch value. 00601 * Left hip pitch 00602 * @param new_l_hip_pitch new l_hip_pitch value 00603 */ 00604 void 00605 NaoJointPositionInterface::set_l_hip_pitch(const float new_l_hip_pitch) 00606 { 00607 data->l_hip_pitch = new_l_hip_pitch; 00608 data_changed = true; 00609 } 00610 00611 /** Get l_knee_pitch value. 00612 * Left knee pitch 00613 * @return l_knee_pitch value 00614 */ 00615 float 00616 NaoJointPositionInterface::l_knee_pitch() const 00617 { 00618 return data->l_knee_pitch; 00619 } 00620 00621 /** Get maximum length of l_knee_pitch value. 00622 * @return length of l_knee_pitch value, can be length of the array or number of 00623 * maximum number of characters for a string 00624 */ 00625 size_t 00626 NaoJointPositionInterface::maxlenof_l_knee_pitch() const 00627 { 00628 return 1; 00629 } 00630 00631 /** Set l_knee_pitch value. 00632 * Left knee pitch 00633 * @param new_l_knee_pitch new l_knee_pitch value 00634 */ 00635 void 00636 NaoJointPositionInterface::set_l_knee_pitch(const float new_l_knee_pitch) 00637 { 00638 data->l_knee_pitch = new_l_knee_pitch; 00639 data_changed = true; 00640 } 00641 00642 /** Get l_ankle_pitch value. 00643 * Left ankle pitch 00644 * @return l_ankle_pitch value 00645 */ 00646 float 00647 NaoJointPositionInterface::l_ankle_pitch() const 00648 { 00649 return data->l_ankle_pitch; 00650 } 00651 00652 /** Get maximum length of l_ankle_pitch value. 00653 * @return length of l_ankle_pitch value, can be length of the array or number of 00654 * maximum number of characters for a string 00655 */ 00656 size_t 00657 NaoJointPositionInterface::maxlenof_l_ankle_pitch() const 00658 { 00659 return 1; 00660 } 00661 00662 /** Set l_ankle_pitch value. 00663 * Left ankle pitch 00664 * @param new_l_ankle_pitch new l_ankle_pitch value 00665 */ 00666 void 00667 NaoJointPositionInterface::set_l_ankle_pitch(const float new_l_ankle_pitch) 00668 { 00669 data->l_ankle_pitch = new_l_ankle_pitch; 00670 data_changed = true; 00671 } 00672 00673 /** Get l_ankle_roll value. 00674 * Left ankle roll 00675 * @return l_ankle_roll value 00676 */ 00677 float 00678 NaoJointPositionInterface::l_ankle_roll() const 00679 { 00680 return data->l_ankle_roll; 00681 } 00682 00683 /** Get maximum length of l_ankle_roll value. 00684 * @return length of l_ankle_roll value, can be length of the array or number of 00685 * maximum number of characters for a string 00686 */ 00687 size_t 00688 NaoJointPositionInterface::maxlenof_l_ankle_roll() const 00689 { 00690 return 1; 00691 } 00692 00693 /** Set l_ankle_roll value. 00694 * Left ankle roll 00695 * @param new_l_ankle_roll new l_ankle_roll value 00696 */ 00697 void 00698 NaoJointPositionInterface::set_l_ankle_roll(const float new_l_ankle_roll) 00699 { 00700 data->l_ankle_roll = new_l_ankle_roll; 00701 data_changed = true; 00702 } 00703 00704 /** Get r_shoulder_pitch value. 00705 * Right shoulder pitch 00706 * @return r_shoulder_pitch value 00707 */ 00708 float 00709 NaoJointPositionInterface::r_shoulder_pitch() const 00710 { 00711 return data->r_shoulder_pitch; 00712 } 00713 00714 /** Get maximum length of r_shoulder_pitch value. 00715 * @return length of r_shoulder_pitch value, can be length of the array or number of 00716 * maximum number of characters for a string 00717 */ 00718 size_t 00719 NaoJointPositionInterface::maxlenof_r_shoulder_pitch() const 00720 { 00721 return 1; 00722 } 00723 00724 /** Set r_shoulder_pitch value. 00725 * Right shoulder pitch 00726 * @param new_r_shoulder_pitch new r_shoulder_pitch value 00727 */ 00728 void 00729 NaoJointPositionInterface::set_r_shoulder_pitch(const float new_r_shoulder_pitch) 00730 { 00731 data->r_shoulder_pitch = new_r_shoulder_pitch; 00732 data_changed = true; 00733 } 00734 00735 /** Get r_shoulder_roll value. 00736 * Right shoulder roll 00737 * @return r_shoulder_roll value 00738 */ 00739 float 00740 NaoJointPositionInterface::r_shoulder_roll() const 00741 { 00742 return data->r_shoulder_roll; 00743 } 00744 00745 /** Get maximum length of r_shoulder_roll value. 00746 * @return length of r_shoulder_roll value, can be length of the array or number of 00747 * maximum number of characters for a string 00748 */ 00749 size_t 00750 NaoJointPositionInterface::maxlenof_r_shoulder_roll() const 00751 { 00752 return 1; 00753 } 00754 00755 /** Set r_shoulder_roll value. 00756 * Right shoulder roll 00757 * @param new_r_shoulder_roll new r_shoulder_roll value 00758 */ 00759 void 00760 NaoJointPositionInterface::set_r_shoulder_roll(const float new_r_shoulder_roll) 00761 { 00762 data->r_shoulder_roll = new_r_shoulder_roll; 00763 data_changed = true; 00764 } 00765 00766 /** Get r_elbow_yaw value. 00767 * Right elbow yaw 00768 * @return r_elbow_yaw value 00769 */ 00770 float 00771 NaoJointPositionInterface::r_elbow_yaw() const 00772 { 00773 return data->r_elbow_yaw; 00774 } 00775 00776 /** Get maximum length of r_elbow_yaw value. 00777 * @return length of r_elbow_yaw value, can be length of the array or number of 00778 * maximum number of characters for a string 00779 */ 00780 size_t 00781 NaoJointPositionInterface::maxlenof_r_elbow_yaw() const 00782 { 00783 return 1; 00784 } 00785 00786 /** Set r_elbow_yaw value. 00787 * Right elbow yaw 00788 * @param new_r_elbow_yaw new r_elbow_yaw value 00789 */ 00790 void 00791 NaoJointPositionInterface::set_r_elbow_yaw(const float new_r_elbow_yaw) 00792 { 00793 data->r_elbow_yaw = new_r_elbow_yaw; 00794 data_changed = true; 00795 } 00796 00797 /** Get r_elbow_roll value. 00798 * Right elbow roll 00799 * @return r_elbow_roll value 00800 */ 00801 float 00802 NaoJointPositionInterface::r_elbow_roll() const 00803 { 00804 return data->r_elbow_roll; 00805 } 00806 00807 /** Get maximum length of r_elbow_roll value. 00808 * @return length of r_elbow_roll value, can be length of the array or number of 00809 * maximum number of characters for a string 00810 */ 00811 size_t 00812 NaoJointPositionInterface::maxlenof_r_elbow_roll() const 00813 { 00814 return 1; 00815 } 00816 00817 /** Set r_elbow_roll value. 00818 * Right elbow roll 00819 * @param new_r_elbow_roll new r_elbow_roll value 00820 */ 00821 void 00822 NaoJointPositionInterface::set_r_elbow_roll(const float new_r_elbow_roll) 00823 { 00824 data->r_elbow_roll = new_r_elbow_roll; 00825 data_changed = true; 00826 } 00827 00828 /** Get r_wrist_yaw value. 00829 * Right wrist yaw 00830 * @return r_wrist_yaw value 00831 */ 00832 float 00833 NaoJointPositionInterface::r_wrist_yaw() const 00834 { 00835 return data->r_wrist_yaw; 00836 } 00837 00838 /** Get maximum length of r_wrist_yaw value. 00839 * @return length of r_wrist_yaw value, can be length of the array or number of 00840 * maximum number of characters for a string 00841 */ 00842 size_t 00843 NaoJointPositionInterface::maxlenof_r_wrist_yaw() const 00844 { 00845 return 1; 00846 } 00847 00848 /** Set r_wrist_yaw value. 00849 * Right wrist yaw 00850 * @param new_r_wrist_yaw new r_wrist_yaw value 00851 */ 00852 void 00853 NaoJointPositionInterface::set_r_wrist_yaw(const float new_r_wrist_yaw) 00854 { 00855 data->r_wrist_yaw = new_r_wrist_yaw; 00856 data_changed = true; 00857 } 00858 00859 /** Get r_hand value. 00860 * Right hand 00861 * @return r_hand value 00862 */ 00863 float 00864 NaoJointPositionInterface::r_hand() const 00865 { 00866 return data->r_hand; 00867 } 00868 00869 /** Get maximum length of r_hand value. 00870 * @return length of r_hand value, can be length of the array or number of 00871 * maximum number of characters for a string 00872 */ 00873 size_t 00874 NaoJointPositionInterface::maxlenof_r_hand() const 00875 { 00876 return 1; 00877 } 00878 00879 /** Set r_hand value. 00880 * Right hand 00881 * @param new_r_hand new r_hand value 00882 */ 00883 void 00884 NaoJointPositionInterface::set_r_hand(const float new_r_hand) 00885 { 00886 data->r_hand = new_r_hand; 00887 data_changed = true; 00888 } 00889 00890 /** Get r_hip_yaw_pitch value. 00891 * Right hip yaw pitch 00892 * @return r_hip_yaw_pitch value 00893 */ 00894 float 00895 NaoJointPositionInterface::r_hip_yaw_pitch() const 00896 { 00897 return data->r_hip_yaw_pitch; 00898 } 00899 00900 /** Get maximum length of r_hip_yaw_pitch value. 00901 * @return length of r_hip_yaw_pitch value, can be length of the array or number of 00902 * maximum number of characters for a string 00903 */ 00904 size_t 00905 NaoJointPositionInterface::maxlenof_r_hip_yaw_pitch() const 00906 { 00907 return 1; 00908 } 00909 00910 /** Set r_hip_yaw_pitch value. 00911 * Right hip yaw pitch 00912 * @param new_r_hip_yaw_pitch new r_hip_yaw_pitch value 00913 */ 00914 void 00915 NaoJointPositionInterface::set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch) 00916 { 00917 data->r_hip_yaw_pitch = new_r_hip_yaw_pitch; 00918 data_changed = true; 00919 } 00920 00921 /** Get r_hip_roll value. 00922 * Right hip roll 00923 * @return r_hip_roll value 00924 */ 00925 float 00926 NaoJointPositionInterface::r_hip_roll() const 00927 { 00928 return data->r_hip_roll; 00929 } 00930 00931 /** Get maximum length of r_hip_roll value. 00932 * @return length of r_hip_roll value, can be length of the array or number of 00933 * maximum number of characters for a string 00934 */ 00935 size_t 00936 NaoJointPositionInterface::maxlenof_r_hip_roll() const 00937 { 00938 return 1; 00939 } 00940 00941 /** Set r_hip_roll value. 00942 * Right hip roll 00943 * @param new_r_hip_roll new r_hip_roll value 00944 */ 00945 void 00946 NaoJointPositionInterface::set_r_hip_roll(const float new_r_hip_roll) 00947 { 00948 data->r_hip_roll = new_r_hip_roll; 00949 data_changed = true; 00950 } 00951 00952 /** Get r_hip_pitch value. 00953 * Right hip pitch 00954 * @return r_hip_pitch value 00955 */ 00956 float 00957 NaoJointPositionInterface::r_hip_pitch() const 00958 { 00959 return data->r_hip_pitch; 00960 } 00961 00962 /** Get maximum length of r_hip_pitch value. 00963 * @return length of r_hip_pitch value, can be length of the array or number of 00964 * maximum number of characters for a string 00965 */ 00966 size_t 00967 NaoJointPositionInterface::maxlenof_r_hip_pitch() const 00968 { 00969 return 1; 00970 } 00971 00972 /** Set r_hip_pitch value. 00973 * Right hip pitch 00974 * @param new_r_hip_pitch new r_hip_pitch value 00975 */ 00976 void 00977 NaoJointPositionInterface::set_r_hip_pitch(const float new_r_hip_pitch) 00978 { 00979 data->r_hip_pitch = new_r_hip_pitch; 00980 data_changed = true; 00981 } 00982 00983 /** Get r_knee_pitch value. 00984 * Right knee pitch 00985 * @return r_knee_pitch value 00986 */ 00987 float 00988 NaoJointPositionInterface::r_knee_pitch() const 00989 { 00990 return data->r_knee_pitch; 00991 } 00992 00993 /** Get maximum length of r_knee_pitch value. 00994 * @return length of r_knee_pitch value, can be length of the array or number of 00995 * maximum number of characters for a string 00996 */ 00997 size_t 00998 NaoJointPositionInterface::maxlenof_r_knee_pitch() const 00999 { 01000 return 1; 01001 } 01002 01003 /** Set r_knee_pitch value. 01004 * Right knee pitch 01005 * @param new_r_knee_pitch new r_knee_pitch value 01006 */ 01007 void 01008 NaoJointPositionInterface::set_r_knee_pitch(const float new_r_knee_pitch) 01009 { 01010 data->r_knee_pitch = new_r_knee_pitch; 01011 data_changed = true; 01012 } 01013 01014 /** Get r_ankle_pitch value. 01015 * Right ankle pitch 01016 * @return r_ankle_pitch value 01017 */ 01018 float 01019 NaoJointPositionInterface::r_ankle_pitch() const 01020 { 01021 return data->r_ankle_pitch; 01022 } 01023 01024 /** Get maximum length of r_ankle_pitch value. 01025 * @return length of r_ankle_pitch value, can be length of the array or number of 01026 * maximum number of characters for a string 01027 */ 01028 size_t 01029 NaoJointPositionInterface::maxlenof_r_ankle_pitch() const 01030 { 01031 return 1; 01032 } 01033 01034 /** Set r_ankle_pitch value. 01035 * Right ankle pitch 01036 * @param new_r_ankle_pitch new r_ankle_pitch value 01037 */ 01038 void 01039 NaoJointPositionInterface::set_r_ankle_pitch(const float new_r_ankle_pitch) 01040 { 01041 data->r_ankle_pitch = new_r_ankle_pitch; 01042 data_changed = true; 01043 } 01044 01045 /** Get r_ankle_roll value. 01046 * Right ankle roll 01047 * @return r_ankle_roll value 01048 */ 01049 float 01050 NaoJointPositionInterface::r_ankle_roll() const 01051 { 01052 return data->r_ankle_roll; 01053 } 01054 01055 /** Get maximum length of r_ankle_roll value. 01056 * @return length of r_ankle_roll value, can be length of the array or number of 01057 * maximum number of characters for a string 01058 */ 01059 size_t 01060 NaoJointPositionInterface::maxlenof_r_ankle_roll() const 01061 { 01062 return 1; 01063 } 01064 01065 /** Set r_ankle_roll value. 01066 * Right ankle roll 01067 * @param new_r_ankle_roll new r_ankle_roll value 01068 */ 01069 void 01070 NaoJointPositionInterface::set_r_ankle_roll(const float new_r_ankle_roll) 01071 { 01072 data->r_ankle_roll = new_r_ankle_roll; 01073 data_changed = true; 01074 } 01075 01076 /** Get time value. 01077 * 01078 Current reference time in ms. For real hardware this is the DCM time. 01079 Times in messages are always offsets to the current time and the current 01080 time is added before executing the command. 01081 01082 * @return time value 01083 */ 01084 int32_t 01085 NaoJointPositionInterface::time() const 01086 { 01087 return data->time; 01088 } 01089 01090 /** Get maximum length of time value. 01091 * @return length of time value, can be length of the array or number of 01092 * maximum number of characters for a string 01093 */ 01094 size_t 01095 NaoJointPositionInterface::maxlenof_time() const 01096 { 01097 return 1; 01098 } 01099 01100 /** Set time value. 01101 * 01102 Current reference time in ms. For real hardware this is the DCM time. 01103 Times in messages are always offsets to the current time and the current 01104 time is added before executing the command. 01105 01106 * @param new_time new time value 01107 */ 01108 void 01109 NaoJointPositionInterface::set_time(const int32_t new_time) 01110 { 01111 data->time = new_time; 01112 data_changed = true; 01113 } 01114 01115 /* =========== message create =========== */ 01116 Message * 01117 NaoJointPositionInterface::create_message(const char *type) const 01118 { 01119 if ( strncmp("SetServoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 01120 return new SetServoMessage(); 01121 } else if ( strncmp("SetServosMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 01122 return new SetServosMessage(); 01123 } else if ( strncmp("MoveServoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 01124 return new MoveServoMessage(); 01125 } else if ( strncmp("MoveServosMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 01126 return new MoveServosMessage(); 01127 } else { 01128 throw UnknownTypeException("The given type '%s' does not match any known " 01129 "message type for this interface type.", type); 01130 } 01131 } 01132 01133 01134 /** Copy values from other interface. 01135 * @param other other interface to copy values from 01136 */ 01137 void 01138 NaoJointPositionInterface::copy_values(const Interface *other) 01139 { 01140 const NaoJointPositionInterface *oi = dynamic_cast<const NaoJointPositionInterface *>(other); 01141 if (oi == NULL) { 01142 throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)", 01143 type(), other->type()); 01144 } 01145 memcpy(data, oi->data, sizeof(NaoJointPositionInterface_data_t)); 01146 } 01147 01148 const char * 01149 NaoJointPositionInterface::enum_tostring(const char *enumtype, int val) const 01150 { 01151 if (strcmp(enumtype, "RobotType") == 0) { 01152 return tostring_RobotType((RobotType)val); 01153 } 01154 throw UnknownTypeException("Unknown enum type %s", enumtype); 01155 } 01156 01157 /* =========== messages =========== */ 01158 /** @class NaoJointPositionInterface::SetServoMessage <interfaces/NaoJointPositionInterface.h> 01159 * SetServoMessage Fawkes BlackBoard Interface Message. 01160 * 01161 01162 */ 01163 01164 01165 /** Constructor with initial values. 01166 * @param ini_servo initial value for servo 01167 * @param ini_value initial value for value 01168 * @param ini_time initial value for time 01169 */ 01170 NaoJointPositionInterface::SetServoMessage::SetServoMessage(const uint32_t ini_servo, const float ini_value, const int32_t ini_time) : Message("SetServoMessage") 01171 { 01172 data_size = sizeof(SetServoMessage_data_t); 01173 data_ptr = malloc(data_size); 01174 memset(data_ptr, 0, data_size); 01175 data = (SetServoMessage_data_t *)data_ptr; 01176 data_ts = (message_data_ts_t *)data_ptr; 01177 data->servo = ini_servo; 01178 data->value = ini_value; 01179 data->time = ini_time; 01180 add_fieldinfo(IFT_UINT32, "servo", 1, &data->servo); 01181 add_fieldinfo(IFT_FLOAT, "value", 1, &data->value); 01182 add_fieldinfo(IFT_INT32, "time", 1, &data->time); 01183 } 01184 /** Constructor */ 01185 NaoJointPositionInterface::SetServoMessage::SetServoMessage() : Message("SetServoMessage") 01186 { 01187 data_size = sizeof(SetServoMessage_data_t); 01188 data_ptr = malloc(data_size); 01189 memset(data_ptr, 0, data_size); 01190 data = (SetServoMessage_data_t *)data_ptr; 01191 data_ts = (message_data_ts_t *)data_ptr; 01192 add_fieldinfo(IFT_UINT32, "servo", 1, &data->servo); 01193 add_fieldinfo(IFT_FLOAT, "value", 1, &data->value); 01194 add_fieldinfo(IFT_INT32, "time", 1, &data->time); 01195 } 01196 01197 /** Destructor */ 01198 NaoJointPositionInterface::SetServoMessage::~SetServoMessage() 01199 { 01200 free(data_ptr); 01201 } 01202 01203 /** Copy constructor. 01204 * @param m message to copy from 01205 */ 01206 NaoJointPositionInterface::SetServoMessage::SetServoMessage(const SetServoMessage *m) : Message("SetServoMessage") 01207 { 01208 data_size = m->data_size; 01209 data_ptr = malloc(data_size); 01210 memcpy(data_ptr, m->data_ptr, data_size); 01211 data = (SetServoMessage_data_t *)data_ptr; 01212 data_ts = (message_data_ts_t *)data_ptr; 01213 } 01214 01215 /* Methods */ 01216 /** Get servo value. 01217 * A concatenated list of SERVO_* constants to 01218 define the servos that should execute the movement. The list shall consist of 01219 binary or'ed SERVO_* constants. 01220 * @return servo value 01221 */ 01222 uint32_t 01223 NaoJointPositionInterface::SetServoMessage::servo() const 01224 { 01225 return data->servo; 01226 } 01227 01228 /** Get maximum length of servo value. 01229 * @return length of servo value, can be length of the array or number of 01230 * maximum number of characters for a string 01231 */ 01232 size_t 01233 NaoJointPositionInterface::SetServoMessage::maxlenof_servo() const 01234 { 01235 return 1; 01236 } 01237 01238 /** Set servo value. 01239 * A concatenated list of SERVO_* constants to 01240 define the servos that should execute the movement. The list shall consist of 01241 binary or'ed SERVO_* constants. 01242 * @param new_servo new servo value 01243 */ 01244 void 01245 NaoJointPositionInterface::SetServoMessage::set_servo(const uint32_t new_servo) 01246 { 01247 data->servo = new_servo; 01248 } 01249 01250 /** Get value value. 01251 * Servo value to set for servos. 01252 * @return value value 01253 */ 01254 float 01255 NaoJointPositionInterface::SetServoMessage::value() const 01256 { 01257 return data->value; 01258 } 01259 01260 /** Get maximum length of value value. 01261 * @return length of value value, can be length of the array or number of 01262 * maximum number of characters for a string 01263 */ 01264 size_t 01265 NaoJointPositionInterface::SetServoMessage::maxlenof_value() const 01266 { 01267 return 1; 01268 } 01269 01270 /** Set value value. 01271 * Servo value to set for servos. 01272 * @param new_value new value value 01273 */ 01274 void 01275 NaoJointPositionInterface::SetServoMessage::set_value(const float new_value) 01276 { 01277 data->value = new_value; 01278 } 01279 01280 /** Get time value. 01281 * 01282 Current reference time in ms. For real hardware this is the DCM time. 01283 Times in messages are always offsets to the current time and the current 01284 time is added before executing the command. 01285 01286 * @return time value 01287 */ 01288 int32_t 01289 NaoJointPositionInterface::SetServoMessage::time() const 01290 { 01291 return data->time; 01292 } 01293 01294 /** Get maximum length of time value. 01295 * @return length of time value, can be length of the array or number of 01296 * maximum number of characters for a string 01297 */ 01298 size_t 01299 NaoJointPositionInterface::SetServoMessage::maxlenof_time() const 01300 { 01301 return 1; 01302 } 01303 01304 /** Set time value. 01305 * 01306 Current reference time in ms. For real hardware this is the DCM time. 01307 Times in messages are always offsets to the current time and the current 01308 time is added before executing the command. 01309 01310 * @param new_time new time value 01311 */ 01312 void 01313 NaoJointPositionInterface::SetServoMessage::set_time(const int32_t new_time) 01314 { 01315 data->time = new_time; 01316 } 01317 01318 /** Clone this message. 01319 * Produces a message of the same type as this message and copies the 01320 * data to the new message. 01321 * @return clone of this message 01322 */ 01323 Message * 01324 NaoJointPositionInterface::SetServoMessage::clone() const 01325 { 01326 return new NaoJointPositionInterface::SetServoMessage(this); 01327 } 01328 /** @class NaoJointPositionInterface::SetServosMessage <interfaces/NaoJointPositionInterface.h> 01329 * SetServosMessage Fawkes BlackBoard Interface Message. 01330 * 01331 01332 */ 01333 01334 01335 /** Constructor with initial values. 01336 * @param ini_head_yaw initial value for head_yaw 01337 * @param ini_head_pitch initial value for head_pitch 01338 * @param ini_l_shoulder_pitch initial value for l_shoulder_pitch 01339 * @param ini_l_shoulder_roll initial value for l_shoulder_roll 01340 * @param ini_l_elbow_yaw initial value for l_elbow_yaw 01341 * @param ini_l_elbow_roll initial value for l_elbow_roll 01342 * @param ini_l_hip_yaw_pitch initial value for l_hip_yaw_pitch 01343 * @param ini_l_hip_roll initial value for l_hip_roll 01344 * @param ini_l_hip_pitch initial value for l_hip_pitch 01345 * @param ini_l_knee_pitch initial value for l_knee_pitch 01346 * @param ini_l_ankle_pitch initial value for l_ankle_pitch 01347 * @param ini_l_ankle_roll initial value for l_ankle_roll 01348 * @param ini_l_wrist_yaw initial value for l_wrist_yaw 01349 * @param ini_l_hand initial value for l_hand 01350 * @param ini_r_shoulder_pitch initial value for r_shoulder_pitch 01351 * @param ini_r_shoulder_roll initial value for r_shoulder_roll 01352 * @param ini_r_elbow_yaw initial value for r_elbow_yaw 01353 * @param ini_r_elbow_roll initial value for r_elbow_roll 01354 * @param ini_r_wrist_yaw initial value for r_wrist_yaw 01355 * @param ini_r_hand initial value for r_hand 01356 * @param ini_r_hip_yaw_pitch initial value for r_hip_yaw_pitch 01357 * @param ini_r_hip_roll initial value for r_hip_roll 01358 * @param ini_r_hip_pitch initial value for r_hip_pitch 01359 * @param ini_r_knee_pitch initial value for r_knee_pitch 01360 * @param ini_r_ankle_pitch initial value for r_ankle_pitch 01361 * @param ini_r_ankle_roll initial value for r_ankle_roll 01362 * @param ini_time initial value for time 01363 */ 01364 NaoJointPositionInterface::SetServosMessage::SetServosMessage(const float ini_head_yaw, const float ini_head_pitch, const float ini_l_shoulder_pitch, const float ini_l_shoulder_roll, const float ini_l_elbow_yaw, const float ini_l_elbow_roll, const float ini_l_hip_yaw_pitch, const float ini_l_hip_roll, const float ini_l_hip_pitch, const float ini_l_knee_pitch, const float ini_l_ankle_pitch, const float ini_l_ankle_roll, const float ini_l_wrist_yaw, const float ini_l_hand, const float ini_r_shoulder_pitch, const float ini_r_shoulder_roll, const float ini_r_elbow_yaw, const float ini_r_elbow_roll, const float ini_r_wrist_yaw, const float ini_r_hand, const float ini_r_hip_yaw_pitch, const float ini_r_hip_roll, const float ini_r_hip_pitch, const float ini_r_knee_pitch, const float ini_r_ankle_pitch, const float ini_r_ankle_roll, const int32_t ini_time) : Message("SetServosMessage") 01365 { 01366 data_size = sizeof(SetServosMessage_data_t); 01367 data_ptr = malloc(data_size); 01368 memset(data_ptr, 0, data_size); 01369 data = (SetServosMessage_data_t *)data_ptr; 01370 data_ts = (message_data_ts_t *)data_ptr; 01371 data->head_yaw = ini_head_yaw; 01372 data->head_pitch = ini_head_pitch; 01373 data->l_shoulder_pitch = ini_l_shoulder_pitch; 01374 data->l_shoulder_roll = ini_l_shoulder_roll; 01375 data->l_elbow_yaw = ini_l_elbow_yaw; 01376 data->l_elbow_roll = ini_l_elbow_roll; 01377 data->l_hip_yaw_pitch = ini_l_hip_yaw_pitch; 01378 data->l_hip_roll = ini_l_hip_roll; 01379 data->l_hip_pitch = ini_l_hip_pitch; 01380 data->l_knee_pitch = ini_l_knee_pitch; 01381 data->l_ankle_pitch = ini_l_ankle_pitch; 01382 data->l_ankle_roll = ini_l_ankle_roll; 01383 data->l_wrist_yaw = ini_l_wrist_yaw; 01384 data->l_hand = ini_l_hand; 01385 data->r_shoulder_pitch = ini_r_shoulder_pitch; 01386 data->r_shoulder_roll = ini_r_shoulder_roll; 01387 data->r_elbow_yaw = ini_r_elbow_yaw; 01388 data->r_elbow_roll = ini_r_elbow_roll; 01389 data->r_wrist_yaw = ini_r_wrist_yaw; 01390 data->r_hand = ini_r_hand; 01391 data->r_hip_yaw_pitch = ini_r_hip_yaw_pitch; 01392 data->r_hip_roll = ini_r_hip_roll; 01393 data->r_hip_pitch = ini_r_hip_pitch; 01394 data->r_knee_pitch = ini_r_knee_pitch; 01395 data->r_ankle_pitch = ini_r_ankle_pitch; 01396 data->r_ankle_roll = ini_r_ankle_roll; 01397 data->time = ini_time; 01398 add_fieldinfo(IFT_FLOAT, "head_yaw", 1, &data->head_yaw); 01399 add_fieldinfo(IFT_FLOAT, "head_pitch", 1, &data->head_pitch); 01400 add_fieldinfo(IFT_FLOAT, "l_shoulder_pitch", 1, &data->l_shoulder_pitch); 01401 add_fieldinfo(IFT_FLOAT, "l_shoulder_roll", 1, &data->l_shoulder_roll); 01402 add_fieldinfo(IFT_FLOAT, "l_elbow_yaw", 1, &data->l_elbow_yaw); 01403 add_fieldinfo(IFT_FLOAT, "l_elbow_roll", 1, &data->l_elbow_roll); 01404 add_fieldinfo(IFT_FLOAT, "l_hip_yaw_pitch", 1, &data->l_hip_yaw_pitch); 01405 add_fieldinfo(IFT_FLOAT, "l_hip_roll", 1, &data->l_hip_roll); 01406 add_fieldinfo(IFT_FLOAT, "l_hip_pitch", 1, &data->l_hip_pitch); 01407 add_fieldinfo(IFT_FLOAT, "l_knee_pitch", 1, &data->l_knee_pitch); 01408 add_fieldinfo(IFT_FLOAT, "l_ankle_pitch", 1, &data->l_ankle_pitch); 01409 add_fieldinfo(IFT_FLOAT, "l_ankle_roll", 1, &data->l_ankle_roll); 01410 add_fieldinfo(IFT_FLOAT, "l_wrist_yaw", 1, &data->l_wrist_yaw); 01411 add_fieldinfo(IFT_FLOAT, "l_hand", 1, &data->l_hand); 01412 add_fieldinfo(IFT_FLOAT, "r_shoulder_pitch", 1, &data->r_shoulder_pitch); 01413 add_fieldinfo(IFT_FLOAT, "r_shoulder_roll", 1, &data->r_shoulder_roll); 01414 add_fieldinfo(IFT_FLOAT, "r_elbow_yaw", 1, &data->r_elbow_yaw); 01415 add_fieldinfo(IFT_FLOAT, "r_elbow_roll", 1, &data->r_elbow_roll); 01416 add_fieldinfo(IFT_FLOAT, "r_wrist_yaw", 1, &data->r_wrist_yaw); 01417 add_fieldinfo(IFT_FLOAT, "r_hand", 1, &data->r_hand); 01418 add_fieldinfo(IFT_FLOAT, "r_hip_yaw_pitch", 1, &data->r_hip_yaw_pitch); 01419 add_fieldinfo(IFT_FLOAT, "r_hip_roll", 1, &data->r_hip_roll); 01420 add_fieldinfo(IFT_FLOAT, "r_hip_pitch", 1, &data->r_hip_pitch); 01421 add_fieldinfo(IFT_FLOAT, "r_knee_pitch", 1, &data->r_knee_pitch); 01422 add_fieldinfo(IFT_FLOAT, "r_ankle_pitch", 1, &data->r_ankle_pitch); 01423 add_fieldinfo(IFT_FLOAT, "r_ankle_roll", 1, &data->r_ankle_roll); 01424 add_fieldinfo(IFT_INT32, "time", 1, &data->time); 01425 } 01426 /** Constructor */ 01427 NaoJointPositionInterface::SetServosMessage::SetServosMessage() : Message("SetServosMessage") 01428 { 01429 data_size = sizeof(SetServosMessage_data_t); 01430 data_ptr = malloc(data_size); 01431 memset(data_ptr, 0, data_size); 01432 data = (SetServosMessage_data_t *)data_ptr; 01433 data_ts = (message_data_ts_t *)data_ptr; 01434 add_fieldinfo(IFT_FLOAT, "head_yaw", 1, &data->head_yaw); 01435 add_fieldinfo(IFT_FLOAT, "head_pitch", 1, &data->head_pitch); 01436 add_fieldinfo(IFT_FLOAT, "l_shoulder_pitch", 1, &data->l_shoulder_pitch); 01437 add_fieldinfo(IFT_FLOAT, "l_shoulder_roll", 1, &data->l_shoulder_roll); 01438 add_fieldinfo(IFT_FLOAT, "l_elbow_yaw", 1, &data->l_elbow_yaw); 01439 add_fieldinfo(IFT_FLOAT, "l_elbow_roll", 1, &data->l_elbow_roll); 01440 add_fieldinfo(IFT_FLOAT, "l_hip_yaw_pitch", 1, &data->l_hip_yaw_pitch); 01441 add_fieldinfo(IFT_FLOAT, "l_hip_roll", 1, &data->l_hip_roll); 01442 add_fieldinfo(IFT_FLOAT, "l_hip_pitch", 1, &data->l_hip_pitch); 01443 add_fieldinfo(IFT_FLOAT, "l_knee_pitch", 1, &data->l_knee_pitch); 01444 add_fieldinfo(IFT_FLOAT, "l_ankle_pitch", 1, &data->l_ankle_pitch); 01445 add_fieldinfo(IFT_FLOAT, "l_ankle_roll", 1, &data->l_ankle_roll); 01446 add_fieldinfo(IFT_FLOAT, "l_wrist_yaw", 1, &data->l_wrist_yaw); 01447 add_fieldinfo(IFT_FLOAT, "l_hand", 1, &data->l_hand); 01448 add_fieldinfo(IFT_FLOAT, "r_shoulder_pitch", 1, &data->r_shoulder_pitch); 01449 add_fieldinfo(IFT_FLOAT, "r_shoulder_roll", 1, &data->r_shoulder_roll); 01450 add_fieldinfo(IFT_FLOAT, "r_elbow_yaw", 1, &data->r_elbow_yaw); 01451 add_fieldinfo(IFT_FLOAT, "r_elbow_roll", 1, &data->r_elbow_roll); 01452 add_fieldinfo(IFT_FLOAT, "r_wrist_yaw", 1, &data->r_wrist_yaw); 01453 add_fieldinfo(IFT_FLOAT, "r_hand", 1, &data->r_hand); 01454 add_fieldinfo(IFT_FLOAT, "r_hip_yaw_pitch", 1, &data->r_hip_yaw_pitch); 01455 add_fieldinfo(IFT_FLOAT, "r_hip_roll", 1, &data->r_hip_roll); 01456 add_fieldinfo(IFT_FLOAT, "r_hip_pitch", 1, &data->r_hip_pitch); 01457 add_fieldinfo(IFT_FLOAT, "r_knee_pitch", 1, &data->r_knee_pitch); 01458 add_fieldinfo(IFT_FLOAT, "r_ankle_pitch", 1, &data->r_ankle_pitch); 01459 add_fieldinfo(IFT_FLOAT, "r_ankle_roll", 1, &data->r_ankle_roll); 01460 add_fieldinfo(IFT_INT32, "time", 1, &data->time); 01461 } 01462 01463 /** Destructor */ 01464 NaoJointPositionInterface::SetServosMessage::~SetServosMessage() 01465 { 01466 free(data_ptr); 01467 } 01468 01469 /** Copy constructor. 01470 * @param m message to copy from 01471 */ 01472 NaoJointPositionInterface::SetServosMessage::SetServosMessage(const SetServosMessage *m) : Message("SetServosMessage") 01473 { 01474 data_size = m->data_size; 01475 data_ptr = malloc(data_size); 01476 memcpy(data_ptr, m->data_ptr, data_size); 01477 data = (SetServosMessage_data_t *)data_ptr; 01478 data_ts = (message_data_ts_t *)data_ptr; 01479 } 01480 01481 /* Methods */ 01482 /** Get head_yaw value. 01483 * Head yaw 01484 * @return head_yaw value 01485 */ 01486 float 01487 NaoJointPositionInterface::SetServosMessage::head_yaw() const 01488 { 01489 return data->head_yaw; 01490 } 01491 01492 /** Get maximum length of head_yaw value. 01493 * @return length of head_yaw value, can be length of the array or number of 01494 * maximum number of characters for a string 01495 */ 01496 size_t 01497 NaoJointPositionInterface::SetServosMessage::maxlenof_head_yaw() const 01498 { 01499 return 1; 01500 } 01501 01502 /** Set head_yaw value. 01503 * Head yaw 01504 * @param new_head_yaw new head_yaw value 01505 */ 01506 void 01507 NaoJointPositionInterface::SetServosMessage::set_head_yaw(const float new_head_yaw) 01508 { 01509 data->head_yaw = new_head_yaw; 01510 } 01511 01512 /** Get head_pitch value. 01513 * Head pitch 01514 * @return head_pitch value 01515 */ 01516 float 01517 NaoJointPositionInterface::SetServosMessage::head_pitch() const 01518 { 01519 return data->head_pitch; 01520 } 01521 01522 /** Get maximum length of head_pitch value. 01523 * @return length of head_pitch value, can be length of the array or number of 01524 * maximum number of characters for a string 01525 */ 01526 size_t 01527 NaoJointPositionInterface::SetServosMessage::maxlenof_head_pitch() const 01528 { 01529 return 1; 01530 } 01531 01532 /** Set head_pitch value. 01533 * Head pitch 01534 * @param new_head_pitch new head_pitch value 01535 */ 01536 void 01537 NaoJointPositionInterface::SetServosMessage::set_head_pitch(const float new_head_pitch) 01538 { 01539 data->head_pitch = new_head_pitch; 01540 } 01541 01542 /** Get l_shoulder_pitch value. 01543 * Left shoulder pitch 01544 * @return l_shoulder_pitch value 01545 */ 01546 float 01547 NaoJointPositionInterface::SetServosMessage::l_shoulder_pitch() const 01548 { 01549 return data->l_shoulder_pitch; 01550 } 01551 01552 /** Get maximum length of l_shoulder_pitch value. 01553 * @return length of l_shoulder_pitch value, can be length of the array or number of 01554 * maximum number of characters for a string 01555 */ 01556 size_t 01557 NaoJointPositionInterface::SetServosMessage::maxlenof_l_shoulder_pitch() const 01558 { 01559 return 1; 01560 } 01561 01562 /** Set l_shoulder_pitch value. 01563 * Left shoulder pitch 01564 * @param new_l_shoulder_pitch new l_shoulder_pitch value 01565 */ 01566 void 01567 NaoJointPositionInterface::SetServosMessage::set_l_shoulder_pitch(const float new_l_shoulder_pitch) 01568 { 01569 data->l_shoulder_pitch = new_l_shoulder_pitch; 01570 } 01571 01572 /** Get l_shoulder_roll value. 01573 * Left shoulder roll 01574 * @return l_shoulder_roll value 01575 */ 01576 float 01577 NaoJointPositionInterface::SetServosMessage::l_shoulder_roll() const 01578 { 01579 return data->l_shoulder_roll; 01580 } 01581 01582 /** Get maximum length of l_shoulder_roll value. 01583 * @return length of l_shoulder_roll value, can be length of the array or number of 01584 * maximum number of characters for a string 01585 */ 01586 size_t 01587 NaoJointPositionInterface::SetServosMessage::maxlenof_l_shoulder_roll() const 01588 { 01589 return 1; 01590 } 01591 01592 /** Set l_shoulder_roll value. 01593 * Left shoulder roll 01594 * @param new_l_shoulder_roll new l_shoulder_roll value 01595 */ 01596 void 01597 NaoJointPositionInterface::SetServosMessage::set_l_shoulder_roll(const float new_l_shoulder_roll) 01598 { 01599 data->l_shoulder_roll = new_l_shoulder_roll; 01600 } 01601 01602 /** Get l_elbow_yaw value. 01603 * Left elbow yaw 01604 * @return l_elbow_yaw value 01605 */ 01606 float 01607 NaoJointPositionInterface::SetServosMessage::l_elbow_yaw() const 01608 { 01609 return data->l_elbow_yaw; 01610 } 01611 01612 /** Get maximum length of l_elbow_yaw value. 01613 * @return length of l_elbow_yaw value, can be length of the array or number of 01614 * maximum number of characters for a string 01615 */ 01616 size_t 01617 NaoJointPositionInterface::SetServosMessage::maxlenof_l_elbow_yaw() const 01618 { 01619 return 1; 01620 } 01621 01622 /** Set l_elbow_yaw value. 01623 * Left elbow yaw 01624 * @param new_l_elbow_yaw new l_elbow_yaw value 01625 */ 01626 void 01627 NaoJointPositionInterface::SetServosMessage::set_l_elbow_yaw(const float new_l_elbow_yaw) 01628 { 01629 data->l_elbow_yaw = new_l_elbow_yaw; 01630 } 01631 01632 /** Get l_elbow_roll value. 01633 * Left elbow roll 01634 * @return l_elbow_roll value 01635 */ 01636 float 01637 NaoJointPositionInterface::SetServosMessage::l_elbow_roll() const 01638 { 01639 return data->l_elbow_roll; 01640 } 01641 01642 /** Get maximum length of l_elbow_roll value. 01643 * @return length of l_elbow_roll value, can be length of the array or number of 01644 * maximum number of characters for a string 01645 */ 01646 size_t 01647 NaoJointPositionInterface::SetServosMessage::maxlenof_l_elbow_roll() const 01648 { 01649 return 1; 01650 } 01651 01652 /** Set l_elbow_roll value. 01653 * Left elbow roll 01654 * @param new_l_elbow_roll new l_elbow_roll value 01655 */ 01656 void 01657 NaoJointPositionInterface::SetServosMessage::set_l_elbow_roll(const float new_l_elbow_roll) 01658 { 01659 data->l_elbow_roll = new_l_elbow_roll; 01660 } 01661 01662 /** Get l_hip_yaw_pitch value. 01663 * Left hip yaw pitch 01664 * @return l_hip_yaw_pitch value 01665 */ 01666 float 01667 NaoJointPositionInterface::SetServosMessage::l_hip_yaw_pitch() const 01668 { 01669 return data->l_hip_yaw_pitch; 01670 } 01671 01672 /** Get maximum length of l_hip_yaw_pitch value. 01673 * @return length of l_hip_yaw_pitch value, can be length of the array or number of 01674 * maximum number of characters for a string 01675 */ 01676 size_t 01677 NaoJointPositionInterface::SetServosMessage::maxlenof_l_hip_yaw_pitch() const 01678 { 01679 return 1; 01680 } 01681 01682 /** Set l_hip_yaw_pitch value. 01683 * Left hip yaw pitch 01684 * @param new_l_hip_yaw_pitch new l_hip_yaw_pitch value 01685 */ 01686 void 01687 NaoJointPositionInterface::SetServosMessage::set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch) 01688 { 01689 data->l_hip_yaw_pitch = new_l_hip_yaw_pitch; 01690 } 01691 01692 /** Get l_hip_roll value. 01693 * Left hip roll 01694 * @return l_hip_roll value 01695 */ 01696 float 01697 NaoJointPositionInterface::SetServosMessage::l_hip_roll() const 01698 { 01699 return data->l_hip_roll; 01700 } 01701 01702 /** Get maximum length of l_hip_roll value. 01703 * @return length of l_hip_roll value, can be length of the array or number of 01704 * maximum number of characters for a string 01705 */ 01706 size_t 01707 NaoJointPositionInterface::SetServosMessage::maxlenof_l_hip_roll() const 01708 { 01709 return 1; 01710 } 01711 01712 /** Set l_hip_roll value. 01713 * Left hip roll 01714 * @param new_l_hip_roll new l_hip_roll value 01715 */ 01716 void 01717 NaoJointPositionInterface::SetServosMessage::set_l_hip_roll(const float new_l_hip_roll) 01718 { 01719 data->l_hip_roll = new_l_hip_roll; 01720 } 01721 01722 /** Get l_hip_pitch value. 01723 * Left hip pitch 01724 * @return l_hip_pitch value 01725 */ 01726 float 01727 NaoJointPositionInterface::SetServosMessage::l_hip_pitch() const 01728 { 01729 return data->l_hip_pitch; 01730 } 01731 01732 /** Get maximum length of l_hip_pitch value. 01733 * @return length of l_hip_pitch value, can be length of the array or number of 01734 * maximum number of characters for a string 01735 */ 01736 size_t 01737 NaoJointPositionInterface::SetServosMessage::maxlenof_l_hip_pitch() const 01738 { 01739 return 1; 01740 } 01741 01742 /** Set l_hip_pitch value. 01743 * Left hip pitch 01744 * @param new_l_hip_pitch new l_hip_pitch value 01745 */ 01746 void 01747 NaoJointPositionInterface::SetServosMessage::set_l_hip_pitch(const float new_l_hip_pitch) 01748 { 01749 data->l_hip_pitch = new_l_hip_pitch; 01750 } 01751 01752 /** Get l_knee_pitch value. 01753 * Left knee pitch 01754 * @return l_knee_pitch value 01755 */ 01756 float 01757 NaoJointPositionInterface::SetServosMessage::l_knee_pitch() const 01758 { 01759 return data->l_knee_pitch; 01760 } 01761 01762 /** Get maximum length of l_knee_pitch value. 01763 * @return length of l_knee_pitch value, can be length of the array or number of 01764 * maximum number of characters for a string 01765 */ 01766 size_t 01767 NaoJointPositionInterface::SetServosMessage::maxlenof_l_knee_pitch() const 01768 { 01769 return 1; 01770 } 01771 01772 /** Set l_knee_pitch value. 01773 * Left knee pitch 01774 * @param new_l_knee_pitch new l_knee_pitch value 01775 */ 01776 void 01777 NaoJointPositionInterface::SetServosMessage::set_l_knee_pitch(const float new_l_knee_pitch) 01778 { 01779 data->l_knee_pitch = new_l_knee_pitch; 01780 } 01781 01782 /** Get l_ankle_pitch value. 01783 * Left ankle pitch 01784 * @return l_ankle_pitch value 01785 */ 01786 float 01787 NaoJointPositionInterface::SetServosMessage::l_ankle_pitch() const 01788 { 01789 return data->l_ankle_pitch; 01790 } 01791 01792 /** Get maximum length of l_ankle_pitch value. 01793 * @return length of l_ankle_pitch value, can be length of the array or number of 01794 * maximum number of characters for a string 01795 */ 01796 size_t 01797 NaoJointPositionInterface::SetServosMessage::maxlenof_l_ankle_pitch() const 01798 { 01799 return 1; 01800 } 01801 01802 /** Set l_ankle_pitch value. 01803 * Left ankle pitch 01804 * @param new_l_ankle_pitch new l_ankle_pitch value 01805 */ 01806 void 01807 NaoJointPositionInterface::SetServosMessage::set_l_ankle_pitch(const float new_l_ankle_pitch) 01808 { 01809 data->l_ankle_pitch = new_l_ankle_pitch; 01810 } 01811 01812 /** Get l_ankle_roll value. 01813 * Left ankle roll 01814 * @return l_ankle_roll value 01815 */ 01816 float 01817 NaoJointPositionInterface::SetServosMessage::l_ankle_roll() const 01818 { 01819 return data->l_ankle_roll; 01820 } 01821 01822 /** Get maximum length of l_ankle_roll value. 01823 * @return length of l_ankle_roll value, can be length of the array or number of 01824 * maximum number of characters for a string 01825 */ 01826 size_t 01827 NaoJointPositionInterface::SetServosMessage::maxlenof_l_ankle_roll() const 01828 { 01829 return 1; 01830 } 01831 01832 /** Set l_ankle_roll value. 01833 * Left ankle roll 01834 * @param new_l_ankle_roll new l_ankle_roll value 01835 */ 01836 void 01837 NaoJointPositionInterface::SetServosMessage::set_l_ankle_roll(const float new_l_ankle_roll) 01838 { 01839 data->l_ankle_roll = new_l_ankle_roll; 01840 } 01841 01842 /** Get l_wrist_yaw value. 01843 * Left wrist yaw 01844 * @return l_wrist_yaw value 01845 */ 01846 float 01847 NaoJointPositionInterface::SetServosMessage::l_wrist_yaw() const 01848 { 01849 return data->l_wrist_yaw; 01850 } 01851 01852 /** Get maximum length of l_wrist_yaw value. 01853 * @return length of l_wrist_yaw value, can be length of the array or number of 01854 * maximum number of characters for a string 01855 */ 01856 size_t 01857 NaoJointPositionInterface::SetServosMessage::maxlenof_l_wrist_yaw() const 01858 { 01859 return 1; 01860 } 01861 01862 /** Set l_wrist_yaw value. 01863 * Left wrist yaw 01864 * @param new_l_wrist_yaw new l_wrist_yaw value 01865 */ 01866 void 01867 NaoJointPositionInterface::SetServosMessage::set_l_wrist_yaw(const float new_l_wrist_yaw) 01868 { 01869 data->l_wrist_yaw = new_l_wrist_yaw; 01870 } 01871 01872 /** Get l_hand value. 01873 * Left hand 01874 * @return l_hand value 01875 */ 01876 float 01877 NaoJointPositionInterface::SetServosMessage::l_hand() const 01878 { 01879 return data->l_hand; 01880 } 01881 01882 /** Get maximum length of l_hand value. 01883 * @return length of l_hand value, can be length of the array or number of 01884 * maximum number of characters for a string 01885 */ 01886 size_t 01887 NaoJointPositionInterface::SetServosMessage::maxlenof_l_hand() const 01888 { 01889 return 1; 01890 } 01891 01892 /** Set l_hand value. 01893 * Left hand 01894 * @param new_l_hand new l_hand value 01895 */ 01896 void 01897 NaoJointPositionInterface::SetServosMessage::set_l_hand(const float new_l_hand) 01898 { 01899 data->l_hand = new_l_hand; 01900 } 01901 01902 /** Get r_shoulder_pitch value. 01903 * Right shoulder pitch 01904 * @return r_shoulder_pitch value 01905 */ 01906 float 01907 NaoJointPositionInterface::SetServosMessage::r_shoulder_pitch() const 01908 { 01909 return data->r_shoulder_pitch; 01910 } 01911 01912 /** Get maximum length of r_shoulder_pitch value. 01913 * @return length of r_shoulder_pitch value, can be length of the array or number of 01914 * maximum number of characters for a string 01915 */ 01916 size_t 01917 NaoJointPositionInterface::SetServosMessage::maxlenof_r_shoulder_pitch() const 01918 { 01919 return 1; 01920 } 01921 01922 /** Set r_shoulder_pitch value. 01923 * Right shoulder pitch 01924 * @param new_r_shoulder_pitch new r_shoulder_pitch value 01925 */ 01926 void 01927 NaoJointPositionInterface::SetServosMessage::set_r_shoulder_pitch(const float new_r_shoulder_pitch) 01928 { 01929 data->r_shoulder_pitch = new_r_shoulder_pitch; 01930 } 01931 01932 /** Get r_shoulder_roll value. 01933 * Right shoulder roll 01934 * @return r_shoulder_roll value 01935 */ 01936 float 01937 NaoJointPositionInterface::SetServosMessage::r_shoulder_roll() const 01938 { 01939 return data->r_shoulder_roll; 01940 } 01941 01942 /** Get maximum length of r_shoulder_roll value. 01943 * @return length of r_shoulder_roll value, can be length of the array or number of 01944 * maximum number of characters for a string 01945 */ 01946 size_t 01947 NaoJointPositionInterface::SetServosMessage::maxlenof_r_shoulder_roll() const 01948 { 01949 return 1; 01950 } 01951 01952 /** Set r_shoulder_roll value. 01953 * Right shoulder roll 01954 * @param new_r_shoulder_roll new r_shoulder_roll value 01955 */ 01956 void 01957 NaoJointPositionInterface::SetServosMessage::set_r_shoulder_roll(const float new_r_shoulder_roll) 01958 { 01959 data->r_shoulder_roll = new_r_shoulder_roll; 01960 } 01961 01962 /** Get r_elbow_yaw value. 01963 * Right elbow yaw 01964 * @return r_elbow_yaw value 01965 */ 01966 float 01967 NaoJointPositionInterface::SetServosMessage::r_elbow_yaw() const 01968 { 01969 return data->r_elbow_yaw; 01970 } 01971 01972 /** Get maximum length of r_elbow_yaw value. 01973 * @return length of r_elbow_yaw value, can be length of the array or number of 01974 * maximum number of characters for a string 01975 */ 01976 size_t 01977 NaoJointPositionInterface::SetServosMessage::maxlenof_r_elbow_yaw() const 01978 { 01979 return 1; 01980 } 01981 01982 /** Set r_elbow_yaw value. 01983 * Right elbow yaw 01984 * @param new_r_elbow_yaw new r_elbow_yaw value 01985 */ 01986 void 01987 NaoJointPositionInterface::SetServosMessage::set_r_elbow_yaw(const float new_r_elbow_yaw) 01988 { 01989 data->r_elbow_yaw = new_r_elbow_yaw; 01990 } 01991 01992 /** Get r_elbow_roll value. 01993 * Right elbow roll 01994 * @return r_elbow_roll value 01995 */ 01996 float 01997 NaoJointPositionInterface::SetServosMessage::r_elbow_roll() const 01998 { 01999 return data->r_elbow_roll; 02000 } 02001 02002 /** Get maximum length of r_elbow_roll value. 02003 * @return length of r_elbow_roll value, can be length of the array or number of 02004 * maximum number of characters for a string 02005 */ 02006 size_t 02007 NaoJointPositionInterface::SetServosMessage::maxlenof_r_elbow_roll() const 02008 { 02009 return 1; 02010 } 02011 02012 /** Set r_elbow_roll value. 02013 * Right elbow roll 02014 * @param new_r_elbow_roll new r_elbow_roll value 02015 */ 02016 void 02017 NaoJointPositionInterface::SetServosMessage::set_r_elbow_roll(const float new_r_elbow_roll) 02018 { 02019 data->r_elbow_roll = new_r_elbow_roll; 02020 } 02021 02022 /** Get r_wrist_yaw value. 02023 * Right wrist yaw 02024 * @return r_wrist_yaw value 02025 */ 02026 float 02027 NaoJointPositionInterface::SetServosMessage::r_wrist_yaw() const 02028 { 02029 return data->r_wrist_yaw; 02030 } 02031 02032 /** Get maximum length of r_wrist_yaw value. 02033 * @return length of r_wrist_yaw value, can be length of the array or number of 02034 * maximum number of characters for a string 02035 */ 02036 size_t 02037 NaoJointPositionInterface::SetServosMessage::maxlenof_r_wrist_yaw() const 02038 { 02039 return 1; 02040 } 02041 02042 /** Set r_wrist_yaw value. 02043 * Right wrist yaw 02044 * @param new_r_wrist_yaw new r_wrist_yaw value 02045 */ 02046 void 02047 NaoJointPositionInterface::SetServosMessage::set_r_wrist_yaw(const float new_r_wrist_yaw) 02048 { 02049 data->r_wrist_yaw = new_r_wrist_yaw; 02050 } 02051 02052 /** Get r_hand value. 02053 * Right hand 02054 * @return r_hand value 02055 */ 02056 float 02057 NaoJointPositionInterface::SetServosMessage::r_hand() const 02058 { 02059 return data->r_hand; 02060 } 02061 02062 /** Get maximum length of r_hand value. 02063 * @return length of r_hand value, can be length of the array or number of 02064 * maximum number of characters for a string 02065 */ 02066 size_t 02067 NaoJointPositionInterface::SetServosMessage::maxlenof_r_hand() const 02068 { 02069 return 1; 02070 } 02071 02072 /** Set r_hand value. 02073 * Right hand 02074 * @param new_r_hand new r_hand value 02075 */ 02076 void 02077 NaoJointPositionInterface::SetServosMessage::set_r_hand(const float new_r_hand) 02078 { 02079 data->r_hand = new_r_hand; 02080 } 02081 02082 /** Get r_hip_yaw_pitch value. 02083 * Right hip yaw pitch 02084 * @return r_hip_yaw_pitch value 02085 */ 02086 float 02087 NaoJointPositionInterface::SetServosMessage::r_hip_yaw_pitch() const 02088 { 02089 return data->r_hip_yaw_pitch; 02090 } 02091 02092 /** Get maximum length of r_hip_yaw_pitch value. 02093 * @return length of r_hip_yaw_pitch value, can be length of the array or number of 02094 * maximum number of characters for a string 02095 */ 02096 size_t 02097 NaoJointPositionInterface::SetServosMessage::maxlenof_r_hip_yaw_pitch() const 02098 { 02099 return 1; 02100 } 02101 02102 /** Set r_hip_yaw_pitch value. 02103 * Right hip yaw pitch 02104 * @param new_r_hip_yaw_pitch new r_hip_yaw_pitch value 02105 */ 02106 void 02107 NaoJointPositionInterface::SetServosMessage::set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch) 02108 { 02109 data->r_hip_yaw_pitch = new_r_hip_yaw_pitch; 02110 } 02111 02112 /** Get r_hip_roll value. 02113 * Right hip roll 02114 * @return r_hip_roll value 02115 */ 02116 float 02117 NaoJointPositionInterface::SetServosMessage::r_hip_roll() const 02118 { 02119 return data->r_hip_roll; 02120 } 02121 02122 /** Get maximum length of r_hip_roll value. 02123 * @return length of r_hip_roll value, can be length of the array or number of 02124 * maximum number of characters for a string 02125 */ 02126 size_t 02127 NaoJointPositionInterface::SetServosMessage::maxlenof_r_hip_roll() const 02128 { 02129 return 1; 02130 } 02131 02132 /** Set r_hip_roll value. 02133 * Right hip roll 02134 * @param new_r_hip_roll new r_hip_roll value 02135 */ 02136 void 02137 NaoJointPositionInterface::SetServosMessage::set_r_hip_roll(const float new_r_hip_roll) 02138 { 02139 data->r_hip_roll = new_r_hip_roll; 02140 } 02141 02142 /** Get r_hip_pitch value. 02143 * Right hip pitch 02144 * @return r_hip_pitch value 02145 */ 02146 float 02147 NaoJointPositionInterface::SetServosMessage::r_hip_pitch() const 02148 { 02149 return data->r_hip_pitch; 02150 } 02151 02152 /** Get maximum length of r_hip_pitch value. 02153 * @return length of r_hip_pitch value, can be length of the array or number of 02154 * maximum number of characters for a string 02155 */ 02156 size_t 02157 NaoJointPositionInterface::SetServosMessage::maxlenof_r_hip_pitch() const 02158 { 02159 return 1; 02160 } 02161 02162 /** Set r_hip_pitch value. 02163 * Right hip pitch 02164 * @param new_r_hip_pitch new r_hip_pitch value 02165 */ 02166 void 02167 NaoJointPositionInterface::SetServosMessage::set_r_hip_pitch(const float new_r_hip_pitch) 02168 { 02169 data->r_hip_pitch = new_r_hip_pitch; 02170 } 02171 02172 /** Get r_knee_pitch value. 02173 * Right knee pitch 02174 * @return r_knee_pitch value 02175 */ 02176 float 02177 NaoJointPositionInterface::SetServosMessage::r_knee_pitch() const 02178 { 02179 return data->r_knee_pitch; 02180 } 02181 02182 /** Get maximum length of r_knee_pitch value. 02183 * @return length of r_knee_pitch value, can be length of the array or number of 02184 * maximum number of characters for a string 02185 */ 02186 size_t 02187 NaoJointPositionInterface::SetServosMessage::maxlenof_r_knee_pitch() const 02188 { 02189 return 1; 02190 } 02191 02192 /** Set r_knee_pitch value. 02193 * Right knee pitch 02194 * @param new_r_knee_pitch new r_knee_pitch value 02195 */ 02196 void 02197 NaoJointPositionInterface::SetServosMessage::set_r_knee_pitch(const float new_r_knee_pitch) 02198 { 02199 data->r_knee_pitch = new_r_knee_pitch; 02200 } 02201 02202 /** Get r_ankle_pitch value. 02203 * Right ankle pitch 02204 * @return r_ankle_pitch value 02205 */ 02206 float 02207 NaoJointPositionInterface::SetServosMessage::r_ankle_pitch() const 02208 { 02209 return data->r_ankle_pitch; 02210 } 02211 02212 /** Get maximum length of r_ankle_pitch value. 02213 * @return length of r_ankle_pitch value, can be length of the array or number of 02214 * maximum number of characters for a string 02215 */ 02216 size_t 02217 NaoJointPositionInterface::SetServosMessage::maxlenof_r_ankle_pitch() const 02218 { 02219 return 1; 02220 } 02221 02222 /** Set r_ankle_pitch value. 02223 * Right ankle pitch 02224 * @param new_r_ankle_pitch new r_ankle_pitch value 02225 */ 02226 void 02227 NaoJointPositionInterface::SetServosMessage::set_r_ankle_pitch(const float new_r_ankle_pitch) 02228 { 02229 data->r_ankle_pitch = new_r_ankle_pitch; 02230 } 02231 02232 /** Get r_ankle_roll value. 02233 * Right ankle roll 02234 * @return r_ankle_roll value 02235 */ 02236 float 02237 NaoJointPositionInterface::SetServosMessage::r_ankle_roll() const 02238 { 02239 return data->r_ankle_roll; 02240 } 02241 02242 /** Get maximum length of r_ankle_roll value. 02243 * @return length of r_ankle_roll value, can be length of the array or number of 02244 * maximum number of characters for a string 02245 */ 02246 size_t 02247 NaoJointPositionInterface::SetServosMessage::maxlenof_r_ankle_roll() const 02248 { 02249 return 1; 02250 } 02251 02252 /** Set r_ankle_roll value. 02253 * Right ankle roll 02254 * @param new_r_ankle_roll new r_ankle_roll value 02255 */ 02256 void 02257 NaoJointPositionInterface::SetServosMessage::set_r_ankle_roll(const float new_r_ankle_roll) 02258 { 02259 data->r_ankle_roll = new_r_ankle_roll; 02260 } 02261 02262 /** Get time value. 02263 * 02264 Current reference time in ms. For real hardware this is the DCM time. 02265 Times in messages are always offsets to the current time and the current 02266 time is added before executing the command. 02267 02268 * @return time value 02269 */ 02270 int32_t 02271 NaoJointPositionInterface::SetServosMessage::time() const 02272 { 02273 return data->time; 02274 } 02275 02276 /** Get maximum length of time value. 02277 * @return length of time value, can be length of the array or number of 02278 * maximum number of characters for a string 02279 */ 02280 size_t 02281 NaoJointPositionInterface::SetServosMessage::maxlenof_time() const 02282 { 02283 return 1; 02284 } 02285 02286 /** Set time value. 02287 * 02288 Current reference time in ms. For real hardware this is the DCM time. 02289 Times in messages are always offsets to the current time and the current 02290 time is added before executing the command. 02291 02292 * @param new_time new time value 02293 */ 02294 void 02295 NaoJointPositionInterface::SetServosMessage::set_time(const int32_t new_time) 02296 { 02297 data->time = new_time; 02298 } 02299 02300 /** Clone this message. 02301 * Produces a message of the same type as this message and copies the 02302 * data to the new message. 02303 * @return clone of this message 02304 */ 02305 Message * 02306 NaoJointPositionInterface::SetServosMessage::clone() const 02307 { 02308 return new NaoJointPositionInterface::SetServosMessage(this); 02309 } 02310 /** @class NaoJointPositionInterface::MoveServoMessage <interfaces/NaoJointPositionInterface.h> 02311 * MoveServoMessage Fawkes BlackBoard Interface Message. 02312 * 02313 02314 */ 02315 02316 02317 /** Constructor with initial values. 02318 * @param ini_servo initial value for servo 02319 * @param ini_value initial value for value 02320 * @param ini_speed initial value for speed 02321 */ 02322 NaoJointPositionInterface::MoveServoMessage::MoveServoMessage(const uint32_t ini_servo, const float ini_value, const float ini_speed) : Message("MoveServoMessage") 02323 { 02324 data_size = sizeof(MoveServoMessage_data_t); 02325 data_ptr = malloc(data_size); 02326 memset(data_ptr, 0, data_size); 02327 data = (MoveServoMessage_data_t *)data_ptr; 02328 data_ts = (message_data_ts_t *)data_ptr; 02329 data->servo = ini_servo; 02330 data->value = ini_value; 02331 data->speed = ini_speed; 02332 add_fieldinfo(IFT_UINT32, "servo", 1, &data->servo); 02333 add_fieldinfo(IFT_FLOAT, "value", 1, &data->value); 02334 add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed); 02335 } 02336 /** Constructor */ 02337 NaoJointPositionInterface::MoveServoMessage::MoveServoMessage() : Message("MoveServoMessage") 02338 { 02339 data_size = sizeof(MoveServoMessage_data_t); 02340 data_ptr = malloc(data_size); 02341 memset(data_ptr, 0, data_size); 02342 data = (MoveServoMessage_data_t *)data_ptr; 02343 data_ts = (message_data_ts_t *)data_ptr; 02344 add_fieldinfo(IFT_UINT32, "servo", 1, &data->servo); 02345 add_fieldinfo(IFT_FLOAT, "value", 1, &data->value); 02346 add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed); 02347 } 02348 02349 /** Destructor */ 02350 NaoJointPositionInterface::MoveServoMessage::~MoveServoMessage() 02351 { 02352 free(data_ptr); 02353 } 02354 02355 /** Copy constructor. 02356 * @param m message to copy from 02357 */ 02358 NaoJointPositionInterface::MoveServoMessage::MoveServoMessage(const MoveServoMessage *m) : Message("MoveServoMessage") 02359 { 02360 data_size = m->data_size; 02361 data_ptr = malloc(data_size); 02362 memcpy(data_ptr, m->data_ptr, data_size); 02363 data = (MoveServoMessage_data_t *)data_ptr; 02364 data_ts = (message_data_ts_t *)data_ptr; 02365 } 02366 02367 /* Methods */ 02368 /** Get servo value. 02369 * 02370 A concatenated list of SERVO_* constants to define the servos 02371 that should execute the movement. The list shall consist of 02372 binary or'ed SERVO_* constants. 02373 02374 * @return servo value 02375 */ 02376 uint32_t 02377 NaoJointPositionInterface::MoveServoMessage::servo() const 02378 { 02379 return data->servo; 02380 } 02381 02382 /** Get maximum length of servo value. 02383 * @return length of servo value, can be length of the array or number of 02384 * maximum number of characters for a string 02385 */ 02386 size_t 02387 NaoJointPositionInterface::MoveServoMessage::maxlenof_servo() const 02388 { 02389 return 1; 02390 } 02391 02392 /** Set servo value. 02393 * 02394 A concatenated list of SERVO_* constants to define the servos 02395 that should execute the movement. The list shall consist of 02396 binary or'ed SERVO_* constants. 02397 02398 * @param new_servo new servo value 02399 */ 02400 void 02401 NaoJointPositionInterface::MoveServoMessage::set_servo(const uint32_t new_servo) 02402 { 02403 data->servo = new_servo; 02404 } 02405 02406 /** Get value value. 02407 * Servo value to set for servos. 02408 * @return value value 02409 */ 02410 float 02411 NaoJointPositionInterface::MoveServoMessage::value() const 02412 { 02413 return data->value; 02414 } 02415 02416 /** Get maximum length of value value. 02417 * @return length of value value, can be length of the array or number of 02418 * maximum number of characters for a string 02419 */ 02420 size_t 02421 NaoJointPositionInterface::MoveServoMessage::maxlenof_value() const 02422 { 02423 return 1; 02424 } 02425 02426 /** Set value value. 02427 * Servo value to set for servos. 02428 * @param new_value new value value 02429 */ 02430 void 02431 NaoJointPositionInterface::MoveServoMessage::set_value(const float new_value) 02432 { 02433 data->value = new_value; 02434 } 02435 02436 /** Get speed value. 02437 * 02438 Fraction of max speed in range [0.0..1.0]. 02439 02440 * @return speed value 02441 */ 02442 float 02443 NaoJointPositionInterface::MoveServoMessage::speed() const 02444 { 02445 return data->speed; 02446 } 02447 02448 /** Get maximum length of speed value. 02449 * @return length of speed value, can be length of the array or number of 02450 * maximum number of characters for a string 02451 */ 02452 size_t 02453 NaoJointPositionInterface::MoveServoMessage::maxlenof_speed() const 02454 { 02455 return 1; 02456 } 02457 02458 /** Set speed value. 02459 * 02460 Fraction of max speed in range [0.0..1.0]. 02461 02462 * @param new_speed new speed value 02463 */ 02464 void 02465 NaoJointPositionInterface::MoveServoMessage::set_speed(const float new_speed) 02466 { 02467 data->speed = new_speed; 02468 } 02469 02470 /** Clone this message. 02471 * Produces a message of the same type as this message and copies the 02472 * data to the new message. 02473 * @return clone of this message 02474 */ 02475 Message * 02476 NaoJointPositionInterface::MoveServoMessage::clone() const 02477 { 02478 return new NaoJointPositionInterface::MoveServoMessage(this); 02479 } 02480 /** @class NaoJointPositionInterface::MoveServosMessage <interfaces/NaoJointPositionInterface.h> 02481 * MoveServosMessage Fawkes BlackBoard Interface Message. 02482 * 02483 02484 */ 02485 02486 02487 /** Constructor with initial values. 02488 * @param ini_speed initial value for speed 02489 * @param ini_head_yaw initial value for head_yaw 02490 * @param ini_head_pitch initial value for head_pitch 02491 * @param ini_l_shoulder_pitch initial value for l_shoulder_pitch 02492 * @param ini_l_shoulder_roll initial value for l_shoulder_roll 02493 * @param ini_l_elbow_yaw initial value for l_elbow_yaw 02494 * @param ini_l_elbow_roll initial value for l_elbow_roll 02495 * @param ini_l_wrist_yaw initial value for l_wrist_yaw 02496 * @param ini_l_hand initial value for l_hand 02497 * @param ini_l_hip_yaw_pitch initial value for l_hip_yaw_pitch 02498 * @param ini_l_hip_roll initial value for l_hip_roll 02499 * @param ini_l_hip_pitch initial value for l_hip_pitch 02500 * @param ini_l_knee_pitch initial value for l_knee_pitch 02501 * @param ini_l_ankle_pitch initial value for l_ankle_pitch 02502 * @param ini_l_ankle_roll initial value for l_ankle_roll 02503 * @param ini_r_shoulder_pitch initial value for r_shoulder_pitch 02504 * @param ini_r_shoulder_roll initial value for r_shoulder_roll 02505 * @param ini_r_elbow_yaw initial value for r_elbow_yaw 02506 * @param ini_r_elbow_roll initial value for r_elbow_roll 02507 * @param ini_r_wrist_yaw initial value for r_wrist_yaw 02508 * @param ini_r_hand initial value for r_hand 02509 * @param ini_r_hip_yaw_pitch initial value for r_hip_yaw_pitch 02510 * @param ini_r_hip_roll initial value for r_hip_roll 02511 * @param ini_r_hip_pitch initial value for r_hip_pitch 02512 * @param ini_r_knee_pitch initial value for r_knee_pitch 02513 * @param ini_r_ankle_pitch initial value for r_ankle_pitch 02514 * @param ini_r_ankle_roll initial value for r_ankle_roll 02515 */ 02516 NaoJointPositionInterface::MoveServosMessage::MoveServosMessage(const float ini_speed, const float ini_head_yaw, const float ini_head_pitch, const float ini_l_shoulder_pitch, const float ini_l_shoulder_roll, const float ini_l_elbow_yaw, const float ini_l_elbow_roll, const float ini_l_wrist_yaw, const float ini_l_hand, const float ini_l_hip_yaw_pitch, const float ini_l_hip_roll, const float ini_l_hip_pitch, const float ini_l_knee_pitch, const float ini_l_ankle_pitch, const float ini_l_ankle_roll, const float ini_r_shoulder_pitch, const float ini_r_shoulder_roll, const float ini_r_elbow_yaw, const float ini_r_elbow_roll, const float ini_r_wrist_yaw, const float ini_r_hand, const float ini_r_hip_yaw_pitch, const float ini_r_hip_roll, const float ini_r_hip_pitch, const float ini_r_knee_pitch, const float ini_r_ankle_pitch, const float ini_r_ankle_roll) : Message("MoveServosMessage") 02517 { 02518 data_size = sizeof(MoveServosMessage_data_t); 02519 data_ptr = malloc(data_size); 02520 memset(data_ptr, 0, data_size); 02521 data = (MoveServosMessage_data_t *)data_ptr; 02522 data_ts = (message_data_ts_t *)data_ptr; 02523 data->speed = ini_speed; 02524 data->head_yaw = ini_head_yaw; 02525 data->head_pitch = ini_head_pitch; 02526 data->l_shoulder_pitch = ini_l_shoulder_pitch; 02527 data->l_shoulder_roll = ini_l_shoulder_roll; 02528 data->l_elbow_yaw = ini_l_elbow_yaw; 02529 data->l_elbow_roll = ini_l_elbow_roll; 02530 data->l_wrist_yaw = ini_l_wrist_yaw; 02531 data->l_hand = ini_l_hand; 02532 data->l_hip_yaw_pitch = ini_l_hip_yaw_pitch; 02533 data->l_hip_roll = ini_l_hip_roll; 02534 data->l_hip_pitch = ini_l_hip_pitch; 02535 data->l_knee_pitch = ini_l_knee_pitch; 02536 data->l_ankle_pitch = ini_l_ankle_pitch; 02537 data->l_ankle_roll = ini_l_ankle_roll; 02538 data->r_shoulder_pitch = ini_r_shoulder_pitch; 02539 data->r_shoulder_roll = ini_r_shoulder_roll; 02540 data->r_elbow_yaw = ini_r_elbow_yaw; 02541 data->r_elbow_roll = ini_r_elbow_roll; 02542 data->r_wrist_yaw = ini_r_wrist_yaw; 02543 data->r_hand = ini_r_hand; 02544 data->r_hip_yaw_pitch = ini_r_hip_yaw_pitch; 02545 data->r_hip_roll = ini_r_hip_roll; 02546 data->r_hip_pitch = ini_r_hip_pitch; 02547 data->r_knee_pitch = ini_r_knee_pitch; 02548 data->r_ankle_pitch = ini_r_ankle_pitch; 02549 data->r_ankle_roll = ini_r_ankle_roll; 02550 add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed); 02551 add_fieldinfo(IFT_FLOAT, "head_yaw", 1, &data->head_yaw); 02552 add_fieldinfo(IFT_FLOAT, "head_pitch", 1, &data->head_pitch); 02553 add_fieldinfo(IFT_FLOAT, "l_shoulder_pitch", 1, &data->l_shoulder_pitch); 02554 add_fieldinfo(IFT_FLOAT, "l_shoulder_roll", 1, &data->l_shoulder_roll); 02555 add_fieldinfo(IFT_FLOAT, "l_elbow_yaw", 1, &data->l_elbow_yaw); 02556 add_fieldinfo(IFT_FLOAT, "l_elbow_roll", 1, &data->l_elbow_roll); 02557 add_fieldinfo(IFT_FLOAT, "l_wrist_yaw", 1, &data->l_wrist_yaw); 02558 add_fieldinfo(IFT_FLOAT, "l_hand", 1, &data->l_hand); 02559 add_fieldinfo(IFT_FLOAT, "l_hip_yaw_pitch", 1, &data->l_hip_yaw_pitch); 02560 add_fieldinfo(IFT_FLOAT, "l_hip_roll", 1, &data->l_hip_roll); 02561 add_fieldinfo(IFT_FLOAT, "l_hip_pitch", 1, &data->l_hip_pitch); 02562 add_fieldinfo(IFT_FLOAT, "l_knee_pitch", 1, &data->l_knee_pitch); 02563 add_fieldinfo(IFT_FLOAT, "l_ankle_pitch", 1, &data->l_ankle_pitch); 02564 add_fieldinfo(IFT_FLOAT, "l_ankle_roll", 1, &data->l_ankle_roll); 02565 add_fieldinfo(IFT_FLOAT, "r_shoulder_pitch", 1, &data->r_shoulder_pitch); 02566 add_fieldinfo(IFT_FLOAT, "r_shoulder_roll", 1, &data->r_shoulder_roll); 02567 add_fieldinfo(IFT_FLOAT, "r_elbow_yaw", 1, &data->r_elbow_yaw); 02568 add_fieldinfo(IFT_FLOAT, "r_elbow_roll", 1, &data->r_elbow_roll); 02569 add_fieldinfo(IFT_FLOAT, "r_wrist_yaw", 1, &data->r_wrist_yaw); 02570 add_fieldinfo(IFT_FLOAT, "r_hand", 1, &data->r_hand); 02571 add_fieldinfo(IFT_FLOAT, "r_hip_yaw_pitch", 1, &data->r_hip_yaw_pitch); 02572 add_fieldinfo(IFT_FLOAT, "r_hip_roll", 1, &data->r_hip_roll); 02573 add_fieldinfo(IFT_FLOAT, "r_hip_pitch", 1, &data->r_hip_pitch); 02574 add_fieldinfo(IFT_FLOAT, "r_knee_pitch", 1, &data->r_knee_pitch); 02575 add_fieldinfo(IFT_FLOAT, "r_ankle_pitch", 1, &data->r_ankle_pitch); 02576 add_fieldinfo(IFT_FLOAT, "r_ankle_roll", 1, &data->r_ankle_roll); 02577 } 02578 /** Constructor */ 02579 NaoJointPositionInterface::MoveServosMessage::MoveServosMessage() : Message("MoveServosMessage") 02580 { 02581 data_size = sizeof(MoveServosMessage_data_t); 02582 data_ptr = malloc(data_size); 02583 memset(data_ptr, 0, data_size); 02584 data = (MoveServosMessage_data_t *)data_ptr; 02585 data_ts = (message_data_ts_t *)data_ptr; 02586 add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed); 02587 add_fieldinfo(IFT_FLOAT, "head_yaw", 1, &data->head_yaw); 02588 add_fieldinfo(IFT_FLOAT, "head_pitch", 1, &data->head_pitch); 02589 add_fieldinfo(IFT_FLOAT, "l_shoulder_pitch", 1, &data->l_shoulder_pitch); 02590 add_fieldinfo(IFT_FLOAT, "l_shoulder_roll", 1, &data->l_shoulder_roll); 02591 add_fieldinfo(IFT_FLOAT, "l_elbow_yaw", 1, &data->l_elbow_yaw); 02592 add_fieldinfo(IFT_FLOAT, "l_elbow_roll", 1, &data->l_elbow_roll); 02593 add_fieldinfo(IFT_FLOAT, "l_wrist_yaw", 1, &data->l_wrist_yaw); 02594 add_fieldinfo(IFT_FLOAT, "l_hand", 1, &data->l_hand); 02595 add_fieldinfo(IFT_FLOAT, "l_hip_yaw_pitch", 1, &data->l_hip_yaw_pitch); 02596 add_fieldinfo(IFT_FLOAT, "l_hip_roll", 1, &data->l_hip_roll); 02597 add_fieldinfo(IFT_FLOAT, "l_hip_pitch", 1, &data->l_hip_pitch); 02598 add_fieldinfo(IFT_FLOAT, "l_knee_pitch", 1, &data->l_knee_pitch); 02599 add_fieldinfo(IFT_FLOAT, "l_ankle_pitch", 1, &data->l_ankle_pitch); 02600 add_fieldinfo(IFT_FLOAT, "l_ankle_roll", 1, &data->l_ankle_roll); 02601 add_fieldinfo(IFT_FLOAT, "r_shoulder_pitch", 1, &data->r_shoulder_pitch); 02602 add_fieldinfo(IFT_FLOAT, "r_shoulder_roll", 1, &data->r_shoulder_roll); 02603 add_fieldinfo(IFT_FLOAT, "r_elbow_yaw", 1, &data->r_elbow_yaw); 02604 add_fieldinfo(IFT_FLOAT, "r_elbow_roll", 1, &data->r_elbow_roll); 02605 add_fieldinfo(IFT_FLOAT, "r_wrist_yaw", 1, &data->r_wrist_yaw); 02606 add_fieldinfo(IFT_FLOAT, "r_hand", 1, &data->r_hand); 02607 add_fieldinfo(IFT_FLOAT, "r_hip_yaw_pitch", 1, &data->r_hip_yaw_pitch); 02608 add_fieldinfo(IFT_FLOAT, "r_hip_roll", 1, &data->r_hip_roll); 02609 add_fieldinfo(IFT_FLOAT, "r_hip_pitch", 1, &data->r_hip_pitch); 02610 add_fieldinfo(IFT_FLOAT, "r_knee_pitch", 1, &data->r_knee_pitch); 02611 add_fieldinfo(IFT_FLOAT, "r_ankle_pitch", 1, &data->r_ankle_pitch); 02612 add_fieldinfo(IFT_FLOAT, "r_ankle_roll", 1, &data->r_ankle_roll); 02613 } 02614 02615 /** Destructor */ 02616 NaoJointPositionInterface::MoveServosMessage::~MoveServosMessage() 02617 { 02618 free(data_ptr); 02619 } 02620 02621 /** Copy constructor. 02622 * @param m message to copy from 02623 */ 02624 NaoJointPositionInterface::MoveServosMessage::MoveServosMessage(const MoveServosMessage *m) : Message("MoveServosMessage") 02625 { 02626 data_size = m->data_size; 02627 data_ptr = malloc(data_size); 02628 memcpy(data_ptr, m->data_ptr, data_size); 02629 data = (MoveServosMessage_data_t *)data_ptr; 02630 data_ts = (message_data_ts_t *)data_ptr; 02631 } 02632 02633 /* Methods */ 02634 /** Get speed value. 02635 * 02636 Fraction of max speed in range [0.0..1.0]. 02637 02638 * @return speed value 02639 */ 02640 float 02641 NaoJointPositionInterface::MoveServosMessage::speed() const 02642 { 02643 return data->speed; 02644 } 02645 02646 /** Get maximum length of speed value. 02647 * @return length of speed value, can be length of the array or number of 02648 * maximum number of characters for a string 02649 */ 02650 size_t 02651 NaoJointPositionInterface::MoveServosMessage::maxlenof_speed() const 02652 { 02653 return 1; 02654 } 02655 02656 /** Set speed value. 02657 * 02658 Fraction of max speed in range [0.0..1.0]. 02659 02660 * @param new_speed new speed value 02661 */ 02662 void 02663 NaoJointPositionInterface::MoveServosMessage::set_speed(const float new_speed) 02664 { 02665 data->speed = new_speed; 02666 } 02667 02668 /** Get head_yaw value. 02669 * Head yaw 02670 * @return head_yaw value 02671 */ 02672 float 02673 NaoJointPositionInterface::MoveServosMessage::head_yaw() const 02674 { 02675 return data->head_yaw; 02676 } 02677 02678 /** Get maximum length of head_yaw value. 02679 * @return length of head_yaw value, can be length of the array or number of 02680 * maximum number of characters for a string 02681 */ 02682 size_t 02683 NaoJointPositionInterface::MoveServosMessage::maxlenof_head_yaw() const 02684 { 02685 return 1; 02686 } 02687 02688 /** Set head_yaw value. 02689 * Head yaw 02690 * @param new_head_yaw new head_yaw value 02691 */ 02692 void 02693 NaoJointPositionInterface::MoveServosMessage::set_head_yaw(const float new_head_yaw) 02694 { 02695 data->head_yaw = new_head_yaw; 02696 } 02697 02698 /** Get head_pitch value. 02699 * Head pitch 02700 * @return head_pitch value 02701 */ 02702 float 02703 NaoJointPositionInterface::MoveServosMessage::head_pitch() const 02704 { 02705 return data->head_pitch; 02706 } 02707 02708 /** Get maximum length of head_pitch value. 02709 * @return length of head_pitch value, can be length of the array or number of 02710 * maximum number of characters for a string 02711 */ 02712 size_t 02713 NaoJointPositionInterface::MoveServosMessage::maxlenof_head_pitch() const 02714 { 02715 return 1; 02716 } 02717 02718 /** Set head_pitch value. 02719 * Head pitch 02720 * @param new_head_pitch new head_pitch value 02721 */ 02722 void 02723 NaoJointPositionInterface::MoveServosMessage::set_head_pitch(const float new_head_pitch) 02724 { 02725 data->head_pitch = new_head_pitch; 02726 } 02727 02728 /** Get l_shoulder_pitch value. 02729 * Left shoulder pitch 02730 * @return l_shoulder_pitch value 02731 */ 02732 float 02733 NaoJointPositionInterface::MoveServosMessage::l_shoulder_pitch() const 02734 { 02735 return data->l_shoulder_pitch; 02736 } 02737 02738 /** Get maximum length of l_shoulder_pitch value. 02739 * @return length of l_shoulder_pitch value, can be length of the array or number of 02740 * maximum number of characters for a string 02741 */ 02742 size_t 02743 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_shoulder_pitch() const 02744 { 02745 return 1; 02746 } 02747 02748 /** Set l_shoulder_pitch value. 02749 * Left shoulder pitch 02750 * @param new_l_shoulder_pitch new l_shoulder_pitch value 02751 */ 02752 void 02753 NaoJointPositionInterface::MoveServosMessage::set_l_shoulder_pitch(const float new_l_shoulder_pitch) 02754 { 02755 data->l_shoulder_pitch = new_l_shoulder_pitch; 02756 } 02757 02758 /** Get l_shoulder_roll value. 02759 * Left shoulder roll 02760 * @return l_shoulder_roll value 02761 */ 02762 float 02763 NaoJointPositionInterface::MoveServosMessage::l_shoulder_roll() const 02764 { 02765 return data->l_shoulder_roll; 02766 } 02767 02768 /** Get maximum length of l_shoulder_roll value. 02769 * @return length of l_shoulder_roll value, can be length of the array or number of 02770 * maximum number of characters for a string 02771 */ 02772 size_t 02773 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_shoulder_roll() const 02774 { 02775 return 1; 02776 } 02777 02778 /** Set l_shoulder_roll value. 02779 * Left shoulder roll 02780 * @param new_l_shoulder_roll new l_shoulder_roll value 02781 */ 02782 void 02783 NaoJointPositionInterface::MoveServosMessage::set_l_shoulder_roll(const float new_l_shoulder_roll) 02784 { 02785 data->l_shoulder_roll = new_l_shoulder_roll; 02786 } 02787 02788 /** Get l_elbow_yaw value. 02789 * Left elbow yaw 02790 * @return l_elbow_yaw value 02791 */ 02792 float 02793 NaoJointPositionInterface::MoveServosMessage::l_elbow_yaw() const 02794 { 02795 return data->l_elbow_yaw; 02796 } 02797 02798 /** Get maximum length of l_elbow_yaw value. 02799 * @return length of l_elbow_yaw value, can be length of the array or number of 02800 * maximum number of characters for a string 02801 */ 02802 size_t 02803 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_elbow_yaw() const 02804 { 02805 return 1; 02806 } 02807 02808 /** Set l_elbow_yaw value. 02809 * Left elbow yaw 02810 * @param new_l_elbow_yaw new l_elbow_yaw value 02811 */ 02812 void 02813 NaoJointPositionInterface::MoveServosMessage::set_l_elbow_yaw(const float new_l_elbow_yaw) 02814 { 02815 data->l_elbow_yaw = new_l_elbow_yaw; 02816 } 02817 02818 /** Get l_elbow_roll value. 02819 * Left elbow roll 02820 * @return l_elbow_roll value 02821 */ 02822 float 02823 NaoJointPositionInterface::MoveServosMessage::l_elbow_roll() const 02824 { 02825 return data->l_elbow_roll; 02826 } 02827 02828 /** Get maximum length of l_elbow_roll value. 02829 * @return length of l_elbow_roll value, can be length of the array or number of 02830 * maximum number of characters for a string 02831 */ 02832 size_t 02833 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_elbow_roll() const 02834 { 02835 return 1; 02836 } 02837 02838 /** Set l_elbow_roll value. 02839 * Left elbow roll 02840 * @param new_l_elbow_roll new l_elbow_roll value 02841 */ 02842 void 02843 NaoJointPositionInterface::MoveServosMessage::set_l_elbow_roll(const float new_l_elbow_roll) 02844 { 02845 data->l_elbow_roll = new_l_elbow_roll; 02846 } 02847 02848 /** Get l_wrist_yaw value. 02849 * Left wrist yaw 02850 * @return l_wrist_yaw value 02851 */ 02852 float 02853 NaoJointPositionInterface::MoveServosMessage::l_wrist_yaw() const 02854 { 02855 return data->l_wrist_yaw; 02856 } 02857 02858 /** Get maximum length of l_wrist_yaw value. 02859 * @return length of l_wrist_yaw value, can be length of the array or number of 02860 * maximum number of characters for a string 02861 */ 02862 size_t 02863 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_wrist_yaw() const 02864 { 02865 return 1; 02866 } 02867 02868 /** Set l_wrist_yaw value. 02869 * Left wrist yaw 02870 * @param new_l_wrist_yaw new l_wrist_yaw value 02871 */ 02872 void 02873 NaoJointPositionInterface::MoveServosMessage::set_l_wrist_yaw(const float new_l_wrist_yaw) 02874 { 02875 data->l_wrist_yaw = new_l_wrist_yaw; 02876 } 02877 02878 /** Get l_hand value. 02879 * Left hand 02880 * @return l_hand value 02881 */ 02882 float 02883 NaoJointPositionInterface::MoveServosMessage::l_hand() const 02884 { 02885 return data->l_hand; 02886 } 02887 02888 /** Get maximum length of l_hand value. 02889 * @return length of l_hand value, can be length of the array or number of 02890 * maximum number of characters for a string 02891 */ 02892 size_t 02893 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_hand() const 02894 { 02895 return 1; 02896 } 02897 02898 /** Set l_hand value. 02899 * Left hand 02900 * @param new_l_hand new l_hand value 02901 */ 02902 void 02903 NaoJointPositionInterface::MoveServosMessage::set_l_hand(const float new_l_hand) 02904 { 02905 data->l_hand = new_l_hand; 02906 } 02907 02908 /** Get l_hip_yaw_pitch value. 02909 * Left hip yaw pitch 02910 * @return l_hip_yaw_pitch value 02911 */ 02912 float 02913 NaoJointPositionInterface::MoveServosMessage::l_hip_yaw_pitch() const 02914 { 02915 return data->l_hip_yaw_pitch; 02916 } 02917 02918 /** Get maximum length of l_hip_yaw_pitch value. 02919 * @return length of l_hip_yaw_pitch value, can be length of the array or number of 02920 * maximum number of characters for a string 02921 */ 02922 size_t 02923 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_hip_yaw_pitch() const 02924 { 02925 return 1; 02926 } 02927 02928 /** Set l_hip_yaw_pitch value. 02929 * Left hip yaw pitch 02930 * @param new_l_hip_yaw_pitch new l_hip_yaw_pitch value 02931 */ 02932 void 02933 NaoJointPositionInterface::MoveServosMessage::set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch) 02934 { 02935 data->l_hip_yaw_pitch = new_l_hip_yaw_pitch; 02936 } 02937 02938 /** Get l_hip_roll value. 02939 * Left hip roll 02940 * @return l_hip_roll value 02941 */ 02942 float 02943 NaoJointPositionInterface::MoveServosMessage::l_hip_roll() const 02944 { 02945 return data->l_hip_roll; 02946 } 02947 02948 /** Get maximum length of l_hip_roll value. 02949 * @return length of l_hip_roll value, can be length of the array or number of 02950 * maximum number of characters for a string 02951 */ 02952 size_t 02953 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_hip_roll() const 02954 { 02955 return 1; 02956 } 02957 02958 /** Set l_hip_roll value. 02959 * Left hip roll 02960 * @param new_l_hip_roll new l_hip_roll value 02961 */ 02962 void 02963 NaoJointPositionInterface::MoveServosMessage::set_l_hip_roll(const float new_l_hip_roll) 02964 { 02965 data->l_hip_roll = new_l_hip_roll; 02966 } 02967 02968 /** Get l_hip_pitch value. 02969 * Left hip pitch 02970 * @return l_hip_pitch value 02971 */ 02972 float 02973 NaoJointPositionInterface::MoveServosMessage::l_hip_pitch() const 02974 { 02975 return data->l_hip_pitch; 02976 } 02977 02978 /** Get maximum length of l_hip_pitch value. 02979 * @return length of l_hip_pitch value, can be length of the array or number of 02980 * maximum number of characters for a string 02981 */ 02982 size_t 02983 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_hip_pitch() const 02984 { 02985 return 1; 02986 } 02987 02988 /** Set l_hip_pitch value. 02989 * Left hip pitch 02990 * @param new_l_hip_pitch new l_hip_pitch value 02991 */ 02992 void 02993 NaoJointPositionInterface::MoveServosMessage::set_l_hip_pitch(const float new_l_hip_pitch) 02994 { 02995 data->l_hip_pitch = new_l_hip_pitch; 02996 } 02997 02998 /** Get l_knee_pitch value. 02999 * Left knee pitch 03000 * @return l_knee_pitch value 03001 */ 03002 float 03003 NaoJointPositionInterface::MoveServosMessage::l_knee_pitch() const 03004 { 03005 return data->l_knee_pitch; 03006 } 03007 03008 /** Get maximum length of l_knee_pitch value. 03009 * @return length of l_knee_pitch value, can be length of the array or number of 03010 * maximum number of characters for a string 03011 */ 03012 size_t 03013 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_knee_pitch() const 03014 { 03015 return 1; 03016 } 03017 03018 /** Set l_knee_pitch value. 03019 * Left knee pitch 03020 * @param new_l_knee_pitch new l_knee_pitch value 03021 */ 03022 void 03023 NaoJointPositionInterface::MoveServosMessage::set_l_knee_pitch(const float new_l_knee_pitch) 03024 { 03025 data->l_knee_pitch = new_l_knee_pitch; 03026 } 03027 03028 /** Get l_ankle_pitch value. 03029 * Left ankle pitch 03030 * @return l_ankle_pitch value 03031 */ 03032 float 03033 NaoJointPositionInterface::MoveServosMessage::l_ankle_pitch() const 03034 { 03035 return data->l_ankle_pitch; 03036 } 03037 03038 /** Get maximum length of l_ankle_pitch value. 03039 * @return length of l_ankle_pitch value, can be length of the array or number of 03040 * maximum number of characters for a string 03041 */ 03042 size_t 03043 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_ankle_pitch() const 03044 { 03045 return 1; 03046 } 03047 03048 /** Set l_ankle_pitch value. 03049 * Left ankle pitch 03050 * @param new_l_ankle_pitch new l_ankle_pitch value 03051 */ 03052 void 03053 NaoJointPositionInterface::MoveServosMessage::set_l_ankle_pitch(const float new_l_ankle_pitch) 03054 { 03055 data->l_ankle_pitch = new_l_ankle_pitch; 03056 } 03057 03058 /** Get l_ankle_roll value. 03059 * Left ankle roll 03060 * @return l_ankle_roll value 03061 */ 03062 float 03063 NaoJointPositionInterface::MoveServosMessage::l_ankle_roll() const 03064 { 03065 return data->l_ankle_roll; 03066 } 03067 03068 /** Get maximum length of l_ankle_roll value. 03069 * @return length of l_ankle_roll value, can be length of the array or number of 03070 * maximum number of characters for a string 03071 */ 03072 size_t 03073 NaoJointPositionInterface::MoveServosMessage::maxlenof_l_ankle_roll() const 03074 { 03075 return 1; 03076 } 03077 03078 /** Set l_ankle_roll value. 03079 * Left ankle roll 03080 * @param new_l_ankle_roll new l_ankle_roll value 03081 */ 03082 void 03083 NaoJointPositionInterface::MoveServosMessage::set_l_ankle_roll(const float new_l_ankle_roll) 03084 { 03085 data->l_ankle_roll = new_l_ankle_roll; 03086 } 03087 03088 /** Get r_shoulder_pitch value. 03089 * Right shoulder pitch 03090 * @return r_shoulder_pitch value 03091 */ 03092 float 03093 NaoJointPositionInterface::MoveServosMessage::r_shoulder_pitch() const 03094 { 03095 return data->r_shoulder_pitch; 03096 } 03097 03098 /** Get maximum length of r_shoulder_pitch value. 03099 * @return length of r_shoulder_pitch value, can be length of the array or number of 03100 * maximum number of characters for a string 03101 */ 03102 size_t 03103 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_shoulder_pitch() const 03104 { 03105 return 1; 03106 } 03107 03108 /** Set r_shoulder_pitch value. 03109 * Right shoulder pitch 03110 * @param new_r_shoulder_pitch new r_shoulder_pitch value 03111 */ 03112 void 03113 NaoJointPositionInterface::MoveServosMessage::set_r_shoulder_pitch(const float new_r_shoulder_pitch) 03114 { 03115 data->r_shoulder_pitch = new_r_shoulder_pitch; 03116 } 03117 03118 /** Get r_shoulder_roll value. 03119 * Right shoulder roll 03120 * @return r_shoulder_roll value 03121 */ 03122 float 03123 NaoJointPositionInterface::MoveServosMessage::r_shoulder_roll() const 03124 { 03125 return data->r_shoulder_roll; 03126 } 03127 03128 /** Get maximum length of r_shoulder_roll value. 03129 * @return length of r_shoulder_roll value, can be length of the array or number of 03130 * maximum number of characters for a string 03131 */ 03132 size_t 03133 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_shoulder_roll() const 03134 { 03135 return 1; 03136 } 03137 03138 /** Set r_shoulder_roll value. 03139 * Right shoulder roll 03140 * @param new_r_shoulder_roll new r_shoulder_roll value 03141 */ 03142 void 03143 NaoJointPositionInterface::MoveServosMessage::set_r_shoulder_roll(const float new_r_shoulder_roll) 03144 { 03145 data->r_shoulder_roll = new_r_shoulder_roll; 03146 } 03147 03148 /** Get r_elbow_yaw value. 03149 * Right elbow yaw 03150 * @return r_elbow_yaw value 03151 */ 03152 float 03153 NaoJointPositionInterface::MoveServosMessage::r_elbow_yaw() const 03154 { 03155 return data->r_elbow_yaw; 03156 } 03157 03158 /** Get maximum length of r_elbow_yaw value. 03159 * @return length of r_elbow_yaw value, can be length of the array or number of 03160 * maximum number of characters for a string 03161 */ 03162 size_t 03163 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_elbow_yaw() const 03164 { 03165 return 1; 03166 } 03167 03168 /** Set r_elbow_yaw value. 03169 * Right elbow yaw 03170 * @param new_r_elbow_yaw new r_elbow_yaw value 03171 */ 03172 void 03173 NaoJointPositionInterface::MoveServosMessage::set_r_elbow_yaw(const float new_r_elbow_yaw) 03174 { 03175 data->r_elbow_yaw = new_r_elbow_yaw; 03176 } 03177 03178 /** Get r_elbow_roll value. 03179 * Right elbow roll 03180 * @return r_elbow_roll value 03181 */ 03182 float 03183 NaoJointPositionInterface::MoveServosMessage::r_elbow_roll() const 03184 { 03185 return data->r_elbow_roll; 03186 } 03187 03188 /** Get maximum length of r_elbow_roll value. 03189 * @return length of r_elbow_roll value, can be length of the array or number of 03190 * maximum number of characters for a string 03191 */ 03192 size_t 03193 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_elbow_roll() const 03194 { 03195 return 1; 03196 } 03197 03198 /** Set r_elbow_roll value. 03199 * Right elbow roll 03200 * @param new_r_elbow_roll new r_elbow_roll value 03201 */ 03202 void 03203 NaoJointPositionInterface::MoveServosMessage::set_r_elbow_roll(const float new_r_elbow_roll) 03204 { 03205 data->r_elbow_roll = new_r_elbow_roll; 03206 } 03207 03208 /** Get r_wrist_yaw value. 03209 * Right wrist yaw 03210 * @return r_wrist_yaw value 03211 */ 03212 float 03213 NaoJointPositionInterface::MoveServosMessage::r_wrist_yaw() const 03214 { 03215 return data->r_wrist_yaw; 03216 } 03217 03218 /** Get maximum length of r_wrist_yaw value. 03219 * @return length of r_wrist_yaw value, can be length of the array or number of 03220 * maximum number of characters for a string 03221 */ 03222 size_t 03223 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_wrist_yaw() const 03224 { 03225 return 1; 03226 } 03227 03228 /** Set r_wrist_yaw value. 03229 * Right wrist yaw 03230 * @param new_r_wrist_yaw new r_wrist_yaw value 03231 */ 03232 void 03233 NaoJointPositionInterface::MoveServosMessage::set_r_wrist_yaw(const float new_r_wrist_yaw) 03234 { 03235 data->r_wrist_yaw = new_r_wrist_yaw; 03236 } 03237 03238 /** Get r_hand value. 03239 * Right hand 03240 * @return r_hand value 03241 */ 03242 float 03243 NaoJointPositionInterface::MoveServosMessage::r_hand() const 03244 { 03245 return data->r_hand; 03246 } 03247 03248 /** Get maximum length of r_hand value. 03249 * @return length of r_hand value, can be length of the array or number of 03250 * maximum number of characters for a string 03251 */ 03252 size_t 03253 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_hand() const 03254 { 03255 return 1; 03256 } 03257 03258 /** Set r_hand value. 03259 * Right hand 03260 * @param new_r_hand new r_hand value 03261 */ 03262 void 03263 NaoJointPositionInterface::MoveServosMessage::set_r_hand(const float new_r_hand) 03264 { 03265 data->r_hand = new_r_hand; 03266 } 03267 03268 /** Get r_hip_yaw_pitch value. 03269 * Right hip yaw pitch 03270 * @return r_hip_yaw_pitch value 03271 */ 03272 float 03273 NaoJointPositionInterface::MoveServosMessage::r_hip_yaw_pitch() const 03274 { 03275 return data->r_hip_yaw_pitch; 03276 } 03277 03278 /** Get maximum length of r_hip_yaw_pitch value. 03279 * @return length of r_hip_yaw_pitch value, can be length of the array or number of 03280 * maximum number of characters for a string 03281 */ 03282 size_t 03283 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_hip_yaw_pitch() const 03284 { 03285 return 1; 03286 } 03287 03288 /** Set r_hip_yaw_pitch value. 03289 * Right hip yaw pitch 03290 * @param new_r_hip_yaw_pitch new r_hip_yaw_pitch value 03291 */ 03292 void 03293 NaoJointPositionInterface::MoveServosMessage::set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch) 03294 { 03295 data->r_hip_yaw_pitch = new_r_hip_yaw_pitch; 03296 } 03297 03298 /** Get r_hip_roll value. 03299 * Right hip roll 03300 * @return r_hip_roll value 03301 */ 03302 float 03303 NaoJointPositionInterface::MoveServosMessage::r_hip_roll() const 03304 { 03305 return data->r_hip_roll; 03306 } 03307 03308 /** Get maximum length of r_hip_roll value. 03309 * @return length of r_hip_roll value, can be length of the array or number of 03310 * maximum number of characters for a string 03311 */ 03312 size_t 03313 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_hip_roll() const 03314 { 03315 return 1; 03316 } 03317 03318 /** Set r_hip_roll value. 03319 * Right hip roll 03320 * @param new_r_hip_roll new r_hip_roll value 03321 */ 03322 void 03323 NaoJointPositionInterface::MoveServosMessage::set_r_hip_roll(const float new_r_hip_roll) 03324 { 03325 data->r_hip_roll = new_r_hip_roll; 03326 } 03327 03328 /** Get r_hip_pitch value. 03329 * Right hip pitch 03330 * @return r_hip_pitch value 03331 */ 03332 float 03333 NaoJointPositionInterface::MoveServosMessage::r_hip_pitch() const 03334 { 03335 return data->r_hip_pitch; 03336 } 03337 03338 /** Get maximum length of r_hip_pitch value. 03339 * @return length of r_hip_pitch value, can be length of the array or number of 03340 * maximum number of characters for a string 03341 */ 03342 size_t 03343 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_hip_pitch() const 03344 { 03345 return 1; 03346 } 03347 03348 /** Set r_hip_pitch value. 03349 * Right hip pitch 03350 * @param new_r_hip_pitch new r_hip_pitch value 03351 */ 03352 void 03353 NaoJointPositionInterface::MoveServosMessage::set_r_hip_pitch(const float new_r_hip_pitch) 03354 { 03355 data->r_hip_pitch = new_r_hip_pitch; 03356 } 03357 03358 /** Get r_knee_pitch value. 03359 * Right knee pitch 03360 * @return r_knee_pitch value 03361 */ 03362 float 03363 NaoJointPositionInterface::MoveServosMessage::r_knee_pitch() const 03364 { 03365 return data->r_knee_pitch; 03366 } 03367 03368 /** Get maximum length of r_knee_pitch value. 03369 * @return length of r_knee_pitch value, can be length of the array or number of 03370 * maximum number of characters for a string 03371 */ 03372 size_t 03373 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_knee_pitch() const 03374 { 03375 return 1; 03376 } 03377 03378 /** Set r_knee_pitch value. 03379 * Right knee pitch 03380 * @param new_r_knee_pitch new r_knee_pitch value 03381 */ 03382 void 03383 NaoJointPositionInterface::MoveServosMessage::set_r_knee_pitch(const float new_r_knee_pitch) 03384 { 03385 data->r_knee_pitch = new_r_knee_pitch; 03386 } 03387 03388 /** Get r_ankle_pitch value. 03389 * Right ankle pitch 03390 * @return r_ankle_pitch value 03391 */ 03392 float 03393 NaoJointPositionInterface::MoveServosMessage::r_ankle_pitch() const 03394 { 03395 return data->r_ankle_pitch; 03396 } 03397 03398 /** Get maximum length of r_ankle_pitch value. 03399 * @return length of r_ankle_pitch value, can be length of the array or number of 03400 * maximum number of characters for a string 03401 */ 03402 size_t 03403 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_ankle_pitch() const 03404 { 03405 return 1; 03406 } 03407 03408 /** Set r_ankle_pitch value. 03409 * Right ankle pitch 03410 * @param new_r_ankle_pitch new r_ankle_pitch value 03411 */ 03412 void 03413 NaoJointPositionInterface::MoveServosMessage::set_r_ankle_pitch(const float new_r_ankle_pitch) 03414 { 03415 data->r_ankle_pitch = new_r_ankle_pitch; 03416 } 03417 03418 /** Get r_ankle_roll value. 03419 * Right ankle roll 03420 * @return r_ankle_roll value 03421 */ 03422 float 03423 NaoJointPositionInterface::MoveServosMessage::r_ankle_roll() const 03424 { 03425 return data->r_ankle_roll; 03426 } 03427 03428 /** Get maximum length of r_ankle_roll value. 03429 * @return length of r_ankle_roll value, can be length of the array or number of 03430 * maximum number of characters for a string 03431 */ 03432 size_t 03433 NaoJointPositionInterface::MoveServosMessage::maxlenof_r_ankle_roll() const 03434 { 03435 return 1; 03436 } 03437 03438 /** Set r_ankle_roll value. 03439 * Right ankle roll 03440 * @param new_r_ankle_roll new r_ankle_roll value 03441 */ 03442 void 03443 NaoJointPositionInterface::MoveServosMessage::set_r_ankle_roll(const float new_r_ankle_roll) 03444 { 03445 data->r_ankle_roll = new_r_ankle_roll; 03446 } 03447 03448 /** Clone this message. 03449 * Produces a message of the same type as this message and copies the 03450 * data to the new message. 03451 * @return clone of this message 03452 */ 03453 Message * 03454 NaoJointPositionInterface::MoveServosMessage::clone() const 03455 { 03456 return new NaoJointPositionInterface::MoveServosMessage(this); 03457 } 03458 /** Check if message is valid and can be enqueued. 03459 * @param message Message to check 03460 * @return true if the message is valid, false otherwise. 03461 */ 03462 bool 03463 NaoJointPositionInterface::message_valid(const Message *message) const 03464 { 03465 const SetServoMessage *m0 = dynamic_cast<const SetServoMessage *>(message); 03466 if ( m0 != NULL ) { 03467 return true; 03468 } 03469 const SetServosMessage *m1 = dynamic_cast<const SetServosMessage *>(message); 03470 if ( m1 != NULL ) { 03471 return true; 03472 } 03473 const MoveServoMessage *m2 = dynamic_cast<const MoveServoMessage *>(message); 03474 if ( m2 != NULL ) { 03475 return true; 03476 } 03477 const MoveServosMessage *m3 = dynamic_cast<const MoveServosMessage *>(message); 03478 if ( m3 != NULL ) { 03479 return true; 03480 } 03481 return false; 03482 } 03483 03484 /// @cond INTERNALS 03485 EXPORT_INTERFACE(NaoJointPositionInterface) 03486 /// @endcond 03487 03488 03489 } // end namespace fawkes