gusimplewhiteboard
guWhiteboard::MOTION_Commands Class Reference

Motion Command class, this class is used to send commands to a motion module via the Whiteboard. More...

#include <MOTION_Interface.hpp>

Collaboration diagram for guWhiteboard::MOTION_Commands:

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...
 

Detailed Description

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.

Examples

Transition from stance::Kneeling to stance::Standing

MOTION_Commands m; 
m.GoToStance(stance::Kneeling, stance::Standing); //Kneeling to Standing
MOTION_Commands_t.set(m) //Set in Whiteboard

From stance::Standing perform an action::left_kick

MOTION_Commands m; 
m.DoAction(stance::Standing, action::left_kick); //from standing, do a left kick
MOTION_Commands_t.set(m) //Set in Whiteboard

Transition from stance::Kneeling to stance::Standing then do an action::left_kick

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.

Constructor & Destructor Documentation

◆ MOTION_Commands()

guWhiteboard::MOTION_Commands::MOTION_Commands ( const std::string &  str)
inline

String constructor.

Parameters
strthe string to parse and use to recreate the this object

Definition at line 561 of file MOTION_Interface.hpp.

References from_string().

Member Function Documentation

◆ description()

std::string guWhiteboard::MOTION_Commands::description ( ) const
inline

Description method for pretty printing the values in this class.

Returns
pretty printed string

Definition at line 651 of file MOTION_Interface.hpp.

◆ DoAction()

long guWhiteboard::MOTION_Commands::DoAction ( Motions::stance  current,
Motions::action  a 
)
inline

Perform an 'Action'.

Parameters
currentthe current stance
athe 'Action' to perform
Returns
the time in micro seconds that the motion should take (subject to people keeping the motion times correct in this header)

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().

◆ from_string()

◆ GoToStance()

long guWhiteboard::MOTION_Commands::GoToStance ( Motions::stance  current,
Motions::stance  desired 
)
inline

Transition from one 'Stance' to another.

Parameters
currentthe current stance
desiredthe stance it's trying to get to
Returns
the time in micro seconds that the motion should take (subject to people keeping the motion times correct in this header)

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().


The documentation for this class was generated from the following file: