Bsplines used for Z trajectory of stair steps. More...
#include <Mathematics/Bsplines.hh>
Public Member Functions | |
BSplinesFoot (double FT=1.0, double IP=0.0, double FP=0.0, std::vector< double >ToMP=std::vector< double >(), std::vector< double > MP=std::vector< double >(), double IS=0.0, double IA=0.0, double FS=0.0, double FA=0.0) | |
Constructor: FT: Final time FP: Final position ToMP : Time of Max Position MP : Max Position. More... | |
~BSplinesFoot () | |
Detructor. More... | |
void | SetParameters (double FT, double IP, double FP, std::vector< double >ToMP, std::vector< double > MP, double IS=0.0, double IA=0.0, double FS=0.0, double FA=0.0) |
void | SetParametersWithoutMPAndToMP (double FT, double IP, double FP, double IS, double IA, double FS, double FA) |
int | Compute (double t, double &x, double &dx, double &ddx) |
void | ComputeControlPointFrom2DataPoint () |
void | ComputeControlPointFrom3DataPoint () |
void | ComputeControlPointFrom4DataPoint () |
void | GetParameters (double &FT, double &IP, double &FP, std::vector< double > &ToMP, std::vector< double > &MP) |
std::vector< double > | MP () |
std::vector< double > | ToMP () |
double | FT () |
void | FT (double ft) |
double | IP () |
double | FP () |
void | SetParametersWithInitFinalPose (double FT, double IP, double FP, std::vector< double > &ToMP, std::vector< double > &MP) |
![]() | |
Bsplines (long int degree) | |
~Bsplines () | |
void | GenerateDegree () |
Bsplines | DerivativeBsplines () |
int | ComputeBasisFunctions (double t) |
int | ComputeBasisFunctionsRecursively (double t, std::deque< double > &knot, unsigned int degree) |
double | Nij_t (int i, int j, double t, std::deque< double > &knot) |
double | ComputeBsplines (double t) |
void | SetDegree (long int degree) |
void | SetControlPoints (std::vector< double > &control_points) |
void | SetKnotVector (std::deque< double > &knot_vector) |
long int | GetDegree () const |
std::vector< double > | GetControlPoints () const |
std::deque< double > | GetKnotVector () const |
void | PrintKnotVector () const |
void | PrintControlPoints () const |
void | PrintDegree () const |
Additional Inherited Members | |
![]() | |
long int | m_degree |
std::vector< double > | m_control_points |
std::vector< double > | m_derivative_control_points |
std::vector< double > | m_sec_derivative_control_points |
std::vector< std::vector< double > > | m_basis_functions |
std::vector< double > | m_basis_functions_derivative |
std::vector< double > | m_basis_functions_sec_derivative |
std::deque< double > | m_knot |
Bsplines used for Z trajectory of stair steps.
BSplinesFoot::BSplinesFoot | ( | double | FT = 1.0 , |
double | IP = 0.0 , |
||
double | FP = 0.0 , |
||
std::vector< double > | ToMP = std::vector<double>() , |
||
std::vector< double > | MP = std::vector<double>() , |
||
double | IS = 0.0 , |
||
double | IA = 0.0 , |
||
double | FS = 0.0 , |
||
double | FA = 0.0 |
||
) |
Constructor: FT: Final time FP: Final position ToMP : Time of Max Position MP : Max Position.
References SetParameters().
BSplinesFoot::~BSplinesFoot | ( | ) |
Detructor.
int BSplinesFoot::Compute | ( | double | t, |
double & | x, | ||
double & | dx, | ||
double & | ddx | ||
) |
Compute Position at time t
References PatternGeneratorJRL::Bsplines::ComputeBasisFunctions(), i, PatternGeneratorJRL::Bsplines::m_basis_functions, PatternGeneratorJRL::Bsplines::m_basis_functions_derivative, PatternGeneratorJRL::Bsplines::m_basis_functions_sec_derivative, PatternGeneratorJRL::Bsplines::m_control_points, and PatternGeneratorJRL::Bsplines::m_degree.
void BSplinesFoot::ComputeControlPointFrom2DataPoint | ( | void | ) |
Compute the control point position for an order 5 Bsplines. It also computes the control point of the derivative and the second derivatice of the BSplines.
References PatternGeneratorJRL::Bsplines::ComputeBasisFunctions(), FP(), IP(), PatternGeneratorJRL::Bsplines::m_basis_functions_derivative, PatternGeneratorJRL::Bsplines::m_basis_functions_sec_derivative, PatternGeneratorJRL::Bsplines::m_control_points, and return.
Referenced by SetParameters().
void BSplinesFoot::ComputeControlPointFrom3DataPoint | ( | void | ) |
References PatternGeneratorJRL::Bsplines::ComputeBasisFunctions(), FP(), IP(), PatternGeneratorJRL::Bsplines::m_basis_functions, PatternGeneratorJRL::Bsplines::m_basis_functions_derivative, PatternGeneratorJRL::Bsplines::m_basis_functions_sec_derivative, PatternGeneratorJRL::Bsplines::m_control_points, PatternGeneratorJRL::Bsplines::m_degree, and return.
Referenced by SetParameters().
void BSplinesFoot::ComputeControlPointFrom4DataPoint | ( | void | ) |
References PatternGeneratorJRL::Bsplines::ComputeBasisFunctions(), FP(), IP(), PatternGeneratorJRL::Bsplines::m_basis_functions, PatternGeneratorJRL::Bsplines::m_basis_functions_derivative, PatternGeneratorJRL::Bsplines::m_basis_functions_sec_derivative, PatternGeneratorJRL::Bsplines::m_control_points, PatternGeneratorJRL::Bsplines::m_degree, and return.
Referenced by SetParameters().
|
inline |
|
inline |
Referenced by SetParameters(), SetParametersWithInitFinalPose(), and SetParametersWithoutMPAndToMP().
|
inline |
void BSplinesFoot::GetParameters | ( | double & | FT, |
double & | IP, | ||
double & | FP, | ||
std::vector< double > & | ToMP, | ||
std::vector< double > & | MP | ||
) |
|
inline |
|
inline |
Referenced by SetParameters(), and SetParametersWithInitFinalPose().
void BSplinesFoot::SetParameters | ( | double | FT, |
double | IP, | ||
double | FP, | ||
std::vector< double > | ToMP, | ||
std::vector< double > | MP, | ||
double | IS = 0.0 , |
||
double | IA = 0.0 , |
||
double | FS = 0.0 , |
||
double | FA = 0.0 |
||
) |
Set the parameters This method assumes implicitly a initial position initial speed and initial acceleration equal to zero. The same for final speed and final acceleration. Speed at Max Position is around zero. It generates knot vector and control point vector according to the input
References ComputeControlPointFrom2DataPoint(), ComputeControlPointFrom3DataPoint(), ComputeControlPointFrom4DataPoint(), FP(), FT(), i, IP(), PatternGeneratorJRL::Bsplines::m_control_points, PatternGeneratorJRL::Bsplines::m_degree, MP(), return, PatternGeneratorJRL::Bsplines::SetKnotVector(), and ToMP().
Referenced by BSplinesFoot().
void BSplinesFoot::SetParametersWithInitFinalPose | ( | double | FT, |
double | IP, | ||
double | FP, | ||
std::vector< double > & | ToMP, | ||
std::vector< double > & | MP | ||
) |
void BSplinesFoot::SetParametersWithoutMPAndToMP | ( | double | FT, |
double | IP, | ||
double | FP, | ||
double | IS, | ||
double | IA, | ||
double | FS, | ||
double | FA | ||
) |
|
inline |
Referenced by SetParameters(), and SetParametersWithInitFinalPose().