Cheetah Software  1.0
FootSwingTrajectory< T > Class Template Reference

#include <FootSwingTrajectory.h>

+ Collaboration diagram for FootSwingTrajectory< T >:

Public Member Functions

 FootSwingTrajectory ()
 
void setInitialPosition (Vec3< T > p0)
 
void setFinalPosition (Vec3< T > pf)
 
void setHeight (T h)
 
void computeSwingTrajectoryBezier (T phase, T swingTime)
 
Vec3< T > getPosition ()
 
Vec3< T > getVelocity ()
 
Vec3< T > getAcceleration ()
 

Private Attributes

Vec3< T > _p0
 
Vec3< T > _pf
 
Vec3< T > _p
 
Vec3< T > _v
 
Vec3< T > _a
 
_height
 

Detailed Description

template<typename T>
class FootSwingTrajectory< T >

Definition at line 12 of file FootSwingTrajectory.h.

Constructor & Destructor Documentation

Member Function Documentation

template<typename T >
void FootSwingTrajectory< T >::computeSwingTrajectoryBezier ( phase,
swingTime 
)

Compute foot swing trajectory with a bezier curve

Template Parameters
T
Parameters
phase
swingTime

Definition at line 11 of file FootSwingTrajectory.cpp.

11  {
12  _p = Interpolate::cubicBezier<Vec3<T>>(_p0, _pf, phase);
13  _v = Interpolate::cubicBezierFirstDerivative<Vec3<T>>(_p0, _pf, phase) / swingTime;
14  _a = Interpolate::cubicBezierSecondDerivative<Vec3<T>>(_p0, _pf, phase) / (swingTime * swingTime);
15 
16  T zp, zv, za;
17 
18  if(phase < T(0.5)) {
19  zp = Interpolate::cubicBezier<T>(_p0[2], _p0[2] + _height, phase * 2);
20  zv = Interpolate::cubicBezierFirstDerivative<T>(_p0[2], _p0[2] + _height, phase * 2) * 2 / swingTime;
21  za = Interpolate::cubicBezierSecondDerivative<T>(_p0[2], _p0[2] + _height, phase * 2) * 4 / (swingTime * swingTime);
22  } else {
23  zp = Interpolate::cubicBezier<T>(_p0[2] + _height, _pf[2], phase * 2 - 1);
24  zv = Interpolate::cubicBezierFirstDerivative<T>(_p0[2] + _height, _pf[2], phase * 2 - 1) * 2 / swingTime;
25  za = Interpolate::cubicBezierSecondDerivative<T>(_p0[2] + _height, _pf[2], phase * 2 - 1) * 4 / (swingTime * swingTime);
26  }
27 
28  _p[2] = zp;
29  _v[2] = zv;
30  _a[2] = za;
31 }

+ Here is the caller graph for this function:

template<typename T>
Vec3<T> FootSwingTrajectory< T >::getAcceleration ( )
inline

Definition at line 45 of file FootSwingTrajectory.h.

References FootSwingTrajectory< T >::_a.

45  {
46  return _a;
47  }

+ Here is the caller graph for this function:

template<typename T>
Vec3<T> FootSwingTrajectory< T >::getPosition ( )
inline

Definition at line 37 of file FootSwingTrajectory.h.

References FootSwingTrajectory< T >::_p.

37  {
38  return _p;
39  }

+ Here is the caller graph for this function:

template<typename T>
Vec3<T> FootSwingTrajectory< T >::getVelocity ( )
inline

Definition at line 41 of file FootSwingTrajectory.h.

References FootSwingTrajectory< T >::_v.

41  {
42  return _v;
43  }

+ Here is the caller graph for this function:

template<typename T>
void FootSwingTrajectory< T >::setFinalPosition ( Vec3< T >  pf)
inline

Definition at line 27 of file FootSwingTrajectory.h.

References FootSwingTrajectory< T >::_pf.

27  {
28  _pf = pf;
29  }

+ Here is the caller graph for this function:

template<typename T>
void FootSwingTrajectory< T >::setHeight ( h)
inline

Definition at line 31 of file FootSwingTrajectory.h.

References FootSwingTrajectory< T >::_height, and FootSwingTrajectory< T >::computeSwingTrajectoryBezier().

31  {
32  _height = h;
33  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
void FootSwingTrajectory< T >::setInitialPosition ( Vec3< T >  p0)
inline

Definition at line 23 of file FootSwingTrajectory.h.

References FootSwingTrajectory< T >::_p0.

23  {
24  _p0 = p0;
25  }

+ Here is the caller graph for this function:

Member Data Documentation

template<typename T>
Vec3<T> FootSwingTrajectory< T >::_a
private

Definition at line 50 of file FootSwingTrajectory.h.

template<typename T>
T FootSwingTrajectory< T >::_height
private

Definition at line 51 of file FootSwingTrajectory.h.

template<typename T>
Vec3<T> FootSwingTrajectory< T >::_p
private

Definition at line 50 of file FootSwingTrajectory.h.

template<typename T>
Vec3<T> FootSwingTrajectory< T >::_p0
private

Definition at line 50 of file FootSwingTrajectory.h.

template<typename T>
Vec3<T> FootSwingTrajectory< T >::_pf
private

Definition at line 50 of file FootSwingTrajectory.h.

template<typename T>
Vec3<T> FootSwingTrajectory< T >::_v
private

Definition at line 50 of file FootSwingTrajectory.h.


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