Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
towr::GaitGenerator Class Referenceabstract

Generates endeffector phase durations for predefined gait styles. More...

#include <gait_generator.h>

Inheritance diagram for towr::GaitGenerator:
Inheritance graph
[legend]

Public Types

enum  Combos {
  C0, C1, C2, C3,
  C4, COMBO_COUNT
}
 Predefined combinations of different strides. More...
 
using ContactState = std::vector< bool >
 
using EE = uint
 
using FootDurations = std::vector< VecTimes >
 
using GaitInfo = std::pair< VecTimes, std::vector< ContactState >>
 
enum  Gaits {
  Stand =0, Flight, Walk1, Walk2,
  Walk2E, Run2, Run2E, Run1,
  Run1E, Run3, Run3E, Hop1,
  Hop1E, Hop2, Hop3, Hop3E,
  Hop5, Hop5E, GAIT_COUNT
}
 Predefined strides, each with a different gait diagram. More...
 
using Ptr = std::shared_ptr< GaitGenerator >
 
using VecTimes = std::vector< double >
 

Public Member Functions

 GaitGenerator ()=default
 
VecTimes GetPhaseDurations (double T, EE ee) const
 
bool IsInContactAtStart (EE ee) const
 
virtual void SetCombo (Combos combo)=0
 Sets a specific sequence of gaits. More...
 
void SetGaits (const std::vector< Gaits > &gaits)
 Sets the times_ and contacts_ variables according to the gaits. More...
 
virtual ~GaitGenerator ()=default
 

Static Public Member Functions

static Ptr MakeGaitGenerator (int leg_count)
 

Protected Member Functions

GaitInfo RemoveTransition (const GaitInfo &g) const
 

Protected Attributes

std::vector< ContactStatecontacts_
 
std::vector< double > times_
 Phase times for the complete robot during which no contact state changes. More...
 

Private Member Functions

virtual GaitInfo GetGait (Gaits gait) const =0
 
VecTimes GetNormalizedPhaseDurations (EE ee) const
 
FootDurations GetPhaseDurations () const
 

Detailed Description

Generates endeffector phase durations for predefined gait styles.

These gaits (e.g. quadruped trotting, biped walking) are used to initialize the towr optimization problem.

Definition at line 46 of file gait_generator.h.

Member Typedef Documentation

using towr::GaitGenerator::ContactState = std::vector<bool>

Definition at line 51 of file gait_generator.h.

Definition at line 53 of file gait_generator.h.

Definition at line 50 of file gait_generator.h.

using towr::GaitGenerator::GaitInfo = std::pair<VecTimes,std::vector<ContactState>>

Definition at line 52 of file gait_generator.h.

using towr::GaitGenerator::Ptr = std::shared_ptr<GaitGenerator>

Definition at line 48 of file gait_generator.h.

using towr::GaitGenerator::VecTimes = std::vector<double>

Definition at line 49 of file gait_generator.h.

Member Enumeration Documentation

Predefined combinations of different strides.

Enumerator
C0 
C1 
C2 
C3 
C4 
COMBO_COUNT 

Definition at line 58 of file gait_generator.h.

Predefined strides, each with a different gait diagram.

Enumerator
Stand 
Flight 
Walk1 
Walk2 
Walk2E 
Run2 
Run2E 
Run1 
Run1E 
Run3 
Run3E 
Hop1 
Hop1E 
Hop2 
Hop3 
Hop3E 
Hop5 
Hop5E 
GAIT_COUNT 

Definition at line 63 of file gait_generator.h.

Constructor & Destructor Documentation

towr::GaitGenerator::GaitGenerator ( )
default
virtual towr::GaitGenerator::~GaitGenerator ( )
virtualdefault

Member Function Documentation

virtual GaitInfo towr::GaitGenerator::GetGait ( Gaits  gait) const
privatepure virtual
GaitGenerator::VecTimes towr::GaitGenerator::GetNormalizedPhaseDurations ( EE  ee) const
private

Definition at line 66 of file gait_generator.cc.

GaitGenerator::VecTimes towr::GaitGenerator::GetPhaseDurations ( double  T,
EE  ee 
) const
Returns
the swing and stance durations for the set gait.
Parameters
eeendeffector for which the phase durations are desired.
Ttotal time for all phases, durations are scaled by that.

Definition at line 55 of file gait_generator.cc.

GaitGenerator::FootDurations towr::GaitGenerator::GetPhaseDurations ( ) const
private

Definition at line 77 of file gait_generator.cc.

bool towr::GaitGenerator::IsInContactAtStart ( EE  ee) const
Returns
true if the foot is initially in contact with the environment.
Parameters
eeThe endeffector/foot/hand.

Definition at line 108 of file gait_generator.cc.

GaitGenerator::Ptr towr::GaitGenerator::MakeGaitGenerator ( int  leg_count)
static

Definition at line 44 of file gait_generator.cc.

GaitGenerator::GaitInfo towr::GaitGenerator::RemoveTransition ( const GaitInfo g) const
protected

Removes the last phase that would transition to a new stride. This is usually necessary for a gait change.

Definition at line 132 of file gait_generator.cc.

virtual void towr::GaitGenerator::SetCombo ( Combos  combo)
pure virtual

Sets a specific sequence of gaits.

The derived class decides what each combo maps to. This function then fills the times_ and contacts_ variables accordingly.

Implemented in towr::QuadrupedGaitGenerator, towr::BipedGaitGenerator, and towr::MonopedGaitGenerator.

void towr::GaitGenerator::SetGaits ( const std::vector< Gaits > &  gaits)

Sets the times_ and contacts_ variables according to the gaits.

Parameters
gaitsThe sequence of steps which defines gait. For example use {Stand,Walk1,Walk1,Stand} to declare walking gait with two steps.

Definition at line 114 of file gait_generator.cc.

Member Data Documentation

std::vector<ContactState> towr::GaitGenerator::contacts_
protected

The contact state for the complete robot. The size of this vector must be equal to the above times_.

Definition at line 109 of file gait_generator.h.

std::vector<double> towr::GaitGenerator::times_
protected

Phase times for the complete robot during which no contact state changes.

Definition at line 103 of file gait_generator.h.


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


towr
Author(s): Alexander W. Winkler
autogenerated on Fri Apr 2 2021 02:14:16