Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for compiler warnings #77

Merged
merged 6 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion curves/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 2.8.3)
yvaind marked this conversation as resolved.
Show resolved Hide resolved
project(curves)

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_STANDARD 11)
add_compile_options(-Wall -Wextra -Wpedantic)

find_package(catkin REQUIRED COMPONENTS
)
Expand Down
36 changes: 18 additions & 18 deletions curves/include/curves/CubicHermiteSE3Curve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ struct HermiteTransformation {
};

template <typename Scalar>
HermiteTransformation<Scalar>::HermiteTransformation() {};
HermiteTransformation<Scalar>::HermiteTransformation() {}

template <typename Scalar>
HermiteTransformation<Scalar>::HermiteTransformation(const Transform& transform,
const Twist& derivatives) :
transformation_(transform),
transformationDerivative_(derivatives) {};
transformationDerivative_(derivatives) {}

template <typename Scalar>
HermiteTransformation<Scalar>::~HermiteTransformation() {};
HermiteTransformation<Scalar>::~HermiteTransformation() {}

}

Expand Down Expand Up @@ -224,48 +224,48 @@ class CubicHermiteSE3Curve : public SE3Curve {

void saveCurveAtTimes(const std::string& filename, std::vector<Time> times) const;

void saveCorrectionCurveAtTimes(const std::string& filename, std::vector<Time> times) const {};
void saveCorrectionCurveAtTimes(const std::string& /*filename*/, std::vector<Time> /*times*/) const {}

void getCurveTimes(std::vector<Time>* outTimes) const;

/// \brief Returns the number of coefficients in the correction curve
int correctionSize() const {return 0;};
int correctionSize() const {return 0;}

/// \brief Fold in the correction curve into the base curve and reinitialize
/// correction curve coefficients to identity transformations.
void foldInCorrections() {};
void foldInCorrections() {}

/// \brief Add coefficients to the correction curve at given times.
void setCorrectionTimes(const std::vector<Time>& times) {};
void setCorrectionTimes(const std::vector<Time>& /*times*/) {}

/// \brief Remove a correction coefficient at the specified time.
void removeCorrectionCoefficientAtTime(Time time) {};
void removeCorrectionCoefficientAtTime(Time /*time*/) {}

/// \brief Set the correction coefficient value at the specified time.
void setCorrectionCoefficientAtTime(Time time, ValueType value) {};
void setCorrectionCoefficientAtTime(Time /*time*/, ValueType /*value*/) {}

/// \brief Reset the correction curve to identity values with knots at desired times
void resetCorrectionCurve(const std::vector<Time>& times) {};
void resetCorrectionCurve(const std::vector<Time>& /*times*/) {}

/// \brief Set the base curve to given values with knots at desired times
/// Resets the curve beforehand.
void setBaseCurve(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void setBaseCurve(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

/// \brief Add / replace the given coefficients without resetting the curve.
void setBaseCurvePart(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void setBaseCurvePart(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

/// \brief Modifies values of the base coefficient in batch, starting at times[0] and assuming that
/// a coefficient exists at all the specified times.
void modifyBaseCoefficientsValuesInBatch(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void modifyBaseCoefficientsValuesInBatch(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

void getBaseCurveTimes(std::vector<Time>* outTimes) const {};
void getBaseCurveTimes(std::vector<Time>* /*outTimes*/) const {}

void getBaseCurveTimesInWindow(std::vector<Time>* outTimes, Time begTime, Time endTime) const {};
void getBaseCurveTimesInWindow(std::vector<Time>* /*outTimes*/, Time /*begTime*/, Time /*endTime*/) const {}

// return number of coefficients curve is composed of
int baseSize() const {return size();};
int baseSize() const {return size();}

void saveCorrectionCurveTimesAndValues(const std::string& filename) const {};
void saveCorrectionCurveTimesAndValues(const std::string& /*filename*/) const {}
private:
LocalSupport2CoefficientManager<Coefficient> manager_;
SamplingPolicy hermitePolicy_;
Expand Down Expand Up @@ -370,7 +370,7 @@ template<>
inline void SamplingPolicy::extend<CubicHermiteSE3Curve, ValueType>(const std::vector<Time>& times,
const std::vector<ValueType>& values,
CubicHermiteSE3Curve* curve,
std::vector<Key>* outKeys) {
std::vector<Key>* /*outKeys*/) {
for (std::size_t i = 0; i < times.size(); ++i) {
// ensure time strictly increases
CHECK((times[i] > curve->manager_.getMaxTime()) || curve->manager_.size() == 0) << "curve can only be extended into the future. Requested = "
Expand Down
28 changes: 14 additions & 14 deletions curves/include/curves/DiscreteSE3Curve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,51 +155,51 @@ class DiscreteSE3Curve : public SE3Curve {

void saveCurveAtTimes(const std::string& filename, std::vector<Time> times) const;

void saveCorrectionCurveAtTimes(const std::string& filename, std::vector<Time> times) const {};
void saveCorrectionCurveAtTimes(const std::string& /*filename*/, std::vector<Time> /*times*/) const {}

void getCurveTimes(std::vector<Time>* outTimes) const;

// Fake functions to comply with the current interfaces of trajectories_optimizer
// todo : tidy up

/// \brief Returns the number of coefficients in the correction curve
int correctionSize() const {return 0;};
int correctionSize() const {return 0;}

/// \brief Fold in the correction curve into the base curve and reinitialize
/// correction curve coefficients to identity transformations.
void foldInCorrections() {};
void foldInCorrections() {}

/// \brief Add coefficients to the correction curve at given times.
void setCorrectionTimes(const std::vector<Time>& times) {};
void setCorrectionTimes(const std::vector<Time>& /*times*/) {}

/// \brief Remove a correction coefficient at the specified time.
void removeCorrectionCoefficientAtTime(Time time) {};
void removeCorrectionCoefficientAtTime(Time /*time*/) {}

/// \brief Set the correction coefficient value at the specified time.
void setCorrectionCoefficientAtTime(Time time, ValueType value) {};
void setCorrectionCoefficientAtTime(Time /*time*/, ValueType /*value*/) {}

/// \brief Reset the correction curve to identity values with knots at desired times
void resetCorrectionCurve(const std::vector<Time>& times) {};
void resetCorrectionCurve(const std::vector<Time>& /*time*/) {}

/// \brief Set the base curve to given values with knots at desired times
/// Resets the curve beforehand.
void setBaseCurve(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void setBaseCurve(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

/// \brief Add / replace the given coefficients without resetting the curve.
void setBaseCurvePart(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void setBaseCurvePart(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

/// \brief Modifies values of the base coefficient in batch, starting at times[0] and assuming that
/// a coefficient exists at all the specified times.
void modifyBaseCoefficientsValuesInBatch(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void modifyBaseCoefficientsValuesInBatch(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

void getBaseCurveTimes(std::vector<Time>* outTimes) const {};
void getBaseCurveTimes(std::vector<Time>* /*outTimes*/) const {}

void getBaseCurveTimesInWindow(std::vector<Time>* outTimes, Time begTime, Time endTime) const {};
void getBaseCurveTimesInWindow(std::vector<Time>* /*outTimes*/, Time /*begTime*/, Time /*endTime*/) const {}

// return number of coefficients curve is composed of
int baseSize() const {return size();};
int baseSize() const {return size();}

void saveCorrectionCurveTimesAndValues(const std::string& filename) const {};
void saveCorrectionCurveTimesAndValues(const std::string& /*filename*/) const {}

private:
LocalSupport2CoefficientManager<Coefficient> manager_;
Expand Down
2 changes: 1 addition & 1 deletion curves/include/curves/LocalSupport2CoefficientManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LocalSupport2CoefficientManager {
KeyCoefficient(const Key key, const Coefficient& coefficient) :
key(key), coefficient(coefficient) {}

KeyCoefficient() {};
KeyCoefficient() {}

bool equals(const KeyCoefficient& other) const {
//todo Note: here we assume that == operator is implemented by the coefficient.
Expand Down
8 changes: 4 additions & 4 deletions curves/include/curves/PolynomialSplineContainer.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ double PolynomialSplineContainer<splineOrder_>::getPositionAtTime(double t) cons
return 0.0;
}

if (activeSplineIdx == splines_.size()) {
if (static_cast<unsigned int>(activeSplineIdx) == splines_.size()) {
return splines_.back().getPositionAtTime(splines_.back().getSplineDuration());
}

Expand All @@ -183,7 +183,7 @@ double PolynomialSplineContainer<splineOrder_>::getVelocityAtTime(double t) cons
return 0.0;
}

if (activeSplineIdx == splines_.size()) {
if (static_cast<unsigned int>(activeSplineIdx) == splines_.size()) {
return splines_.back().getVelocityAtTime(splines_.back().getSplineDuration());
}

Expand All @@ -202,7 +202,7 @@ double PolynomialSplineContainer<splineOrder_>::getAccelerationAtTime(double t)
return 0.0;
}

if (activeSplineIdx == splines_.size()) {
if (static_cast<unsigned int>(activeSplineIdx) == splines_.size()) {
return splines_.back().getAccelerationAtTime(splines_.back().getSplineDuration());
}

Expand Down Expand Up @@ -417,7 +417,7 @@ bool PolynomialSplineContainer<splineOrder_>::setData(

this->reserveSplines(numSplines);

for (unsigned int splineId = 0; splineId<numSplines; ++splineId) {
for (int splineId = 0; splineId<numSplines; ++splineId) {
const double duration = knotDurations[splineId+1]-knotDurations[splineId];

if (duration<=0.0) {
Expand Down
8 changes: 4 additions & 4 deletions curves/include/curves/PolynomialSplineScalarCurve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PolynomialSplineScalarCurve : public Curve<ScalarCurveConfig>

}

virtual void print(const std::string& str = "") const
virtual void print(const std::string& /*str*/) const
{
const double minTime = getMinTime();
const double maxTime = getMaxTime();
Expand Down Expand Up @@ -105,8 +105,8 @@ class PolynomialSplineScalarCurve : public Curve<ScalarCurveConfig>
return true;
}

virtual void extend(const std::vector<Time>& times, const std::vector<ValueType>& values,
std::vector<Key>* outKeys)
virtual void extend(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/,
std::vector<Key>* /*outKeys*/)
{
throw std::runtime_error("extend is not yet implemented!");
}
Expand Down Expand Up @@ -144,7 +144,7 @@ class PolynomialSplineScalarCurve : public Curve<ScalarCurveConfig>
minTime_ = 0.0;
}

virtual void transformCurve(const ValueType T)
virtual void transformCurve(const ValueType /*T*/)
{
CHECK(false) << "Not implemented";
}
Expand Down
12 changes: 6 additions & 6 deletions curves/include/curves/PolynomialSplineVectorSpaceCurve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PolynomialSplineVectorSpaceCurve : public VectorSpaceCurve<N>
{
}

virtual void print(const std::string& str = "") const
virtual void print(const std::string& /*str*/) const
{
}

Expand Down Expand Up @@ -78,8 +78,8 @@ class PolynomialSplineVectorSpaceCurve : public VectorSpaceCurve<N>
return true;
}

virtual void extend(const std::vector<Time>& times, const std::vector<ValueType>& values,
std::vector<Key>* outKeys)
virtual void extend(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/,
std::vector<Key>* /*outKeys*/)
{
throw std::runtime_error("PolynomialSplineVectorSpaceCurve::extend is not yet implemented!");
}
Expand Down Expand Up @@ -137,8 +137,8 @@ class PolynomialSplineVectorSpaceCurve : public VectorSpaceCurve<N>
}


virtual void fitCurve(const std::vector<SplineOptions>& values,
std::vector<Key>* outKeys = NULL)
virtual void fitCurve(const std::vector<SplineOptions>& /*values*/,
std::vector<Key>* /*outKeys*/)
{
// TODO
throw std::runtime_error("PolynomialSplineVectorSpaceCurve::fitCurve is not yet implemented!");
Expand All @@ -151,7 +151,7 @@ class PolynomialSplineVectorSpaceCurve : public VectorSpaceCurve<N>
}
}

virtual void transformCurve(const ValueType T)
virtual void transformCurve(const ValueType /*T*/)
{
CHECK(false) << "Not implemented";
}
Expand Down
4 changes: 2 additions & 2 deletions curves/include/curves/SE3CurveFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class SE3CurveFactory {

public:

SE3CurveFactory() {};
~SE3CurveFactory() {};
SE3CurveFactory() {}
~SE3CurveFactory() {}

static std::shared_ptr<SE3Curve> create_curve(const std::string& curveType);

Expand Down
6 changes: 3 additions & 3 deletions curves/include/curves/SamplingPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class SamplingPolicy {
measurementsSinceLastExtend_(0),
minimumMeasurements_(1),
minSamplingPeriod_(0),
lastExtend_(0) {};
lastExtend_(0) {}

SamplingPolicy(int minimumMeasurements, Time minSamplingPeriod) :
measurementsSinceLastExtend_(0),
minimumMeasurements_(minimumMeasurements),
minSamplingPeriod_(minSamplingPeriod),
lastExtend_(0) {};
lastExtend_(0) {}

~SamplingPolicy() {};
~SamplingPolicy() {}

template<typename CurveType, typename ValueType>
Key interpolationExtend(const Time& time,
Expand Down
28 changes: 14 additions & 14 deletions curves/include/curves/SemiDiscreteSE3Curve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,51 +155,51 @@ class SemiDiscreteSE3Curve : public SE3Curve {

void saveCurveAtTimes(const std::string& filename, std::vector<Time> times) const;

void saveCorrectionCurveAtTimes(const std::string& filename, std::vector<Time> times) const {};
void saveCorrectionCurveAtTimes(const std::string& /*filename*/, std::vector<Time> /*times*/) const {}

void getCurveTimes(std::vector<Time>* outTimes) const;

// Fake functions to comply with the current interfaces of trajectories_optimizer
// todo : tidy up

/// \brief Returns the number of coefficients in the correction curve
int correctionSize() const {return 0;};
int correctionSize() const {return 0;}

/// \brief Fold in the correction curve into the base curve and reinitialize
/// correction curve coefficients to identity transformations.
void foldInCorrections() {};
void foldInCorrections() {}

/// \brief Add coefficients to the correction curve at given times.
void setCorrectionTimes(const std::vector<Time>& times) {};
void setCorrectionTimes(const std::vector<Time>& /*times*/) {}

/// \brief Remove a correction coefficient at the specified time.
void removeCorrectionCoefficientAtTime(Time time) {};
void removeCorrectionCoefficientAtTime(Time /*time*/) {}

/// \brief Set the correction coefficient value at the specified time.
void setCorrectionCoefficientAtTime(Time time, ValueType value) {};
void setCorrectionCoefficientAtTime(Time /*time*/, ValueType /*value*/) {}

/// \brief Reset the correction curve to identity values with knots at desired times
void resetCorrectionCurve(const std::vector<Time>& times) {};
void resetCorrectionCurve(const std::vector<Time>& /*times*/) {}

/// \brief Set the base curve to given values with knots at desired times
/// Resets the curve beforehand.
void setBaseCurve(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void setBaseCurve(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

/// \brief Add / replace the given coefficients without resetting the curve.
void setBaseCurvePart(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void setBaseCurvePart(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

/// \brief Modifies values of the base coefficient in batch, starting at times[0] and assuming that
/// a coefficient exists at all the specified times.
void modifyBaseCoefficientsValuesInBatch(const std::vector<Time>& times, const std::vector<ValueType>& values) {};
void modifyBaseCoefficientsValuesInBatch(const std::vector<Time>& /*times*/, const std::vector<ValueType>& /*values*/) {}

void getBaseCurveTimes(std::vector<Time>* outTimes) const {};
void getBaseCurveTimes(std::vector<Time>* /*outTimes*/) const {}

void getBaseCurveTimesInWindow(std::vector<Time>* outTimes, Time begTime, Time endTime) const {};
void getBaseCurveTimesInWindow(std::vector<Time>* /*outTimes*/, Time /*begTime*/, Time /*endTime*/) const {}

// return number of coefficients curve is composed of
int baseSize() const {return size();};
int baseSize() const {return size();}

void saveCorrectionCurveTimesAndValues(const std::string& filename) const {};
void saveCorrectionCurveTimesAndValues(const std::string& /*filename*/) const {}

private:
LocalSupport2CoefficientManager<Coefficient> manager_;
Expand Down
Loading