Skip to content
Snippets Groups Projects
Commit 75074c78 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Revert "-Introduce m_NbVariables"

This reverts commit 13819817.
parent 178f71e9
No related branches found
No related tags found
No related merge requests found
......@@ -176,7 +176,7 @@ GeneratorVelRef::generateFeetPosConstraints (CjrlFoot & Foot,
void
GeneratorVelRef::buildInvariantPart(QPProblem & Pb, IntermedQPMat & Matrices)
GeneratorVelRef::buildInvariantProblemPart(QPProblem & Pb, IntermedQPMat & Matrices)
{
const IntermedQPMat::objective_variant_t & Jerk = Matrices(IntermedQPMat::JERK);
......@@ -314,7 +314,7 @@ GeneratorVelRef::addTerm(MAL_MATRIX (&Mat, double), double * QPMat, int row, int
{
for(int i = row;i < row+nrows; i++)
for(int j = col;j < col+ncols; j++)
QPMat[i+j*m_NbVariables] = Mat(i,j);
QPMat[i+j*2*(m_N+m_PrwSupport.StepNumber)] = Mat(i,j);
}
......
......@@ -125,7 +125,7 @@ namespace PatternGeneratorJRL
/// \brief Build the constant part of the objective
///
/// \param Pb
void buildInvariantPart(QPProblem & Pb, IntermedQPMat & Matrices);
void buildInvariantProblemPart(QPProblem & Pb, IntermedQPMat & Matrices);
/// \brief Compute the objective matrices
///
......@@ -254,6 +254,12 @@ namespace PatternGeneratorJRL
/// \name Variables related to the QP
/// @{
/// \brief Sampling of the QP.
double m_QP_T;
/// \brief Number of previewed samples
int m_QP_N;
/// \brief Constant part of the constraint matrices.
double * m_Pu;
......
......@@ -65,9 +65,6 @@ namespace PatternGeneratorJRL
/// \brief Size of the preview window (Nb. of samplings)
int m_N;
/// \brief Number of variables
int m_NbVariables;
/* ! \brief Step height for the walking pattern. */
double m_StepHeight;
......@@ -120,15 +117,15 @@ namespace PatternGeneratorJRL
inline const double & getPreviewLength( ) const
{ return m_PreviewControlTime; };
/// \brief Return the Com Height.
/// \brief Returns the Com Height.
inline const double & getComHeight() const
{ return m_CoMHeight; };
/// \brief Return the Com Height.
/// \brief Returns the Com Height.
inline void setComHeight(const double & aComHeight)
{ m_CoMHeight = aComHeight; };
/// \brief Return the single support time.
/// \brief Returns the single support time.
inline const double & getTSingleSupport() const
{ return m_Tsingle; };
......@@ -136,7 +133,7 @@ namespace PatternGeneratorJRL
inline void setTSingleSupport(const double & aTSingleSupport)
{ m_Tsingle = aTSingleSupport; };
/// \brief Return the double support time.
/// \brief Returns the double support time.
inline const double & getTDoubleSupport() const
{return m_Tdble;};
......@@ -156,26 +153,18 @@ namespace PatternGeneratorJRL
inline const double & getSamplingPeriodPreview() const
{ return m_T_Prw; };
/// \brief Set the sampling period for the preview.
/// \brief Set the sampling period for the preview. */
inline void setSamplingPeriodPreview(const double &aSamplingPeriod)
{ m_T_Prw = aSamplingPeriod;};
/// \brief Get the sampling period for the preview, set to 0.100 by default.
inline const int & getNbPrwSamplings() const
inline const double & getNbPrwSamplings() const
{ return m_N; };
/// \brief Set the sampling period for the preview.
/// \brief Set the sampling period for the preview. */
inline void setNbPrwSamplings(const int &NbSamplings)
{ m_N = NbSamplings;};
/// \brief Set the number of optimization parameters.
inline void setNbVariables(const int &NbVariables)
{ m_NbVariables = NbVariables;};
/// \brief Set the number of optimization parameters.
inline const int & getNbVariables() const
{ return m_NbVariables;};
/// \brief Set the security margin for the zmp
///
/// \param Margin
......
......@@ -110,31 +110,7 @@ void QPProblem_s::AllocateMemory()
X=new double[2*(m_QP_N+m_stepNumber)]; // Solution of the problem.
NewX=new double[2*(m_QP_N+m_stepNumber)]; // Solution of the problem.
}
void
QPProblem_s::resize(double * array, int size)
{
if (array!=0)
delete [] array;
array = new double[size];
}
void
QPProblem_s::resize(int * array, int size)
{
if (array!=0)
delete [] array;
array = new int[size];
}
void
QPProblem_s::setNbVariables(int NbVariables)
{
m_NbVariables = NbVariables;
}
void QPProblem_s::setDimensions(int NbOfConstraints,
......@@ -147,7 +123,6 @@ void QPProblem_s::setDimensions(int NbOfConstraints,
// If all the dimensions are less than
// the current ones no need to reallocate.
// TODO: Should not be necessary to reallocate that often
if ((NbOfConstraints <= m) &&
(StepNumber <= m_stepNumber) &&
(QP_N <= m_QP_N))
......
......@@ -50,9 +50,6 @@ namespace PatternGeneratorJRL
/// \brief Release the memory at the end only.
~QPProblem_s();
/// \brief Set the number of optimization variables
void setNbVariables(int NbVariables);
/// \brief Set the dimensions of the problem.
/// This method has an internal logic to
/// allocate the memory. It is done only
......@@ -63,10 +60,6 @@ namespace PatternGeneratorJRL
int StepNumber,
int QP_N);
/// \brief Reallocate array
void resize(double * array, int size);
void resize(int * array, int size);
/// \brief Dump on disk a problem.
void dumpProblem(const char *filename);
void dumpProblem(std::ostream &);
......@@ -107,9 +100,6 @@ namespace PatternGeneratorJRL
void AllocateMemory();
private:
/// Previous set of step number considered.
int m_NbVariables;
/// Previous set of step number considered.
int m_stepNumber;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment