gusimplewhiteboard
guWhiteboard::NaoWalkCommand Class Reference

Provides a C++ wrapper around wb_nao_walk_command. More...

#include <NaoWalkCommand.hpp>

Inheritance diagram for guWhiteboard::NaoWalkCommand:
Collaboration diagram for guWhiteboard::NaoWalkCommand:

Public Member Functions

 NaoWalkCommand (bool t_walkEngineOn=false, int16_t t_forward=0, int16_t t_left=0, int8_t t_turn=0, bool t_exactStepsRequested=false, uint8_t t_speed=100, uint8_t t_odometryResetCounter=0, bool t_isFast=false, bool t_kickWithLeftFoot=true, bool t_useShuffle=true, bool t_leftArmLimp=false, bool t_rightArmLimp=false, uint8_t t_power=0, uint8_t t_bend=0)
 Create a new NaoWalkCommand. More...
 
 NaoWalkCommand (const NaoWalkCommand &t_other)
 Copy Constructor. More...
 
 NaoWalkCommand (const struct wb_nao_walk_command &t_other)
 Copy Constructor. More...
 
NaoWalkCommandoperator= (const NaoWalkCommand &t_other)
 Copy Assignment Operator. More...
 
NaoWalkCommandoperator= (const struct wb_nao_walk_command &t_other)
 Copy Assignment Operator. More...
 
bool operator== (const NaoWalkCommand &t_other) const
 
bool operator!= (const NaoWalkCommand &t_other) const
 
bool operator== (const wb_nao_walk_command &t_other) const
 
bool operator!= (const wb_nao_walk_command &t_other) const
 
bool & walkEngineOn ()
 
const bool & walkEngineOn () const
 
void set_walkEngineOn (const bool &t_newValue)
 
int16_t & forward ()
 
const int16_t & forward () const
 
void set_forward (const int16_t &t_newValue)
 
int16_t & left ()
 
const int16_t & left () const
 
void set_left (const int16_t &t_newValue)
 
int8_t & turn ()
 
const int8_t & turn () const
 
void set_turn (const int8_t &t_newValue)
 
bool & exactStepsRequested ()
 
const bool & exactStepsRequested () const
 
void set_exactStepsRequested (const bool &t_newValue)
 
uint8_t & speed ()
 
const uint8_t & speed () const
 
void set_speed (const uint8_t &t_newValue)
 
uint8_t & odometryResetCounter ()
 
const uint8_t & odometryResetCounter () const
 
void set_odometryResetCounter (const uint8_t &t_newValue)
 
bool & isFast ()
 
const bool & isFast () const
 
void set_isFast (const bool &t_newValue)
 
bool & kickWithLeftFoot ()
 
const bool & kickWithLeftFoot () const
 
void set_kickWithLeftFoot (const bool &t_newValue)
 
bool & useShuffle ()
 
const bool & useShuffle () const
 
void set_useShuffle (const bool &t_newValue)
 
bool & leftArmLimp ()
 
const bool & leftArmLimp () const
 
void set_leftArmLimp (const bool &t_newValue)
 
bool & rightArmLimp ()
 
const bool & rightArmLimp () const
 
void set_rightArmLimp (const bool &t_newValue)
 
uint8_t & power ()
 
const uint8_t & power () const
 
void set_power (const uint8_t &t_newValue)
 
uint8_t & bend ()
 
const uint8_t & bend () const
 
void set_bend (const uint8_t &t_newValue)
 
 NaoWalkCommand (const std::string &t_str)
 String Constructor. More...
 
std::string description ()
 
std::string to_string ()
 
void from_string (const std::string &t_str)
 

Static Public Member Functions

static NaoWalkCommand walk (int16_t t_forward, int16_t t_left, int8_t t_turn)
 WHITEBOARD_POSTER_STRING_CONVERSION. More...
 
