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