#include <Mathematics/AnalyticalZMPCOGTrajectory.hh>
Public Member Functions | |
AnalyticalZMPCOGTrajectory (int lNbOfIntervals=0) | |
~AnalyticalZMPCOGTrajectory () | |
bool | ComputeCOM (double t, double &r) |
bool | ComputeCOMSpeed (double t, double &r) |
bool | ComputeCOM (double t, double &r, int i) |
bool | ComputeCOMSpeed (double t, double &r, int i) |
bool | ComputeZMP (double t, double &r) |
bool | ComputeZMPSpeed (double t, double &r) |
bool | ComputeZMP (double t, double &r, int i) |
Setter and Getter@{ | |
int | m_NbOfIntervals |
std::vector< double > | m_V |
std::vector< double > | m_W |
std::vector< double > | m_DeltaTj |
std::vector< double > | m_omegaj |
std::vector< double > | m_RefTime |
std::vector< unsigned int > | m_PolynomialDegree |
std::vector< Polynome * > | m_ListOfCOGPolynomials |
std::vector< Polynome * > | m_ListOfZMPPolynomials |
double | m_AbsoluteTimeReference |
double | m_Sensitivity |
void | SetNumberOfIntervals (unsigned int lNbOfIntervals) |
Set the number of Intervals for this trajectory. More... | |
void | SetCoGHyperbolicCoefficients (std::vector< double > &lV, std::vector< double > &lW) |
Set the coefficients for the sinuse and cosinues function. More... | |
void | SetStartingTimeIntervalsAndHeightVariation (std::vector< double > &lDeltaTj, std::vector< double > &lomegaj) |
Set the starting point and the height variation. More... | |
void | SetPolynomialDegrees (std::vector< unsigned int > &lPolynomialDegree) |
Set the degree of each polynomials for the CoG Remark: the size of the vector of degrees should match the number of intervals. More... | |
void | GetPolynomialDegrees (std::vector< unsigned int > &lPolynomialDegree) const |
Get the degree of each polynomials for the CoG. More... | |
void | GetNumberOfIntervals (unsigned int &lNbOfIntervals) const |
Set the number of Intervals for this trajectory. More... | |
void | GetHyperbolicCoefficients (std::vector< double > &lV, std::vector< double > &lW) const |
Get the coefficients for the sinuse and cosinues function. More... | |
void | GetStartingPointAndHeightVariation (std::vector< double > &lTj, std::vector< double > &lomegaj) |
Get the starting point and the height variation. More... | |
bool | GetFromListOfCOGPolynomials (unsigned int j, Polynome *&aPoly) const |
Get the polynomial at interval j for the CoG Remark: The call to this function assume that the method SetPolynomialDegree has been call beforehand. More... | |
bool | GetFromListOfZMPPolynomials (unsigned int j, Polynome *&aPoly) const |
void | TransfertCoefficientsFromCOGTrajectoryToZMPOne (std::vector< double > &lCOMZ, std::vector< double > &lZMPZ) |
Transfert the coefficients from the COG trajectory to the ZMP for all intervals. More... | |
void | TransfertOneIntervalCoefficientsFromCOGTrajectoryToZMPOne (unsigned int IntervalIndex, double &lCOMZ, double &lZMPZ) |
Transfert the coefficients from the COG trajectory to the ZMP. More... | |
void | Building3rdOrderPolynomial (unsigned int anIntervalj, double pjTjm1, double pjTj) |
double | FluctuationMaximal () |
Returns the maximal fluctuation for the first segment of this trajectory. More... | |
double | GetAbsoluteTimeReference () const |
Absolute Time reference of this trajectory. More... | |
void | SetAbsoluteTimeReference (double anAbsoluteTimeReference) |
Set Absolute time reference of this trajectory. More... | |
bool | GetIntervalIndexFromTime (double t, unsigned int &j) |
Get the index of the interval according to the time. More... | |
bool | GetIntervalIndexFromTime (double t, unsigned int &j, unsigned int &prev_j) |
Get the index of the interval according to the time, and the previous value of the interval. More... | |
std::ostream & | operator<< (std::ostream &os, const AnalyticalZMPCOGTrajectory &obj) |
void | FreePolynomes () |
AnalyticalZMPCOGTrajectory represents the ZMP and the COG trajectories based on the following formula:
PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::AnalyticalZMPCOGTrajectory | ( | int | lNbOfIntervals = 0 | ) |
Constructor
References m_AbsoluteTimeReference, m_Sensitivity, and SetNumberOfIntervals().
PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::~AnalyticalZMPCOGTrajectory | ( | ) |
Destructor
References FreePolynomes().
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::Building3rdOrderPolynomial | ( | unsigned int | anIntervalj, |
double | pjTjm1, | ||
double | pjTj | ||
) |
Build the coefficients of a third order COG polynomial according to the OmegaC and the value of the ZMP at the beginning and the end of the interval, and assuming that the speed is set to zero.
References m_DeltaTj, m_ListOfCOGPolynomials, m_ListOfZMPPolynomials, and m_omegaj.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeCOM | ( | double | t, |
double & | r | ||
) |
Compute the current value according to time.
t | the time, |
r | the result, |
References j, m_AbsoluteTimeReference, m_DeltaTj, m_ListOfCOGPolynomials, m_omegaj, m_PolynomialDegree, m_Sensitivity, m_V, and m_W.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeCOM | ( | double | t, |
double & | r, | ||
int | i | ||
) |
Compute the current value according to time and the index of the interval. To be efficient this method does not have any boundary check.
t | the time, |
i | the numero of the interval |
r | the result, |
References j, m_AbsoluteTimeReference, m_ListOfCOGPolynomials, m_omegaj, m_RefTime, m_V, and m_W.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeCOMSpeed | ( | double | t, |
double & | r | ||
) |
Compute the current CoM speed value according to time.
t | the time, |
r | the result, |
References j, m_AbsoluteTimeReference, m_DeltaTj, m_ListOfCOGPolynomials, m_omegaj, m_PolynomialDegree, m_Sensitivity, m_V, and m_W.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeCOMSpeed | ( | double | t, |
double & | r, | ||
int | i | ||
) |
Compute the current speed according to time and the index of the interval. To be efficient this method does not have any boundary check.
t | the time, |
i | the numero of the interval |
r | the result, |
References j, m_AbsoluteTimeReference, m_ListOfCOGPolynomials, m_omegaj, m_RefTime, m_V, and m_W.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeZMP | ( | double | t, |
double & | r | ||
) |
Compute the current value according to time.
t | the time, |
r | the result, |
References j, m_AbsoluteTimeReference, m_DeltaTj, m_ListOfZMPPolynomials, m_omegaj, m_PolynomialDegree, m_Sensitivity, m_V, and m_W.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeZMP | ( | double | t, |
double & | r, | ||
int | i | ||
) |
Compute the current value according to time.
t | the time, |
i | the numero of the interval |
r | the result, |
References j, m_AbsoluteTimeReference, m_ListOfZMPPolynomials, and m_RefTime.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::ComputeZMPSpeed | ( | double | t, |
double & | r | ||
) |
Compute the current ZMP speed value according to time.
t | the time, |
r | the result, |
References j, m_AbsoluteTimeReference, m_DeltaTj, m_ListOfCOGPolynomials, m_omegaj, m_PolynomialDegree, m_Sensitivity, m_V, and m_W.
double PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::FluctuationMaximal | ( | ) |
Returns the maximal fluctuation for the first segment of this trajectory.
References m_AbsoluteTimeReference, m_DeltaTj, and m_ListOfZMPPolynomials.
|
protected |
Intern method to free the polynomials
References i, m_ListOfCOGPolynomials, and m_ListOfZMPPolynomials.
Referenced by SetNumberOfIntervals(), and ~AnalyticalZMPCOGTrajectory().
|
inline |
Absolute Time reference of this trajectory.
References m_AbsoluteTimeReference.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetFromListOfCOGPolynomials | ( | unsigned int | j, |
Polynome *& | aPoly | ||
) | const |
Get the polynomial at interval j for the CoG Remark: The call to this function assume that the method SetPolynomialDegree has been call beforehand.
References j, m_ListOfCOGPolynomials, and m_NbOfIntervals.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetFromListOfZMPPolynomials | ( | unsigned int | j, |
Polynome *& | aPoly | ||
) | const |
Get the polynomial at interval j for the ZMP Remark: The call to this function assume that the method SetPolynomialDegree has been call beforehand.
References j, m_ListOfZMPPolynomials, and m_NbOfIntervals.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetHyperbolicCoefficients | ( | std::vector< double > & | lV, |
std::vector< double > & | lW | ||
) | const |
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetIntervalIndexFromTime | ( | double | t, |
unsigned int & | j | ||
) |
Get the index of the interval according to the time.
References j, m_AbsoluteTimeReference, m_DeltaTj, and m_Sensitivity.
bool PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetIntervalIndexFromTime | ( | double | t, |
unsigned int & | j, | ||
unsigned int & | prev_j | ||
) |
Get the index of the interval according to the time, and the previous value of the interval.
References j, m_AbsoluteTimeReference, m_DeltaTj, and m_Sensitivity.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetNumberOfIntervals | ( | unsigned int & | lNbOfIntervals | ) | const |
Set the number of Intervals for this trajectory.
References m_NbOfIntervals.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetPolynomialDegrees | ( | std::vector< unsigned int > & | lPolynomialDegree | ) | const |
Get the degree of each polynomials for the CoG.
References m_PolynomialDegree.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::GetStartingPointAndHeightVariation | ( | std::vector< double > & | lTj, |
std::vector< double > & | lomegaj | ||
) |
|
inline |
Set Absolute time reference of this trajectory.
References m_AbsoluteTimeReference.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::SetCoGHyperbolicCoefficients | ( | std::vector< double > & | lV, |
std::vector< double > & | lW | ||
) |
Set the coefficients for the sinuse and cosinues function.
References m_NbOfIntervals, m_V, and m_W.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::SetNumberOfIntervals | ( | unsigned int | lNbOfIntervals | ) |
Set the number of Intervals for this trajectory.
References FreePolynomes(), i, m_DeltaTj, m_ListOfCOGPolynomials, m_ListOfZMPPolynomials, m_NbOfIntervals, m_omegaj, m_PolynomialDegree, m_V, and m_W.
Referenced by AnalyticalZMPCOGTrajectory().
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::SetPolynomialDegrees | ( | std::vector< unsigned int > & | lPolynomialDegree | ) |
Set the degree of each polynomials for the CoG Remark: the size of the vector of degrees should match the number of intervals.
References i, m_ListOfCOGPolynomials, m_ListOfZMPPolynomials, m_NbOfIntervals, and m_PolynomialDegree.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::SetStartingTimeIntervalsAndHeightVariation | ( | std::vector< double > & | lDeltaTj, |
std::vector< double > & | lomegaj | ||
) |
Set the starting point and the height variation.
References j, m_DeltaTj, m_NbOfIntervals, m_omegaj, and m_RefTime.
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::TransfertCoefficientsFromCOGTrajectoryToZMPOne | ( | std::vector< double > & | lCOMZ, |
std::vector< double > & | lZMPZ | ||
) |
Transfert the coefficients from the COG trajectory to the ZMP for all intervals.
lCOMZ | Profile of the height CoM for each interval. |
lZMPZ | Profile of the height ZMP for each interval. |
References j, m_NbOfIntervals, and TransfertOneIntervalCoefficientsFromCOGTrajectoryToZMPOne().
void PatternGeneratorJRL::AnalyticalZMPCOGTrajectory::TransfertOneIntervalCoefficientsFromCOGTrajectoryToZMPOne | ( | unsigned int | IntervalIndex, |
double & | lCOMZ, | ||
double & | lZMPZ | ||
) |
Transfert the coefficients from the COG trajectory to the ZMP.
IntervalIndex | Number of the interval. |
lCOMZ | Value of the CoM height for this interval. |
lZMPZ | Value of the ZMP height for this interval. |
References i, m_ListOfCOGPolynomials, m_ListOfZMPPolynomials, and m_PolynomialDegree.
Referenced by TransfertCoefficientsFromCOGTrajectoryToZMPOne().
|
friend |
|
protected |
Store the absolute time reference
Referenced by AnalyticalZMPCOGTrajectory(), ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), FluctuationMaximal(), GetAbsoluteTimeReference(), GetIntervalIndexFromTime(), and SetAbsoluteTimeReference().
|
protected |
List of temporal starting point.
Referenced by Building3rdOrderPolynomial(), ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), FluctuationMaximal(), GetIntervalIndexFromTime(), GetStartingPointAndHeightVariation(), SetNumberOfIntervals(), and SetStartingTimeIntervalsAndHeightVariation().
|
protected |
List of polynomials for the COG
Referenced by Building3rdOrderPolynomial(), ComputeCOM(), ComputeCOMSpeed(), ComputeZMPSpeed(), FreePolynomes(), GetFromListOfCOGPolynomials(), SetNumberOfIntervals(), SetPolynomialDegrees(), and TransfertOneIntervalCoefficientsFromCOGTrajectoryToZMPOne().
|
protected |
List of polynomials for the ZMP
Referenced by Building3rdOrderPolynomial(), ComputeZMP(), FluctuationMaximal(), FreePolynomes(), GetFromListOfZMPPolynomials(), SetNumberOfIntervals(), SetPolynomialDegrees(), and TransfertOneIntervalCoefficientsFromCOGTrajectoryToZMPOne().
|
protected |
|
protected |
List of omega, i.e. height variation along the trajectory.
Referenced by Building3rdOrderPolynomial(), ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), GetStartingPointAndHeightVariation(), SetNumberOfIntervals(), and SetStartingTimeIntervalsAndHeightVariation().
|
protected |
List of polynomial degrees for the CoM
Referenced by ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), GetPolynomialDegrees(), SetNumberOfIntervals(), SetPolynomialDegrees(), and TransfertOneIntervalCoefficientsFromCOGTrajectoryToZMPOne().
|
protected |
List of reference time for the interval.
Referenced by ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), and SetStartingTimeIntervalsAndHeightVariation().
|
protected |
Referenced by AnalyticalZMPCOGTrajectory(), ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), and GetIntervalIndexFromTime().
|
protected |
List of coefficients for the hyperbolics cosine function
Referenced by ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), GetHyperbolicCoefficients(), SetCoGHyperbolicCoefficients(), and SetNumberOfIntervals().
|
protected |
List of coefficients for the hyperbolics sine function
Referenced by ComputeCOM(), ComputeCOMSpeed(), ComputeZMP(), ComputeZMPSpeed(), GetHyperbolicCoefficients(), SetCoGHyperbolicCoefficients(), and SetNumberOfIntervals().