gusimplewhiteboard
guWhiteboard::Motions::Stance_Path Class Reference

Internal class for cost based graph search paths, in this case motion paths. More...

#include <MOTION_Interface.hpp>

Collaboration diagram for guWhiteboard::Motions::Stance_Path:

Public Member Functions

 Stance_Path ()
 Constructor. More...
 
int offset ()
 offset getter More...
 
bool valid ()
 is this a valid motion transition More...
 
void invalidate ()
 set this path in invalid More...
 
void reached ()
 did this path get to the desired stance More...
 
int cost ()
 getter for the path cost (aka time) More...
 
void add_stance (stance s, int cost)
 Add the first stance to this path. More...
 
void add_stance (stance s, int cost, int transition)
 Add the first stance to this path. More...
 
void pretty_print ()
 pretty print of the stance path (mainly for debugging) More...
 
bool contains (stance s)
 Check if the current stance path includes the passed in stance. More...
 

Public Attributes

u_int8_t _stances [10]
 the path taken More...
 

Detailed Description

Internal class for cost based graph search paths, in this case motion paths.

This is used to find a valid motion path from one stance to another based on the 'cost' aka the duration of time the motions will take.

Definition at line 215 of file MOTION_Interface.hpp.

Constructor & Destructor Documentation

◆ Stance_Path()

guWhiteboard::Motions::Stance_Path::Stance_Path ( )
inline

Constructor.

Definition at line 227 of file MOTION_Interface.hpp.

Member Function Documentation

◆ add_stance() [1/2]

void guWhiteboard::Motions::Stance_Path::add_stance ( stance  s,
int  cost 
)
inline

Add the first stance to this path.

Parameters
sthe stance
costthe transition cost from the current stance to the new stance 's'

Definition at line 239 of file MOTION_Interface.hpp.

References _stances, cost(), invalidate(), JOINT_CHAIN_MAXSIZE, and u_int8_t.

Referenced by guWhiteboard::MOTION_Commands::DoAction(), and guWhiteboard::MOTION_Commands::GoToStance().

◆ add_stance() [2/2]

void guWhiteboard::Motions::Stance_Path::add_stance ( stance  s,
int  cost,
int  transition 
)
inline

Add the first stance to this path.

Parameters
sthe stance
costthe transition cost from the current stance to the new stance 's'
transitionthe index of the transition in the _transitions vector

Definition at line 246 of file MOTION_Interface.hpp.

References _stances, cost(), invalidate(), JOINT_CHAIN_MAXSIZE, guWhiteboard::Motions::NUM_OF_ACTIONS, guWhiteboard::Motions::NUM_OF_STANCES, and u_int8_t.

◆ contains()

bool guWhiteboard::Motions::Stance_Path::contains ( stance  s)
inline

Check if the current stance path includes the passed in stance.

Parameters
sthe stance to check for
Returns
true, if the path contained the stance

Definition at line 268 of file MOTION_Interface.hpp.

References _stances.

◆ cost()

int guWhiteboard::Motions::Stance_Path::cost ( )
inline

getter for the path cost (aka time)

Definition at line 232 of file MOTION_Interface.hpp.

Referenced by add_stance(), guWhiteboard::MOTION_Commands::DoAction(), and guWhiteboard::MOTION_Commands::GoToStance().

◆ invalidate()

void guWhiteboard::Motions::Stance_Path::invalidate ( )
inline

set this path in invalid

Definition at line 230 of file MOTION_Interface.hpp.

Referenced by add_stance().

◆ offset()

int guWhiteboard::Motions::Stance_Path::offset ( )
inline

◆ pretty_print()

void guWhiteboard::Motions::Stance_Path::pretty_print ( )
inline

pretty print of the stance path (mainly for debugging)

Definition at line 250 of file MOTION_Interface.hpp.

References _stances, and guWhiteboard::Motions::NUM_OF_STANCES.

Referenced by guWhiteboard::MOTION_Commands::GoToStance().

◆ reached()

void guWhiteboard::Motions::Stance_Path::reached ( )
inline

did this path get to the desired stance

Definition at line 231 of file MOTION_Interface.hpp.

◆ valid()

bool guWhiteboard::Motions::Stance_Path::valid ( )
inline

is this a valid motion transition

Definition at line 229 of file MOTION_Interface.hpp.

Member Data Documentation

◆ _stances

u_int8_t guWhiteboard::Motions::Stance_Path::_stances[10]

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