lipm_walking::PlanInterpolator Struct Reference

Footstep plan interpolator. More...

#include <lipm_walking/PlanInterpolator.h>

Public Types

enum  Gait {
  Gait::Walk,
  Gait::Shuffle,
  Gait::Turn
}
 Gait type. More...
 
using SE2d = lipm_walking::utils::SE2d
 

Public Member Functions

 PlanInterpolator (std::shared_ptr< mc_rtc::gui::StateBuilder > gui)
 Initialization just stores the GUI handle for later. More...
 
void addGUIElements ()
 Add GUI panel. More...
 
void configure (const mc_rtc::Configuration &config)
 Read configuration from dictionary. More...
 
void removeGUIElements ()
 Remove GUI panel. More...
 
void run ()
 Generate a new footstep plan. More...
 
void suggestGait ()
 Suggest gait based on local target coordinates. More...
 
void updateSupportPath (const sva::PTransformd &X_0_lf, const sva::PTransformd &X_0_rf)
 Update support path display. More...
 
std::vector< std::string > availablePlans () const
 List available contact plans. More...
 
const std::string & customPlanName () const
 Get name of current custom footstep plan. More...
 
std::string gait () const noexcept
 Get current gait as string. More...
 
void gait (const std::string &dir)
 Update gait. More...
 
FootstepPlan getPlan (std::string name)
 Get contact plan. More...
 
void restoreBackwardTarget ()
 Restore last backward target. More...
 
void restoreForwardTarget ()
 Restore last forward target. More...
 
void restoreLateralTarget ()
 Restore last lateral target. More...
 
double stepWidth () const
 Get step width. More...
 
void stepWidth (double stepWidth)
 Set step width. More...
 
const sva::PTransformd & worldReference () const
 Get walking target in world frame. More...
 
void worldReference (const sva::PTransformd &worldReference)
 Set walking target in world frame. More...
 
bool checkPlanUpdated ()
 Checks whether the plan has been recomputed (run() was called) More...
 

Static Public Attributes

static constexpr double DEFAULT_EXTRA_STEP_WIDTH = 0.
 
static constexpr double IN_PLACE_EXTRA_STEP_WIDTH = 0.02
 
static constexpr double IN_PLACE_MAX_STEP_ANGLE = 45.
 
static constexpr double MAX_EXTRA_STEP_WIDTH = 0.05
 
static constexpr double MAX_LATERAL_STEP_LENGTH = 0.2
 
static constexpr double MAX_SAGITTAL_STEP_LENGTH = 0.4
 
static constexpr double MIN_STEP_LENGTH = 0.001
 

Detailed Description

Footstep plan interpolator.

Definition at line 50 of file PlanInterpolator.h.

Member Typedef Documentation

◆ SE2d

Member Enumeration Documentation

◆ Gait

Gait type.

Walking is the most common one, where footsteps alternate on each side of the support path. Shuffling is used for lateral stepping: after each step, the robot brings back the other foot next to the current one. Turning is a special pattern where only footstep orientations change.

Enumerator
Walk 
Shuffle 
Turn 

Definition at line 72 of file PlanInterpolator.h.

Constructor & Destructor Documentation

◆ PlanInterpolator()

lipm_walking::PlanInterpolator::PlanInterpolator ( std::shared_ptr< mc_rtc::gui::StateBuilder >  gui)
inline

Initialization just stores the GUI handle for later.

Parameters
guiGUI handle.

Definition at line 84 of file PlanInterpolator.h.

Member Function Documentation

◆ addGUIElements()

void lipm_walking::PlanInterpolator::addGUIElements ( )

Add GUI panel.

Definition at line 42 of file PlanInterpolator.cpp.

◆ availablePlans()

std::vector<std::string> lipm_walking::PlanInterpolator::availablePlans ( ) const
inline

List available contact plans.

Returns
keys Names of available contact plans.

Definition at line 127 of file PlanInterpolator.h.

◆ checkPlanUpdated()

bool lipm_walking::PlanInterpolator::checkPlanUpdated ( )
inline

Checks whether the plan has been recomputed (run() was called)

Warning
This function is intended to be used only once to check and handle the updated plan status. All subsequent calls of this function until the next call of run() will return false
Returns
true If the plan has been updated
false Otherwise

Definition at line 286 of file PlanInterpolator.h.

◆ configure()

void lipm_walking::PlanInterpolator::configure ( const mc_rtc::Configuration &  config)

Read configuration from dictionary.

Parameters
configConfiguration dictionary.

Definition at line 179 of file PlanInterpolator.cpp.

◆ customPlanName()

const std::string& lipm_walking::PlanInterpolator::customPlanName ( ) const
inline

Get name of current custom footstep plan.

Returns
name Name of custom plan.

Definition at line 137 of file PlanInterpolator.h.

◆ gait() [1/2]

std::string lipm_walking::PlanInterpolator::gait ( ) const
inlinenoexcept

Get current gait as string.

Returns
gait Current gait string.

Definition at line 147 of file PlanInterpolator.h.

◆ gait() [2/2]

void lipm_walking::PlanInterpolator::gait ( const std::string &  dir)
inline

Update gait.

Parameters
dirNew gait direction.

Definition at line 168 of file PlanInterpolator.h.

◆ getPlan()

FootstepPlan lipm_walking::PlanInterpolator::getPlan ( std::string  name)
inline

Get contact plan.

Returns
plan Footstep plan.

Definition at line 195 of file PlanInterpolator.h.

◆ removeGUIElements()

void lipm_walking::PlanInterpolator::removeGUIElements ( )

Remove GUI panel.

Definition at line 136 of file PlanInterpolator.cpp.

◆ restoreBackwardTarget()

void lipm_walking::PlanInterpolator::restoreBackwardTarget ( )
inline

Restore last backward target.

Definition at line 210 of file PlanInterpolator.h.

◆ restoreForwardTarget()

void lipm_walking::PlanInterpolator::restoreForwardTarget ( )
inline

Restore last forward target.

Definition at line 220 of file PlanInterpolator.h.

◆ restoreLateralTarget()

void lipm_walking::PlanInterpolator::restoreLateralTarget ( )
inline

Restore last lateral target.

Definition at line 230 of file PlanInterpolator.h.

◆ run()

void lipm_walking::PlanInterpolator::run ( )

Generate a new footstep plan.

Definition at line 210 of file PlanInterpolator.cpp.

◆ stepWidth() [1/2]

double lipm_walking::PlanInterpolator::stepWidth ( ) const
inline

Get step width.

Returns
width Step width.

Definition at line 242 of file PlanInterpolator.h.

◆ stepWidth() [2/2]

void lipm_walking::PlanInterpolator::stepWidth ( double  stepWidth)
inline

Set step width.

  • Parameters
    stepWidthStep width.
    Note
    Step width is defined as the lateral distance between left and right foot centers. See Figure 3-9 of Human Walking handbook (Editors J. Rose and J. G. Gamble).

Definition at line 256 of file PlanInterpolator.h.

◆ suggestGait()

void lipm_walking::PlanInterpolator::suggestGait ( )

Suggest gait based on local target coordinates.

Definition at line 165 of file PlanInterpolator.cpp.

◆ updateSupportPath()

void lipm_walking::PlanInterpolator::updateSupportPath ( const sva::PTransformd &  X_0_lf,
const sva::PTransformd &  X_0_rf 
)

Update support path display.

Parameters
X_0_lfLeft foot transform.
X_0_rfRight foot transform.

Definition at line 506 of file PlanInterpolator.cpp.

◆ worldReference() [1/2]

const sva::PTransformd& lipm_walking::PlanInterpolator::worldReference ( ) const
inline

Get walking target in world frame.

Definition at line 264 of file PlanInterpolator.h.

◆ worldReference() [2/2]

void lipm_walking::PlanInterpolator::worldReference ( const sva::PTransformd &  worldReference)
inline

Set walking target in world frame.

Parameters
worldReferenceNew target.

Definition at line 274 of file PlanInterpolator.h.

Member Data Documentation

◆ DEFAULT_EXTRA_STEP_WIDTH

constexpr double lipm_walking::PlanInterpolator::DEFAULT_EXTRA_STEP_WIDTH = 0.
staticconstexpr

Definition at line 56 of file PlanInterpolator.h.

◆ IN_PLACE_EXTRA_STEP_WIDTH

constexpr double lipm_walking::PlanInterpolator::IN_PLACE_EXTRA_STEP_WIDTH = 0.02
staticconstexpr

Definition at line 57 of file PlanInterpolator.h.

◆ IN_PLACE_MAX_STEP_ANGLE

constexpr double lipm_walking::PlanInterpolator::IN_PLACE_MAX_STEP_ANGLE = 45.
staticconstexpr

Definition at line 58 of file PlanInterpolator.h.

◆ MAX_EXTRA_STEP_WIDTH

constexpr double lipm_walking::PlanInterpolator::MAX_EXTRA_STEP_WIDTH = 0.05
staticconstexpr

Definition at line 59 of file PlanInterpolator.h.

◆ MAX_LATERAL_STEP_LENGTH

constexpr double lipm_walking::PlanInterpolator::MAX_LATERAL_STEP_LENGTH = 0.2
staticconstexpr

Definition at line 60 of file PlanInterpolator.h.

◆ MAX_SAGITTAL_STEP_LENGTH

constexpr double lipm_walking::PlanInterpolator::MAX_SAGITTAL_STEP_LENGTH = 0.4
staticconstexpr

Definition at line 61 of file PlanInterpolator.h.

◆ MIN_STEP_LENGTH

constexpr double lipm_walking::PlanInterpolator::MIN_STEP_LENGTH = 0.001
staticconstexpr

Definition at line 62 of file PlanInterpolator.h.