static NaoWalkCommand walkPrecisely (int16_t t_forward, int16_t t_left, int8_t t_turn)
 Convenience function to make the nao walk, with precise step distances. More...
 
static NaoWalkCommand stop ()
 Convenience function to make the nao stop walking. More...
 
static NaoWalkCommand standWithStiffness ()
 Convenience function to make the nao stand in the 'walk' position (slightly crouched), ready to immediately start walking again. More...
 
static NaoWalkCommand standWithMinimalStiffness ()
 Convenience function to make the nao stand in the 'STANDING' position, upright with minimal stiffness. More...
 
static NaoWalkCommand disconnectWalk ()
 Convenience function to disconnect the walk engine from the DCM. More...
 

Additional Inherited Members

- Public Attributes inherited from wb_nao_walk_command
bool walkEngineOn
 connects the dcm callbacks. More...
 
int16_t forward
 [-300 - 300] step-size(mm) per second, limited to +/- 300mm/step More...
 
int16_t left
 [-200 - 200] step-size(mm) per second, limited to +/- 200mm/step More...
 
int8_t turn
 [-85 - 85] step-size(mm) per second, limited to +/- 85deg/step More...
 
bool exactStepsRequested
 No ratcheting, no speed 'buildup', just full step sizes. More...
 
uint8_t speed
 [0 - 100] modifier for forward etc. More...
 
uint8_t odometryResetCounter
 Odometry will reset any time this is changed or incremented. More...
 
bool isFast
 for kicks. More...
 
bool kickWithLeftFoot
 which foot to use for kicking More...
 
bool useShuffle
 limits the step height so the robot 'shuffles' instead of taking larger steps. More...
 
bool leftArmLimp
 lower stiffness in the arms when walking, allows the arm to move a little more. More...
 
bool rightArmLimp
 lower stiffness in the arms when walking, allows the arm to move a little more. More...
 
uint8_t power
 [0 - 100] stiffness, auto set to minimum needed values. More...
 
uint8_t bend
 [0 - 1] controls what the robot does when stopped, 0 == STAND and lower stiffness, 1 == stay in READY, crouched and ready to walk immediately. More...
 

Detailed Description

Provides a C++ wrapper around wb_nao_walk_command.

Definition at line 83 of file NaoWalkCommand.hpp.

Constructor & Destructor Documentation

◆ NaoWalkCommand() [1/4]

guWhiteboard::NaoWalkCommand::NaoWalkCommand ( bool  t_walkEngineOn = false,
int16_t  t_forward = 0,
int16_t  t_left = 0,
int8_t  t_turn = 0,
bool  t_exactStepsRequested = false,
uint8_t  t_speed = 100,
uint8_t  t_odometryResetCounter = 0,
bool  t_isFast = false,
bool  t_kickWithLeftFoot = true,
bool  t_useShuffle = true,
bool  t_leftArmLimp = false,
bool  t_rightArmLimp = false,
uint8_t  t_power = 0,
uint8_t  t_bend = 0 
)
inline

Create a new NaoWalkCommand.

Definition at line 112 of file NaoWalkCommand.hpp.

Referenced by disconnectWalk(), operator==(), stop(), and walk().

◆ NaoWalkCommand() [2/4]

guWhiteboard::NaoWalkCommand::NaoWalkCommand ( const NaoWalkCommand t_other)
inline

◆ NaoWalkCommand() [3/4]

◆ NaoWalkCommand() [4/4]

guWhiteboard::NaoWalkCommand::NaoWalkCommand ( const std::string &  t_str)
inline

String Constructor.

Definition at line 393 of file NaoWalkCommand.hpp.

References from_string().

Member Function Documentation

◆ bend() [1/2]

uint8_t & guWhiteboard::NaoWalkCommand::bend ( )
inline

◆ bend() [2/2]

const uint8_t & guWhiteboard::NaoWalkCommand::bend ( ) const
inline

Definition at line 379 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::bend.

◆ description()

std::string guWhiteboard::NaoWalkCommand::description ( )
inline

◆ disconnectWalk()

static NaoWalkCommand guWhiteboard::NaoWalkCommand::disconnectWalk ( )
inlinestatic

Convenience function to disconnect the walk engine from the DCM.

This must be done in order to give control of the joints to another module, like the Motion Player. You should return to the CROUCH position via 'standWithStiffness' or 'stop' before doing this, to ensure a smooth motion control transition.

Returns
A NaoWalkCommand instance

Definition at line 735 of file NaoWalkCommand.hpp.

References NaoWalkCommand(), and set_walkEngineOn().

◆ exactStepsRequested() [1/2]

bool & guWhiteboard::NaoWalkCommand::exactStepsRequested ( )
inline

◆ exactStepsRequested() [2/2]

const bool & guWhiteboard::NaoWalkCommand::exactStepsRequested ( ) const
inline

Definition at line 244 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::exactStepsRequested.

◆ forward() [1/2]

int16_t & guWhiteboard::NaoWalkCommand::forward ( )
inline

◆ forward() [2/2]

const int16_t & guWhiteboard::NaoWalkCommand::forward ( ) const
inline

Definition at line 199 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::forward.

◆ from_string()

void guWhiteboard::NaoWalkCommand::from_string ( const std::string &  t_str)
inline

◆ isFast() [1/2]

bool & guWhiteboard::NaoWalkCommand::isFast ( )
inline

◆ isFast() [2/2]

const bool & guWhiteboard::NaoWalkCommand::isFast ( ) const
inline

Definition at line 289 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::isFast.

◆ kickWithLeftFoot() [1/2]

bool & guWhiteboard::NaoWalkCommand::kickWithLeftFoot ( )
inline

◆ kickWithLeftFoot() [2/2]

const bool & guWhiteboard::NaoWalkCommand::kickWithLeftFoot ( ) const
inline

Definition at line 304 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::kickWithLeftFoot.

◆ left() [1/2]

int16_t & guWhiteboard::NaoWalkCommand::left ( )
inline

◆ left() [2/2]

const int16_t & guWhiteboard::NaoWalkCommand::left ( ) const
inline

Definition at line 214 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::left.

◆ leftArmLimp() [1/2]

bool & guWhiteboard::NaoWalkCommand::leftArmLimp ( )
inline

◆ leftArmLimp() [2/2]

const bool & guWhiteboard::NaoWalkCommand::leftArmLimp ( ) const
inline

Definition at line 334 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::leftArmLimp.

◆ odometryResetCounter() [1/2]

uint8_t & guWhiteboard::NaoWalkCommand::odometryResetCounter ( )
inline

◆ odometryResetCounter() [2/2]

const uint8_t & guWhiteboard::NaoWalkCommand::odometryResetCounter ( ) const
inline

Definition at line 274 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::odometryResetCounter.

◆ operator!=() [1/2]

bool guWhiteboard::NaoWalkCommand::operator!= ( const NaoWalkCommand t_other) const
inline

Definition at line 164 of file NaoWalkCommand.hpp.

◆ operator!=() [2/2]

bool guWhiteboard::NaoWalkCommand::operator!= ( const wb_nao_walk_command t_other) const
inline

Definition at line 174 of file NaoWalkCommand.hpp.

◆ operator=() [1/2]

NaoWalkCommand & guWhiteboard::NaoWalkCommand::operator= ( const NaoWalkCommand t_other)
inline

◆ operator=() [2/2]

◆ operator==() [1/2]

bool guWhiteboard::NaoWalkCommand::operator== ( const NaoWalkCommand t_other) const
inline

◆ operator==() [2/2]

bool guWhiteboard::NaoWalkCommand::operator== ( const wb_nao_walk_command t_other) const
inline

Definition at line 169 of file NaoWalkCommand.hpp.

References NaoWalkCommand().

◆ power() [1/2]

uint8_t & guWhiteboard::NaoWalkCommand::power ( )
inline

◆ power() [2/2]

const uint8_t & guWhiteboard::NaoWalkCommand::power ( ) const
inline

Definition at line 364 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::power.

◆ rightArmLimp() [1/2]

bool & guWhiteboard::NaoWalkCommand::rightArmLimp ( )
inline

◆ rightArmLimp() [2/2]

const bool & guWhiteboard::NaoWalkCommand::rightArmLimp ( ) const
inline

Definition at line 349 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::rightArmLimp.

◆ set_bend()

void guWhiteboard::NaoWalkCommand::set_bend ( const uint8_t &  t_newValue)
inline

◆ set_exactStepsRequested()

void guWhiteboard::NaoWalkCommand::set_exactStepsRequested ( const bool &  t_newValue)
inline

Definition at line 249 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::exactStepsRequested.

Referenced by from_string(), and walkPrecisely().

◆ set_forward()

void guWhiteboard::NaoWalkCommand::set_forward ( const int16_t &  t_newValue)
inline

Definition at line 204 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::forward.

Referenced by from_string(), stop(), and walk().

◆ set_isFast()

void guWhiteboard::NaoWalkCommand::set_isFast ( const bool &  t_newValue)
inline

Definition at line 294 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::isFast.

Referenced by from_string().

◆ set_kickWithLeftFoot()

void guWhiteboard::NaoWalkCommand::set_kickWithLeftFoot ( const bool &  t_newValue)
inline

Definition at line 309 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::kickWithLeftFoot.

Referenced by from_string().

◆ set_left()

void guWhiteboard::NaoWalkCommand::set_left ( const int16_t &  t_newValue)
inline

Definition at line 219 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::left.

Referenced by from_string(), stop(), and walk().

◆ set_leftArmLimp()

void guWhiteboard::NaoWalkCommand::set_leftArmLimp ( const bool &  t_newValue)
inline

Definition at line 339 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::leftArmLimp.

Referenced by from_string().

◆ set_odometryResetCounter()

void guWhiteboard::NaoWalkCommand::set_odometryResetCounter ( const uint8_t &  t_newValue)
inline

Definition at line 279 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::odometryResetCounter.

Referenced by from_string().

◆ set_power()

void guWhiteboard::NaoWalkCommand::set_power ( const uint8_t &  t_newValue)
inline

Definition at line 369 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::power.

Referenced by from_string().

◆ set_rightArmLimp()

void guWhiteboard::NaoWalkCommand::set_rightArmLimp ( const bool &  t_newValue)
inline

Definition at line 354 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::rightArmLimp.

Referenced by from_string().

◆ set_speed()

void guWhiteboard::NaoWalkCommand::set_speed ( const uint8_t &  t_newValue)
inline

Definition at line 264 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::speed.

Referenced by from_string().

◆ set_turn()

void guWhiteboard::NaoWalkCommand::set_turn ( const int8_t &  t_newValue)
inline

Definition at line 234 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::turn.

Referenced by from_string(), stop(), and walk().

◆ set_useShuffle()

void guWhiteboard::NaoWalkCommand::set_useShuffle ( const bool &  t_newValue)
inline

Definition at line 324 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::useShuffle.

Referenced by from_string().

◆ set_walkEngineOn()

void guWhiteboard::NaoWalkCommand::set_walkEngineOn ( const bool &  t_newValue)
inline

◆ speed() [1/2]

uint8_t & guWhiteboard::NaoWalkCommand::speed ( )
inline

◆ speed() [2/2]

const uint8_t & guWhiteboard::NaoWalkCommand::speed ( ) const
inline

Definition at line 259 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::speed.

◆ standWithMinimalStiffness()

static NaoWalkCommand guWhiteboard::NaoWalkCommand::standWithMinimalStiffness ( )
inlinestatic

Convenience function to make the nao stand in the 'STANDING' position, upright with minimal stiffness.

Good for longer pauses in movement, to save on battery and motor wear. You should always return to the CROUCH position before giving up control of the DCM with a 'disconnectWalk'. If you don't return to that position, other motion activities like the MotionPlayer may 'jerk' when activated. You do not need to return to the CROUCH position when you issue walk commands, it will be done automatically.

Returns
A NaoWalkCommand instance

Definition at line 724 of file NaoWalkCommand.hpp.

References set_bend(), set_walkEngineOn(), and stop().

◆ standWithStiffness()

static NaoWalkCommand guWhiteboard::NaoWalkCommand::standWithStiffness ( )
inlinestatic

Convenience function to make the nao stand in the 'walk' position (slightly crouched), ready to immediately start walking again.

This is handy for returning from the STANDING position, reached via 'standWithMinimalStiffness'.

Returns
A NaoWalkCommand instance

Definition at line 713 of file NaoWalkCommand.hpp.

References set_bend(), set_walkEngineOn(), and stop().

◆ stop()

static NaoWalkCommand guWhiteboard::NaoWalkCommand::stop ( )
inlinestatic

Convenience function to make the nao stop walking.

The robot will slow down and stop, remaining in the 'walking' position (slightly crouched).

Returns
A NaoWalkCommand instance

Definition at line 699 of file NaoWalkCommand.hpp.

References NaoWalkCommand(), set_bend(), set_forward(), set_left(), set_turn(), and set_walkEngineOn().

Referenced by standWithMinimalStiffness(), and standWithStiffness().

◆ to_string()

std::string guWhiteboard::NaoWalkCommand::to_string ( )
inline

◆ turn() [1/2]

int8_t & guWhiteboard::NaoWalkCommand::turn ( )
inline

◆ turn() [2/2]

const int8_t & guWhiteboard::NaoWalkCommand::turn ( ) const
inline

Definition at line 229 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::turn.

◆ useShuffle() [1/2]

bool & guWhiteboard::NaoWalkCommand::useShuffle ( )
inline

◆ useShuffle() [2/2]

const bool & guWhiteboard::NaoWalkCommand::useShuffle ( ) const
inline

Definition at line 319 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::useShuffle.

◆ walk()

static NaoWalkCommand guWhiteboard::NaoWalkCommand::walk ( int16_t  t_forward,
int16_t  t_left,
int8_t  t_turn 
)
inlinestatic

WHITEBOARD_POSTER_STRING_CONVERSION.

Convenience function to make the nao walk.

Parameters
t_forwardsee struct documentation.
t_leftsee struct documentation.
t_turnsee struct documentation.
Returns
A NaoWalkCommand instance

Definition at line 672 of file NaoWalkCommand.hpp.

References NaoWalkCommand(), set_bend(), set_forward(), set_left(), set_turn(), and set_walkEngineOn().

Referenced by walkPrecisely().

◆ walkEngineOn() [1/2]

bool & guWhiteboard::NaoWalkCommand::walkEngineOn ( )
inline

◆ walkEngineOn() [2/2]

const bool & guWhiteboard::NaoWalkCommand::walkEngineOn ( ) const
inline

Definition at line 184 of file NaoWalkCommand.hpp.

References wb_nao_walk_command::walkEngineOn.

◆ walkPrecisely()

static NaoWalkCommand guWhiteboard::NaoWalkCommand::walkPrecisely ( int16_t  t_forward,
int16_t  t_left,
int8_t  t_turn 
)
inlinestatic

Convenience function to make the nao walk, with precise step distances.

There is no speed buildup with this method, it uses a consistent step size and speed. This is good for small accurate movements, like lining up a kick.

Parameters
t_forwardsee struct documentation.
t_leftsee struct documentation.
t_turnsee struct documentation.
Returns
A NaoWalkCommand instance

Definition at line 689 of file NaoWalkCommand.hpp.

References set_exactStepsRequested(), and walk().


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