Class to implement the preview control. More...
#include <PreviewControl/PreviewControl.hh>
Public Member Functions | |
PreviewControl (SimplePluginManager *lSPM, unsigned int defaultMode=OptimalControllerSolver::MODE_WITH_INITIALPOS, bool computeWeightsAutomatically=false) | |
~PreviewControl () | |
void | ReadPrecomputedFile (string aFileName) |
Read the file of parameters aFileName and set the sampling period, the preview control time, Ks, Kx, and F. | |
int | OneIterationOfPreview (MAL_MATRIX(&x, double), MAL_MATRIX(&y, double), double &sxzmp, double &syzmp, deque< PatternGeneratorJRL::ZMPPosition > &ZMPPositions, unsigned int lindex, double &zmpx2, double &zmpy2, bool Simulation) |
One iteration of the preview control. | |
int | OneIterationOfPreview1D (MAL_MATRIX(&x, double), double &sxzmp, deque< double > &ZMPPositions, unsigned int lindex, double &zmpx2, bool Simulation) |
One iteration of the preview control along one axis (using queues) | |
int | OneIterationOfPreview1D (MAL_MATRIX(&x, double), double &sxzmp, vector< double > &ZMPPositions, unsigned int lindex, double &zmpx2, bool Simulation) |
One iteration of the preview control along one axis (using vectors) | |
void | ComputeOptimalWeights (unsigned int mode) |
Compute optimal weights. | |
void | print () |
Overloading of << operator. | |
virtual void | CallMethod (std::string &Method, std::istringstream &astrm) |
Overloading method of SimplePlugin. | |
Methods to access the basic variables of the preview control. | |
double | SamplingPeriod () const |
Getter for the sampling period. | |
double | PreviewControlTime () const |
double | GetHeightOfCoM () const |
void | SetSamplingPeriod (double lSamplingPeriod) |
Setter for the sampling period. | |
void | SetPreviewControlTime (double lPreviewControlTime) |
void | SetHeightOfCoM (double lZc) |
bool | IsCoherent () |
Indicates if the weights are coherent with the parameters. |
Class to implement the preview control.
PreviewControl::PreviewControl | ( | SimplePluginManager * | lSPM, |
unsigned int | defaultMode = OptimalControllerSolver::MODE_WITH_INITIALPOS , |
||
bool | computeWeightsAutomatically = false |
||
) |
Constructor
References MAL_MATRIX_RESIZE.
Destructor
void PreviewControl::CallMethod | ( | std::string & | Method, |
std::istringstream & | astrm | ||
) | [virtual] |
Overloading method of SimplePlugin.
References ComputeOptimalWeights(), PatternGeneratorJRL::OptimalControllerSolver::MODE_WITH_INITIALPOS, PatternGeneratorJRL::OptimalControllerSolver::MODE_WITHOUT_INITIALPOS, SetHeightOfCoM(), SetPreviewControlTime(), and SetSamplingPeriod().
void PreviewControl::ComputeOptimalWeights | ( | unsigned int | mode | ) |
Compute optimal weights.
[in] | mode,: | with initial pos (OptimalControllerSolver::MODE_WITH_INITIALPOS), without initial position (OptimalControllerSolver::MODE_WITHOUT_INITIALPOS). |
Solver to compute optimal weights
References PatternGeneratorJRL::OptimalControllerSolver::ComputeWeights(), PatternGeneratorJRL::OptimalControllerSolver::GetF(), PatternGeneratorJRL::OptimalControllerSolver::GetK(), MAL_MATRIX_DIM, MAL_MATRIX_FILL, MAL_MATRIX_RESIZE, MAL_MATRIX_TYPE, MAL_RET_A_by_B, PatternGeneratorJRL::OptimalControllerSolver::MODE_WITH_INITIALPOS, and PatternGeneratorJRL::OptimalControllerSolver::MODE_WITHOUT_INITIALPOS.
Referenced by CallMethod(), SetHeightOfCoM(), SetPreviewControlTime(), SetSamplingPeriod(), and PatternGeneratorJRL::ZMPPreviewControlWithMultiBodyZMP::Setup().
double PreviewControl::GetHeightOfCoM | ( | ) | const |
Getter for the height position of the CoM.
bool PreviewControl::IsCoherent | ( | ) |
Indicates if the weights are coherent with the parameters.
int PreviewControl::OneIterationOfPreview | ( | MAL_MATRIX &, | double, |
MAL_MATRIX &, | double, | ||
double & | sxzmp, | ||
double & | syzmp, | ||
deque< PatternGeneratorJRL::ZMPPosition > & | ZMPPositions, | ||
unsigned int | lindex, | ||
double & | zmpx2, | ||
double & | zmpy2, | ||
bool | Simulation | ||
) |
One iteration of the preview control.
References MAL_MATRIX, MAL_MATRIX_DIM, MAL_RET_A_by_B, and x.
Referenced by PatternGeneratorJRL::ZMPPreviewControlWithMultiBodyZMP::CreateExtraCOMBuffer(), PatternGeneratorJRL::ZMPPreviewControlWithMultiBodyZMP::FirstStageOfControl(), and PatternGeneratorJRL::ZMPPreviewControlWithMultiBodyZMP::SecondStageOfControl().
int PatternGeneratorJRL::PreviewControl::OneIterationOfPreview1D | ( | MAL_MATRIX &, | double, |
double & | sxzmp, | ||
deque< double > & | ZMPPositions, | ||
unsigned int | lindex, | ||
double & | zmpx2, | ||
bool | Simulation | ||
) |
One iteration of the preview control along one axis (using queues)
int PatternGeneratorJRL::PreviewControl::OneIterationOfPreview1D | ( | MAL_MATRIX &, | double, |
double & | sxzmp, | ||
vector< double > & | ZMPPositions, | ||
unsigned int | lindex, | ||
double & | zmpx2, | ||
bool | Simulation | ||
) |
One iteration of the preview control along one axis (using vectors)
[in] | out] | x: Current state of the CoM along the axis. |
[in] | out] | sxzmp: Summed error. |
[in] | ZMPPositions,: | Vector of ZMP reference positions. |
[in] | lindex,: | Starting index in the array of ZMP reference positions. |
[out] | zmpx2,: | Resulting ZMP value. |
[in] | Simulation,: | This should be set to false. |
double PreviewControl::PreviewControlTime | ( | ) | const |
Getter for the preview control time.
Referenced by PatternGeneratorJRL::ZMPPreviewControlWithMultiBodyZMP::SetPreviewControl().
void PreviewControl::print | ( | ) |
Overloading of << operator.
void PreviewControl::ReadPrecomputedFile | ( | string | aFileName | ) |
Read the file of parameters aFileName and set the sampling period, the preview control time, Ks, Kx, and F.
References MAL_MATRIX_RESIZE.
double PreviewControl::SamplingPeriod | ( | ) | const |
Getter for the sampling period.
Referenced by PatternGeneratorJRL::ZMPPreviewControlWithMultiBodyZMP::SetPreviewControl().
void PreviewControl::SetHeightOfCoM | ( | double | lZc | ) |
Getter for the height position of the CoM.
References ComputeOptimalWeights().
Referenced by CallMethod().
void PreviewControl::SetPreviewControlTime | ( | double | lPreviewControlTime | ) |
Setter for the preview control time.
References ComputeOptimalWeights().
Referenced by CallMethod().
void PreviewControl::SetSamplingPeriod | ( | double | lSamplingPeriod | ) |