Commit 0529516e authored by Francois Keith's avatar Francois Keith
Browse files

Adding const operator wherever it's possible

parent ef3541ab
......@@ -184,11 +184,11 @@ namespace PatternGeneratorJRL
virtual void SetCurrentJointValues(MAL_VECTOR( &lCurrentJointValues,double))=0;
/*! \brief Returns the walking mode. */
virtual int GetWalkMode()=0;
virtual int GetWalkMode() const=0;
/*! \brief Get the leg joint velocity */
virtual void GetLegJointVelocity(MAL_VECTOR( &dqr,double),
MAL_VECTOR( &dql,double))=0;
MAL_VECTOR( &dql,double)) const=0;
/*! \brief Read a sequence of steps. */
virtual void ReadSequenceOfSteps(std::istringstream &strm)=0;
......@@ -240,7 +240,7 @@ namespace PatternGeneratorJRL
/*! \brief Get the waist position and orientation as a quaternion,
and the planar X-Y orientation in Orientation. */
virtual void getWaistPositionAndOrientation(double TQ[7],double &Orientation)=0;
virtual void getWaistPositionAndOrientation(double TQ[7],double &Orientation) const=0;
/*! \brief Set Waist position and Orientation */
virtual void setWaistPositionAndOrientation(double TQ[7])=0;
......@@ -248,10 +248,10 @@ namespace PatternGeneratorJRL
/*! \brief Get Waist velocity */
virtual void getWaistVelocity(double &dx,
double &dy,
double &omega)=0;
double &omega) const=0;
/*! \brief An other method to get the waist position using a matrix. */
virtual void getWaistPositionMatrix(MAL_S4x4_MATRIX( &lWaistAbsPos,double))=0;
virtual void getWaistPositionMatrix(MAL_S4x4_MATRIX( &lWaistAbsPos,double)) const=0;
/*!@} */
......@@ -260,7 +260,7 @@ namespace PatternGeneratorJRL
virtual void setZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint)=0;
/*! \brief Get the initial ZMP reference point. */
virtual void getZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint)=0;
virtual void getZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint) const=0;
/*! \name System to call a given method based on registration of a method.
@{
......
......@@ -134,7 +134,7 @@ namespace PatternGeneratorJRL
{ m_TSingle =aTSingle;};
/*! \brief Get single support time */
double GetSingleSupportTime()
double GetSingleSupportTime() const
{ return m_TSingle;};
/*! @} */
......@@ -147,7 +147,7 @@ namespace PatternGeneratorJRL
{ m_TDouble =aTDouble;};
/*! \brief Get single support time */
double GetDoubleSupportTime()
double GetDoubleSupportTime() const
{ return m_TDouble;};
/*! @}*/
......@@ -161,7 +161,7 @@ namespace PatternGeneratorJRL
{ m_SamplingPeriod = aSamplingPeriod;};
/*! \brief Get single support time */
double GetSamplingPeriod()
double GetSamplingPeriod() const
{ return m_SamplingPeriod;};
/*!@}*/
......@@ -170,7 +170,7 @@ namespace PatternGeneratorJRL
@{*/
/*! Get Omega */
double GetOmega()
double GetOmega() const
{ return m_Omega; };
/*! Set Omega */
......
......@@ -67,13 +67,13 @@ void FootTrajectoryGenerationMultiple::SetNumberOfIntervals(int lNumberOfInterva
m_NatureOfIntervals.resize(lNumberOfIntervals);
}
int FootTrajectoryGenerationMultiple::GetNumberOfIntervals()
int FootTrajectoryGenerationMultiple::GetNumberOfIntervals() const
{
return m_SetOfFootTrajectoryGenerationObjects.size();
}
void FootTrajectoryGenerationMultiple::SetTimeIntervals(vector<double> &lDeltaTj)
void FootTrajectoryGenerationMultiple::SetTimeIntervals(const vector<double> &lDeltaTj)
{
m_DeltaTj = lDeltaTj;
m_RefTime.resize(lDeltaTj.size());
......@@ -88,7 +88,7 @@ void FootTrajectoryGenerationMultiple::SetTimeIntervals(vector<double> &lDeltaTj
}
void FootTrajectoryGenerationMultiple::GetTimeIntervals(vector<double> &lDeltaTj)
void FootTrajectoryGenerationMultiple::GetTimeIntervals(vector<double> &lDeltaTj) const
{
lDeltaTj = m_DeltaTj;
}
......@@ -190,7 +190,7 @@ int FootTrajectoryGenerationMultiple::SetNatureInterval(unsigned int IntervalInd
/*! This method returns the nature of the interval.
*/
int FootTrajectoryGenerationMultiple::GetNatureInterval(unsigned int IntervalIndex)
int FootTrajectoryGenerationMultiple::GetNatureInterval(unsigned int IntervalIndex) const
{
if (IntervalIndex>=m_NatureOfIntervals.size())
return -100;
......@@ -228,7 +228,7 @@ int FootTrajectoryGenerationMultiple::SetParametersWithInitPosInitSpeed(unsigned
}
double FootTrajectoryGenerationMultiple::GetAbsoluteTimeReference()
double FootTrajectoryGenerationMultiple::GetAbsoluteTimeReference() const
{
return m_AbsoluteTimeReference;
}
......@@ -243,7 +243,7 @@ void FootTrajectoryGenerationMultiple::CallMethod(std::string &, //Method,
{
}
int FootTrajectoryGenerationMultiple::DisplayIntervals()
int FootTrajectoryGenerationMultiple::DisplayIntervals() const
{
for(unsigned int i=0;i<m_DeltaTj.size();i++)
{
......
......@@ -96,22 +96,22 @@ namespace PatternGeneratorJRL
void SetNumberOfIntervals(int lNumberOfIntervals);
/*! \brief Get number of intervals. */
int GetNumberOfIntervals();
int GetNumberOfIntervals() const;
/*! \brief Set the time for each interval. */
void SetTimeIntervals(std::vector<double> & lDeltaTj);
void SetTimeIntervals(const std::vector<double> & lDeltaTj);
/*! \brief Get the time for each interval */
void GetTimeIntervals(std::vector<double> & lDeltaTj);
void GetTimeIntervals(std::vector<double> & lDeltaTj) const;
/*! \brief Set nature of interval */
int SetNatureInterval(unsigned int IntervalIndex, int Nature);
/*! \brief Get nature of interval */
int GetNatureInterval(unsigned int IntervalIndex);
int GetNatureInterval(unsigned int IntervalIndex) const;
/*! \brief Display intervals time. */
int DisplayIntervals();
int DisplayIntervals() const;
/*! @} */
......@@ -157,7 +157,7 @@ namespace PatternGeneratorJRL
@{ */
/*! Returns the time when the trajectory starts. */
double GetAbsoluteTimeReference();
double GetAbsoluteTimeReference() const;
/*! Set the time when the trajectory starts. */
void SetAbsoluteTimeReference(double lAbsoluteTimeReference);
......
......@@ -81,12 +81,12 @@ void Polynome::GetCoefficients(vector<double> &lCoefficients) const
}
void Polynome::SetCoefficients(vector<double> &lCoefficients)
void Polynome::SetCoefficients(const vector<double> &lCoefficients)
{
m_Coefficients = lCoefficients;
}
void Polynome::print()
void Polynome::print() const
{
for(unsigned int i=0;i<m_Coefficients.size();i++)
cout << m_Coefficients[i] << " " ;
......
......@@ -64,14 +64,14 @@ namespace PatternGeneratorJRL
void GetCoefficients(std::vector<double> &lCoefficients) const;
/*! Set the coefficients. */
void SetCoefficients(std::vector<double> &lCoefficients);
void SetCoefficients(const std::vector<double> &lCoefficients);
inline int Degree()
{ return m_Degree; };
/*! Print the coefficient. */
void print();
void print() const;
protected:
......
......@@ -1543,7 +1543,7 @@ namespace PatternGeneratorJRL {
}
int PatternGeneratorInterfacePrivate::GetWalkMode()
int PatternGeneratorInterfacePrivate::GetWalkMode() const
{
return m_StepStackHandler->GetWalkMode();
}
......@@ -1556,7 +1556,7 @@ namespace PatternGeneratorJRL {
}
void PatternGeneratorInterfacePrivate::GetLegJointVelocity(MAL_VECTOR( & dqr,double),
MAL_VECTOR( & dql,double))
MAL_VECTOR( & dql,double)) const
{
// TO DO: take the joint specific to the legs
......@@ -1679,12 +1679,13 @@ namespace PatternGeneratorJRL {
}
void PatternGeneratorInterfacePrivate::getWaistPositionMatrix(MAL_S4x4_MATRIX( &lWaistAbsPos,double))
void PatternGeneratorInterfacePrivate::getWaistPositionMatrix(MAL_S4x4_MATRIX( &lWaistAbsPos,double)) const
{
lWaistAbsPos = m_WaistAbsPos;
}
void PatternGeneratorInterfacePrivate::getWaistPositionAndOrientation(double aTQ[7], double &Orientation)
//TODO test me
void PatternGeneratorInterfacePrivate::getWaistPositionAndOrientation(double aTQ[7], double &Orientation) const
{
// Position
aTQ[0] = MAL_S4x4_MATRIX_ACCESS_I_J(m_WaistAbsPos, 0,3);
......@@ -1741,7 +1742,7 @@ namespace PatternGeneratorJRL {
void PatternGeneratorInterfacePrivate::getWaistVelocity(double & dx,
double & dy,
double & omega)
double & omega) const
{
dx = m_AbsLinearVelocity(0);
dy = m_AbsLinearVelocity(1);
......@@ -1886,7 +1887,7 @@ namespace PatternGeneratorJRL {
m_ZMPInitialPointSet = true;
}
void PatternGeneratorInterfacePrivate::getZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint)
void PatternGeneratorInterfacePrivate::getZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint) const
{
lZMPInitialPoint = m_ZMPInitialPoint;
}
......
......@@ -75,8 +75,8 @@ void
OrientationsPreview::preview_orientations(double Time,
const reference_t & Ref,
double StepDuration, const deque<support_state_t> & PrwSupportStates_deq,
std::deque<FootAbsolutePosition> & LeftFootPositions_deq,
std::deque<FootAbsolutePosition> & RightFootPositions_deq,
const std::deque<FootAbsolutePosition> & LeftFootPositions_deq,
const std::deque<FootAbsolutePosition> & RightFootPositions_deq,
std::deque<double> & PreviewedSupportAngles_deq)
{
......
......@@ -71,9 +71,9 @@ namespace PatternGeneratorJRL
/// \param[out] PreviewedSupportAngles
void preview_orientations(double Time, const reference_t & Ref,
double StepDuration, const std::deque<support_state_t> & PrwSupportStates_deq,
std::deque<FootAbsolutePosition> & LeftFootAbsolutePositions,
std::deque<FootAbsolutePosition> & RightFootAbsolutePositions,
std::deque<double> & PreviewedSupportAngles);
const std::deque<FootAbsolutePosition> & LeftFootAbsolutePositions,
const std::deque<FootAbsolutePosition> & RightFootAbsolutePositions,
std::deque<double> & PreviewedSupportAngles);
/// \brief Interpolate previewed orientation of the trunk
///
......
......@@ -248,11 +248,11 @@ namespace PatternGeneratorJRL
void SetCurrentJointValues(MAL_VECTOR( &lCurrentJointValues,double));
/*! \brief Returns the walking mode. */
int GetWalkMode();
int GetWalkMode() const;
/*! \brief Get the leg joint velocity */
void GetLegJointVelocity(MAL_VECTOR( &dqr,double),
MAL_VECTOR( &dql,double));
MAL_VECTOR( &dql,double)) const;
/*! \brief Read a velocity reference. */
void setVelReference(istringstream &strm);
......@@ -313,7 +313,7 @@ namespace PatternGeneratorJRL
/*! \brief Get the waist position and orientation as a quaternion,
and the planar X-Y orientation in Orientation. */
void getWaistPositionAndOrientation(double TQ[7],double &Orientation);
void getWaistPositionAndOrientation(double TQ[7],double &Orientation) const;
/*! \brief Set Waist position and Orientation */
void setWaistPositionAndOrientation(double TQ[7]);
......@@ -321,10 +321,10 @@ namespace PatternGeneratorJRL
/*! \brief Get Waist velocity */
void getWaistVelocity(double &dx,
double &dy,
double &omega) ;
double &omega) const;
/*! \brief An other method to get the waist position using a matrix. */
void getWaistPositionMatrix(MAL_S4x4_MATRIX( &lWaistAbsPos,double));
void getWaistPositionMatrix(MAL_S4x4_MATRIX( &lWaistAbsPos,double)) const;
/*!@} */
......@@ -345,7 +345,7 @@ namespace PatternGeneratorJRL
void setZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint);
/*! \brief Get the initial ZMP reference point. */
void getZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint);
void getZMPInitialPoint(MAL_S3_VECTOR(&,double) lZMPInitialPoint) const;
/*! \name System to call a given method based on registration of a method.
@{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment