gusimplewhiteboard
|
Motion Command class, this class is used to send commands to a motion module via the Whiteboard. More...
#include <MOTION_Interface.hpp>
Public Member Functions | |
long | GoToStance (Motions::stance current, Motions::stance desired) |
Transition from one 'Stance' to another. More... | |
long | DoAction (Motions::stance current, Motions::action a) |
Perform an 'Action'. More... | |
MOTION_Commands (const std::string &str) | |
String constructor. More... | |
void | from_string (const std::string &str) |
Parser for recreating this class. More... | |
std::string | description () const |
Description method for pretty printing the values in this class. More... | |
Motion Command class, this class is used to send commands to a motion module via the Whiteboard.
Allows commands to be sent to the motion module to change from one 'Stance' to another or to perform an 'Action'. Once complete an 'Action' returns the robot back to its previous 'Stance'. ie. stance::Standing -> action::Kick returns to stance::Standing once complete. Stance changes and Actions can be chained together in the same message to a limit of NUM_OF_STANCES per message sent to the motion module. Stance changes are graph mapped, you can ask to go from stance::Fallen -> stance::Kneeling -> stance::Standing directly or simply ask for stance::Fallen -> stance::Standing. A cost function is used to determine which stance path to use if multiple paths exist. Stiffness is generally managed by the motion files, there are overwriting properties for changing it manually, this is not advised unless you know what you're doing.
MOTION_Commands m; m.GoToStance(stance::Kneeling, stance::Standing); //Kneeling to Standing MOTION_Commands_t.set(m) //Set in Whiteboard
MOTION_Commands m; m.DoAction(stance::Standing, action::left_kick); //from standing, do a left kick MOTION_Commands_t.set(m) //Set in Whiteboard
MOTION_Commands m; m.GoToStance(stance::Kneeling, stance::Standing); //transition from Kneeling to Standing m.DoAction(stance::Standing, action::left_kick); //from standing, do a left kick MOTION_Commands_t.set(m) //Set in Whiteboard
Definition at line 415 of file MOTION_Interface.hpp.
|
inline |
String constructor.
str | the string to parse and use to recreate the this object |
Definition at line 561 of file MOTION_Interface.hpp.
References from_string().
|
inline |
Description method for pretty printing the values in this class.
Definition at line 651 of file MOTION_Interface.hpp.
|
inline |
Perform an 'Action'.
current | the current stance |
a | the 'Action' to perform |
Definition at line 537 of file MOTION_Interface.hpp.
References guWhiteboard::Motions::Action_Transition::_cost, guWhiteboard::Motions::Action_Transition::_s, guWhiteboard::Motions::Stance_Path::_stances, guWhiteboard::Motions::Stance_Path::add_stance(), guWhiteboard::Motions::Stance_Path::cost(), guWhiteboard::Motions::A::create_actions(), guWhiteboard::Motions::NUM_OF_STANCES, and guWhiteboard::Motions::Stance_Path::offset().
Referenced by from_string().
|
inline |
Parser for recreating this class.
Sets head and/or body stiffness, and/or starts a motion. [0|1][,0|1][[,]motion_command]
str | the string to parse and use to recreate the this object |
Definition at line 567 of file MOTION_Interface.hpp.
References DoAction(), guWhiteboard::Motions::FallenBack_stance, guWhiteboard::Motions::FallenForward_stance, guWhiteboard::Motions::GoalieSaveLeft_stance, guWhiteboard::Motions::GoalieSaveRight_stance, GoToStance(), guWhiteboard::Motions::Kneeling_flagwave, guWhiteboard::Motions::Kneeling_quickwave, guWhiteboard::Motions::Kneeling_stance, guWhiteboard::Motions::Kneeling_wave, guWhiteboard::Motions::Motions, MY_CHECK_ENUM, guWhiteboard::Motions::NUM_OF_ACTIONS, NUM_OF_STANCES, guWhiteboard::Motions::Standby_stance, guWhiteboard::Motions::Standing_leftkick, guWhiteboard::Motions::Standing_leftpass, guWhiteboard::Motions::Standing_rightkick, guWhiteboard::Motions::Standing_rightpass, guWhiteboard::Motions::Standing_stance, and guWhiteboard::Motions::Standing_wave.
Referenced by MOTION_Commands().
|
inline |
Transition from one 'Stance' to another.
current | the current stance |
desired | the stance it's trying to get to |
Definition at line 508 of file MOTION_Interface.hpp.
References guWhiteboard::Motions::Stance_Path::_stances, guWhiteboard::Motions::Stance_Path::add_stance(), guWhiteboard::Motions::Stance_Path::cost(), guWhiteboard::Motions::NUM_OF_STANCES, guWhiteboard::Motions::Stance_Path::offset(), and guWhiteboard::Motions::Stance_Path::pretty_print().
Referenced by from_string().