hpp::walkgen::SplineBased Class Reference

Walk motion generator for humanoid legged robot. More...

#include <hpp/walkgen/bspline-based.hh>

Classes

struct  BoundaryCondition
 

Public Types

typedef std::vector< PiecewisePoly3ZmpTrajectory_t
 
typedef std::vector< ZmpTrajectory_tZmpTrajectories_t
 
typedef std::vector< BoundaryCondition, Eigen::aligned_allocator< BoundaryCondition > > BoundaryConditions_t
 
typedef std::vector< value_typeStepHeights_t
 

Public Member Functions

void timeSequence (const Times_t &times)
 set time sequence More...
 
const Times_ttimeSequence () const
 get time sequence More...
 
void footPrintSequence (const FootPrints_t &footPrints)
 set sequence of foot prints More...
 
const FootPrints_tfootPrintSequence () const
 get sequence of foot prints More...
 
void defaultStepHeight (const value_type &stepHeight)
 Set default step height. More...
 
const value_typedefaultStepHeight () const
 Get default step height. More...
 
void stepHeights (const StepHeights_t &stepHeights)
 Set sequence of step heights. More...
 
const StepHeights_tstepHeights () const
 Get sequence of step heights. More...
 
void zmpRefBoundaryConditions (const vector2_t &init, const vector2_t &end)
 Specify zmpref boundary conditions. More...
 
void add (const BoundaryCondition &boundaryCondition)
 Add a boundary condition on center of mass trajectory. More...
 
void setInitialComState (const vector2_t &position, const vector2_t &velocity)
 Set initial position and velocity of center of mass. More...
 
void setEndComState (const vector2_t &position, const vector2_t &velocity)
 Set final position and velocity of center of mass. More...
 
CubicBSplinePtr_t solve () const
 Solve quadratic program and return resulting cubic B spline. More...
 
const PathVectorPtr_tleftFootTrajectory () const
 Get trajectory of left foot. More...
 
const PathVectorPtr_trightFootTrajectory () const
 Get trajectory of right foot. More...
 
DevicePtr_t leftFoot () const
 
DevicePtr_t rightFoot () const
 
const ZmpTrajectory_tzmpRefx () const
 Getter to representation of zmp ref abscissa. More...
 
const ZmpTrajectory_tzmpRefy () const
 Getter to representation of zmp ref abscissa. More...
 
value_type cost (const vector_t &controlPoints)
 Compute the cost of a com trajectory defined by way points. More...
 
value_type cost () const
 Compute the cost of the current com trajectory. More...
 
const ZmpTrajectories_tzmpBasisFunctions () const
 Get base functions of Zmp. More...
 

Static Public Member Functions

static SplineBasedPtr_t create (const value_type &height)
 Create instance and return shared pointer. More...
 
static value_type integral (value_type lower, value_type upper, const PiecewisePoly3 &P1, const PiecewisePoly3 &P2)
 

Static Public Attributes

static EIGEN_MAKE_ALIGNED_OPERATOR_NEW value_type gravity = 9.81
 
static size_type l = 3
 

Protected Member Functions

 SplineBased (const value_type &height)
 Constructor. More...
 
void init (const SplineBasedWkPtr_t &self)
 initialization Store weak pointer to instance More...
 
void computeFootTrajectory () const
 Compute trajectory of the feet. More...
 

Detailed Description

Walk motion generator for humanoid legged robot.

This class computes the reference trajectory of the center of mass of a humanoid robot, given as input a list of time-stamped foot-prints.

The trajectory of the center of mass is obtained by optimization for the linear so called table cart model.

Member Typedef Documentation

typedef std::vector<BoundaryCondition, Eigen::aligned_allocator <BoundaryCondition> > hpp::walkgen::SplineBased::BoundaryConditions_t

Constructor & Destructor Documentation

hpp::walkgen::SplineBased::SplineBased ( const value_type height)
protected

Constructor.

Parameters
heightheight of the center of mass

Referenced by create().

Member Function Documentation

void hpp::walkgen::SplineBased::add ( const BoundaryCondition boundaryCondition)

Add a boundary condition on center of mass trajectory.

Parameters
ttime when position of center of mass is constrained,
positionrequired position of the center of mass.
Note
setting time or step sequence discards boundary conditions.
void hpp::walkgen::SplineBased::computeFootTrajectory ( ) const
protected

Compute trajectory of the feet.

Swap the foot

Check if this step was the last one

References hpp::core::PathVector::create(), hpp::walkgen::Step::create(), and hpp::walkgen::SupportFoot::create().

Referenced by solve().

value_type hpp::walkgen::SplineBased::cost ( const vector_t controlPoints)

Compute the cost of a com trajectory defined by way points.

References cost().

value_type hpp::walkgen::SplineBased::cost ( ) const

Compute the cost of the current com trajectory.

References gravity, and integral().

Referenced by cost(), and solve().

SplineBasedPtr_t hpp::walkgen::SplineBased::create ( const value_type height)
static

Create instance and return shared pointer.

Parameters
heightheight of the center of mass

References init(), and SplineBased().

void hpp::walkgen::SplineBased::defaultStepHeight ( const value_type stepHeight)
inline

Set default step height.

const value_type& hpp::walkgen::SplineBased::defaultStepHeight ( ) const
inline

Get default step height.

void hpp::walkgen::SplineBased::footPrintSequence ( const FootPrints_t footPrints)

set sequence of foot prints

Parameters
footPrintsa vector of foot prints
Note
number of foot prints should be set after time sequence and should fit length of time sequence. If $p$ is the number of foot prints, the length of the time sequence should be equal to $2p-2$. See this document for details.
Sequence of step heights is set to the default value.

References l.

const FootPrints_t& hpp::walkgen::SplineBased::footPrintSequence ( ) const
inline

get sequence of foot prints

void hpp::walkgen::SplineBased::init ( const SplineBasedWkPtr_t &  self)
protected

initialization Store weak pointer to instance

Referenced by create().

value_type hpp::walkgen::SplineBased::integral ( value_type  lower,
value_type  upper,
const PiecewisePoly3 P1,
const PiecewisePoly3 P2 
)
static
DevicePtr_t hpp::walkgen::SplineBased::leftFoot ( ) const
inline
const PathVectorPtr_t& hpp::walkgen::SplineBased::leftFootTrajectory ( ) const
inline

Get trajectory of left foot.

Method solve should have been called first

DevicePtr_t hpp::walkgen::SplineBased::rightFoot ( ) const
inline
const PathVectorPtr_t& hpp::walkgen::SplineBased::rightFootTrajectory ( ) const
inline

Get trajectory of right foot.

Method solve should have been called first

void hpp::walkgen::SplineBased::setEndComState ( const vector2_t position,
const vector2_t velocity 
)

Set final position and velocity of center of mass.

Parameters
positionposition of the center of mass at end $t=\tau_{2p-3}$
velocityvelocity of the center of mass at start $t=\tau_{2p-3}$

References assert(), roboptim::trajectory::Polynomial< N >::derivative(), and gravity.

void hpp::walkgen::SplineBased::setInitialComState ( const vector2_t position,
const vector2_t velocity 
)

Set initial position and velocity of center of mass.

Parameters
positionposition of the center of mass at start $t=\tau_0$
velocityvelocity of the center of mass at start $t=\tau_0$
CubicBSplinePtr_t hpp::walkgen::SplineBased::solve ( ) const

Solve quadratic program and return resulting cubic B spline.

References computeFootTrajectory(), cost(), HPP_DEBUG_SVDCHECK, and hppDout.

void hpp::walkgen::SplineBased::stepHeights ( const StepHeights_t stepHeights)
inline

Set sequence of step heights.

Parameters
stepHeightssequence of step heights
Note
Sequence of foot heights should be set after the sequence of foot prints.
const StepHeights_t& hpp::walkgen::SplineBased::stepHeights ( ) const
inline

Get sequence of step heights.

void hpp::walkgen::SplineBased::timeSequence ( const Times_t times)

set time sequence

Parameters
timessequence of times corresponding to support phases.
const Times_t& hpp::walkgen::SplineBased::timeSequence ( ) const
inline

get time sequence

Returns
sequence of times corresponding to support phases.
const ZmpTrajectories_t& hpp::walkgen::SplineBased::zmpBasisFunctions ( ) const
inline

Get base functions of Zmp.

References init().

void hpp::walkgen::SplineBased::zmpRefBoundaryConditions ( const vector2_t init,
const vector2_t end 
)
inline

Specify zmpref boundary conditions.

Parameters
init,endinitial and end values of zmpref trajectory
Note
If not specified, the middle of the first (respectively last) foot prints.
setting step sequence discards zmp boundary conditions.

References init(), and solve().

const ZmpTrajectory_t& hpp::walkgen::SplineBased::zmpRefx ( ) const
inline

Getter to representation of zmp ref abscissa.

const ZmpTrajectory_t& hpp::walkgen::SplineBased::zmpRefy ( ) const
inline

Getter to representation of zmp ref abscissa.

References hpp::walkgen::PiecewisePoly3::lower, and hpp::walkgen::PiecewisePoly3::upper.

Member Data Documentation

value_type hpp::walkgen::SplineBased::gravity = 9.81
static

Referenced by cost(), and setEndComState().

size_type hpp::walkgen::SplineBased::l = 3
static

Referenced by footPrintSequence(), and integral().