Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
towr::PhaseDurations Class Reference

A variable set composed of the phase durations of an endeffector. More...

#include <phase_durations.h>

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

Public Types

using EndeffectorID = uint
 
using Ptr = std::shared_ptr< PhaseDurations >
 
using VecDurations = std::vector< double >
 

Public Member Functions

void AddObserver (PhaseDurationsObserver *const spline)
 Adds observer that is updated every time new variables are set. More...
 
VecBound GetBounds () const override
 
Jacobian GetJacobianOfPos (int phase, const VectorXd &dx_dT, const VectorXd &xd) const
 How a change in the phase durations affect the position of a spline. More...
 
VecDurations GetPhaseDurations () const
 
virtual VectorXd GetValues () const override
 
bool IsContactPhase (double t) const
 Whether the endeffector is in contact with the environment. More...
 
 PhaseDurations (EndeffectorID ee, const VecDurations &initial_durations, bool is_first_phase_in_contact, double min_phase_duration, double max_phase_duration)
 Constructs a variable set for a specific endeffector. More...
 
virtual void SetVariables (const VectorXd &x) override
 Sets the phase durations from pure Eigen optimization variables. More...
 
virtual ~PhaseDurations ()=default
 

Private Member Functions

void UpdateObservers () const
 

Private Attributes

VecDurations durations_
 
bool initial_contact_state_
 true if first phase in contact More...
 
std::vector< PhaseDurationsObserver * > observers_
 
ifopt::Bounds phase_duration_bounds_
 
double t_total_
 

Detailed Description

A variable set composed of the phase durations of an endeffector.

This class holds the current variables determining the alternating swing- and stance durations of one foot. These durations are then used in the Spline together with NodeVariables to construct foot motions and forces.

Definition at line 46 of file phase_durations.h.

Member Typedef Documentation

Definition at line 50 of file phase_durations.h.

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

Definition at line 48 of file phase_durations.h.

using towr::PhaseDurations::VecDurations = std::vector<double>

Definition at line 49 of file phase_durations.h.

Constructor & Destructor Documentation

towr::PhaseDurations::PhaseDurations ( EndeffectorID  ee,
const VecDurations initial_durations,
bool  is_first_phase_in_contact,
double  min_phase_duration,
double  max_phase_duration 
)

Constructs a variable set for a specific endeffector.

Parameters
eeThe endeffector ID which these durations apply to.
initial_durationsInitial values for the optimization variables.
min_phase_durationThe minimum allowable time for one phase.
max_phase_durationThe maximum allowable time for one phase.

Definition at line 41 of file phase_durations.cc.

virtual towr::PhaseDurations::~PhaseDurations ( )
virtualdefault

Member Function Documentation

void towr::PhaseDurations::AddObserver ( PhaseDurationsObserver *const  spline)

Adds observer that is updated every time new variables are set.

Parameters
splineA pointer to a Hermite spline using the durations.

Definition at line 56 of file phase_durations.cc.

PhaseDurations::VecBound towr::PhaseDurations::GetBounds ( ) const
override
Returns
The maximum and minimum time each phase is allowed to take.

Definition at line 91 of file phase_durations.cc.

PhaseDurations::Jacobian towr::PhaseDurations::GetJacobianOfPos ( int  phase,
const VectorXd dx_dT,
const VectorXd xd 
) const

How a change in the phase durations affect the position of a spline.

Parameters
phaseThe current phase the spline is in at time t.
dx_dTThe derivative of the spline position w.r.t the phase durations T.
xdThe velocity of the spline at the current time t.
Returns
A pxn dimensional Jacobian where: p: number of dimensions of the spline (e.g. x,y,z) n: number of phase durations in this class that are optimized over.

This method is related to constructing a cubic-Hermite spline with these phase durations. Leaving the node values unchanged, the shape of the spline can also be changed by expanding or compressing the individual polynomials through the duration. This method quantifies the sensitivity of the spline position on these durations.

Definition at line 115 of file phase_durations.cc.

PhaseDurations::VecDurations towr::PhaseDurations::GetPhaseDurations ( ) const
Returns
The durations (stance, swing, ...) for each phase of this foot.

Definition at line 102 of file phase_durations.cc.

Eigen::VectorXd towr::PhaseDurations::GetValues ( ) const
overridevirtual
Returns
The optimization variables (phase durations [s]).

Definition at line 69 of file phase_durations.cc.

bool towr::PhaseDurations::IsContactPhase ( double  t) const

Whether the endeffector is in contact with the environment.

Parameters
tglobal time along the trajectory.

Definition at line 108 of file phase_durations.cc.

void towr::PhaseDurations::SetVariables ( const VectorXd x)
overridevirtual

Sets the phase durations from pure Eigen optimization variables.

Definition at line 80 of file phase_durations.cc.

void towr::PhaseDurations::UpdateObservers ( ) const
private

Definition at line 62 of file phase_durations.cc.

Member Data Documentation

VecDurations towr::PhaseDurations::durations_
private

Definition at line 117 of file phase_durations.h.

bool towr::PhaseDurations::initial_contact_state_
private

true if first phase in contact

Definition at line 120 of file phase_durations.h.

std::vector<PhaseDurationsObserver*> towr::PhaseDurations::observers_
private

Definition at line 123 of file phase_durations.h.

ifopt::Bounds towr::PhaseDurations::phase_duration_bounds_
private

Definition at line 121 of file phase_durations.h.

double towr::PhaseDurations::t_total_
private

Definition at line 119 of file phase_durations.h.


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


towr_core
Author(s): Alexander W. Winkler
autogenerated on Sat Apr 7 2018 02:15:58