Generates endeffector phase durations for predefined gait styles. More...
#include <gait_generator.h>
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< ContactState > | contacts_ |
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 |
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.
using towr::GaitGenerator::ContactState = std::vector<bool> |
Definition at line 51 of file gait_generator.h.
using towr::GaitGenerator::EE = uint |
Definition at line 53 of file gait_generator.h.
using towr::GaitGenerator::FootDurations = std::vector<VecTimes> |
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.
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.
|
default |
|
virtualdefault |
Implemented in towr::BipedGaitGenerator, towr::MonopedGaitGenerator, and towr::QuadrupedGaitGenerator.
|
private |
Definition at line 66 of file gait_generator.cc.
GaitGenerator::VecTimes towr::GaitGenerator::GetPhaseDurations | ( | double | T, |
EE | ee | ||
) | const |
ee | endeffector for which the phase durations are desired. |
T | total time for all phases, durations are scaled by that. |
Definition at line 55 of file gait_generator.cc.
|
private |
Definition at line 77 of file gait_generator.cc.
bool towr::GaitGenerator::IsInContactAtStart | ( | EE | ee | ) | const |
ee | The endeffector/foot/hand. |
Definition at line 108 of file gait_generator.cc.
|
static |
Definition at line 44 of file gait_generator.cc.
|
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.
|
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.
gaits | The 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.
|
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.
|
protected |
Phase times for the complete robot during which no contact state changes.
Definition at line 103 of file gait_generator.h.