Skip to content

Commit

Permalink
Merge branch 'master' into convertJointTrajectory
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 authored Apr 11, 2017
2 parents d4bdaa3 + a59975f commit 3a10630
Show file tree
Hide file tree
Showing 63 changed files with 144 additions and 184 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ include(CompilerSettings)
#==============================================================================
# Libraries and unit tests.
#

configure_file(
${CMAKE_MODULE_PATH}/version.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/aikido/version.hpp
Expand Down
4 changes: 4 additions & 0 deletions cmake/CompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)

set(AIKIDO_CXX_STANDARD_FLAGS -std=c++11)

add_compile_options(-Wall -Wextra -Wpedantic)
if(TREAT_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
endif()
Expand All @@ -33,6 +34,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

set(AIKIDO_CXX_STANDARD_FLAGS -std=c++11)

add_compile_options(-Wall -Wextra -Wpedantic)
if(TREAT_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
endif()
Expand All @@ -49,6 +51,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")

set(AIKIDO_CXX_STANDARD_FLAGS -std=c++11)

add_compile_options(-Wall -Wextra -Wpedantic)
if(TREAT_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
endif()
Expand All @@ -64,6 +67,7 @@ elseif(MSVC)
# C++11 (e.g., -std=c++11) since Visual Studio enables it by default when
# available.

add_compile_options(/Wall)
if(TREAT_WARNINGS_AS_ERRORS)
add_compile_options(/WX)
endif()
Expand Down
4 changes: 2 additions & 2 deletions include/aikido/constraint/NewtonsMethodProjectable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class NewtonsMethodProjectable : public Projectable

private:
DifferentiablePtr mDifferentiable;
statespace::StateSpacePtr mStateSpace;
int mMaxIteration;
std::vector<double> mTolerance;
int mMaxIteration;
double mMinStepSize;
statespace::StateSpacePtr mStateSpace;

bool contains(const statespace::StateSpace::State* _s) const;
};
Expand Down
16 changes: 8 additions & 8 deletions include/aikido/constraint/detail/JointStateSpaceHelpers-impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ struct createDifferentiableFor_impl<statespace::dart::SE2Joint>
using StateSpace = statespace::dart::SE2Joint;
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Differentiable> create(StateSpacePtr _stateSpace)
static std::unique_ptr<Differentiable> create(StateSpacePtr /*_stateSpace*/)
{
throw std::runtime_error(
"No DifferentiableConstraint is available for SE2Joint.");
Expand All @@ -317,7 +317,7 @@ struct createTestableFor_impl<statespace::dart::SE2Joint>
using StateSpace = statespace::dart::SE2Joint;
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Testable> create(StateSpacePtr _stateSpace)
static std::unique_ptr<Testable> create(StateSpacePtr /*_stateSpace*/)
{
throw std::runtime_error(
"No Testable is available for SE2Joint.");
Expand All @@ -331,7 +331,7 @@ struct createProjectableFor_impl<statespace::dart::SE2Joint>
using StateSpace = statespace::dart::SE2Joint;
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Projectable> create(StateSpacePtr _stateSpace)
static std::unique_ptr<Projectable> create(StateSpacePtr /*_stateSpace*/)
{
throw std::runtime_error(
"No Projectable is available for SE2Joint.");
Expand All @@ -346,7 +346,7 @@ struct createSampleableFor_impl<statespace::dart::SE2Joint>
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Sampleable> create(
StateSpacePtr _stateSpace, std::unique_ptr<util::RNG> _rng)
StateSpacePtr /*_stateSpace*/, std::unique_ptr<util::RNG> /*_rng*/)
{
throw std::runtime_error(
"No Sampleable is available for SE2Joint.");
Expand All @@ -360,7 +360,7 @@ struct createDifferentiableFor_impl<statespace::dart::SE3Joint>
using StateSpace = statespace::dart::SE3Joint;
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Differentiable> create(StateSpacePtr _stateSpace)
static std::unique_ptr<Differentiable> create(StateSpacePtr /*_stateSpace*/)
{
throw std::runtime_error(
"No DifferentiableConstraint is available for SE3Joint.");
Expand All @@ -374,7 +374,7 @@ struct createTestableFor_impl<statespace::dart::SE3Joint>
using StateSpace = statespace::dart::SE3Joint;
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Testable> create(StateSpacePtr _stateSpace)
static std::unique_ptr<Testable> create(StateSpacePtr /*_stateSpace*/)
{
throw std::runtime_error(
"No Testable is available for SE3Joint.");
Expand All @@ -388,7 +388,7 @@ struct createProjectableFor_impl<statespace::dart::SE3Joint>
using StateSpace = statespace::dart::SE3Joint;
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Projectable> create(StateSpacePtr _stateSpace)
static std::unique_ptr<Projectable> create(StateSpacePtr /*_stateSpace*/)
{
throw std::runtime_error(
"No Projectable is available for SE3Joint.");
Expand All @@ -403,7 +403,7 @@ struct createSampleableFor_impl<statespace::dart::SE3Joint>
using StateSpacePtr = std::shared_ptr<StateSpace>;

static std::unique_ptr<Sampleable> create(
StateSpacePtr _stateSpace, std::unique_ptr<util::RNG> _rng)
StateSpacePtr /*_stateSpace*/, std::unique_ptr<util::RNG> /*_rng*/)
{
throw std::runtime_error(
"No Sampleable is available for SE3Joint.");
Expand Down
2 changes: 1 addition & 1 deletion include/aikido/distance/SO2Angular.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ class SO2Angular : public DistanceMetric
private:
std::shared_ptr<statespace::SO2> mStateSpace;
};
};
}
}
#endif
2 changes: 1 addition & 1 deletion include/aikido/distance/SO3Angular.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ class SO3Angular : public DistanceMetric
private:
std::shared_ptr<statespace::SO3> mStateSpace;
};
};
}
}
#endif
4 changes: 1 addition & 3 deletions include/aikido/perception/eigen_yaml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ inline void deserialize(
{
typedef Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> MatrixType;
typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;


using boost::format;
using boost::str;
Expand Down Expand Up @@ -187,4 +185,4 @@ inline void operator>>(Node const &node, T &value)

} // namespace YAML

#endif // ifndef YAML_UTILS_H_
#endif // ifndef YAML_UTILS_H_
5 changes: 5 additions & 0 deletions include/aikido/planner/ompl/GeometricStateSpace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "../../distance/DistanceMetric.hpp"
#include "../../statespace/StateSpace.hpp"
#include "../../statespace/GeodesicInterpolator.hpp"
#include "aikido/planner/ompl/BackwardCompatibility.hpp"

namespace aikido {
namespace planner {
Expand Down Expand Up @@ -64,8 +65,12 @@ class GeometricStateSpace : public ::ompl::base::StateSpace
/// For unbounded state spaces, this function can return infinity.
double getMaximumExtent() const override;

#if OMPL_VERSION_AT_LEAST(1,0,0)
/// Get a measure of the space.
double getMeasure() const override;
#else
double getMeasure() const;
#endif

/// Bring the state within the bounds of the state space using the
/// boundsProjection defined in the constructor.
Expand Down
4 changes: 2 additions & 2 deletions include/aikido/rviz/ResourceServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace rviz {

struct BinaryResource {
BinaryResource()
: mData(nullptr)
, mSize(0)
: mSize(0)
, mData(nullptr)
{
}

Expand Down
4 changes: 2 additions & 2 deletions include/aikido/util/Spline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class SplineND
SolutionMatrices mSolution;

public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(TimeVector::NeedsToAlign);
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(TimeVector::NeedsToAlign)
};


Expand Down Expand Up @@ -330,7 +330,7 @@ class SplineProblem
|| TimeVector::NeedsToAlign
|| ProblemMatrix::NeedsToAlign
|| ProblemVector::NeedsToAlign
);
)
};

} // namespace util
Expand Down
2 changes: 1 addition & 1 deletion include/aikido/util/StepSequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StepSequence::const_iterator
bool equal(const StepSequence::const_iterator &other) const;

private:
friend StepSequence;
friend class StepSequence;

const_iterator(StepSequence *seq, int step)
: mSeq(seq)
Expand Down
2 changes: 1 addition & 1 deletion src/constraint/CartesianProductTestable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CartesianProductTestable::CartesianProductTestable(
if (!mStateSpace)
throw std::invalid_argument("_stateSpace is nullptr.");

for(int i = 0; i < mConstraints.size(); ++i)
for(size_t i = 0; i < mConstraints.size(); ++i)
{
if (!mConstraints[i])
{
Expand Down
4 changes: 2 additions & 2 deletions src/constraint/FiniteSampleable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ statespace::StateSpacePtr FiniteSampleGenerator::getStateSpace() const
//=============================================================================
bool FiniteSampleGenerator::sample(statespace::StateSpace::State* _state)
{
if (mStates.size() <= mIndex)
if (mStates.size() <= static_cast<size_t>(mIndex))
return false;

mStateSpace->copyState(mStates[mIndex], _state);
Expand All @@ -113,7 +113,7 @@ int FiniteSampleGenerator::getNumSamples() const
//=============================================================================
bool FiniteSampleGenerator::canSample() const
{
return mStates.size() > mIndex;
return mStates.size() > static_cast<size_t>(mIndex);
}

//=============================================================================
Expand Down
1 change: 0 additions & 1 deletion src/constraint/NewtonsMethodProjectable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ bool NewtonsMethodProjectable::project(
statespace::StateSpace::State* _out) const
{
using StateSpace = statespace::StateSpace;
using State = StateSpace::State;

int iteration = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/constraint/Satisfied.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::vector<constraint::ConstraintType> Satisfied

//=============================================================================
bool Satisfied::isSatisfied(
const statespace::StateSpace::State* state) const
const statespace::StateSpace::State* /*state*/) const
{
return true;
}
Expand All @@ -48,14 +48,14 @@ bool Satisfied::project(

//=============================================================================
void Satisfied::getValue(
const statespace::StateSpace::State* _s, Eigen::VectorXd& _out) const
const statespace::StateSpace::State* /*_s*/, Eigen::VectorXd& _out) const
{
_out = Eigen::Matrix<double, 0, 1>();
}

//=============================================================================
void Satisfied::getJacobian(
const statespace::StateSpace::State* _s,
const statespace::StateSpace::State* /*_s*/,
Eigen::MatrixXd& _out) const
{
_out = Eigen::Matrix<double, 0, 0>();
Expand Down
45 changes: 23 additions & 22 deletions src/constraint/TSR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,57 +80,58 @@ class TSRSampleGenerator : public SampleGenerator
//=============================================================================
TSR::TSR(std::unique_ptr<util::RNG> _rng, const Eigen::Isometry3d& _T0_w,
const Eigen::Matrix<double, 6, 2>& _Bw, const Eigen::Isometry3d& _Tw_e)
: mRng(std::move(_rng))
, mStateSpace(std::make_shared<SE3>())
, mT0_w(_T0_w)
: mT0_w(_T0_w)
, mBw(_Bw)
, mTw_e(_Tw_e)
, mRng(std::move(_rng))
, mStateSpace(std::make_shared<SE3>())
{
validate();
}

//=============================================================================
TSR::TSR(const Eigen::Isometry3d& _T0_w, const Eigen::Matrix<double, 6, 2>& _Bw,
const Eigen::Isometry3d& _Tw_e)
: mRng(std::unique_ptr<util::RNG>(
new util::RNGWrapper<std::default_random_engine>(0)))
, mStateSpace(std::make_shared<SE3>())
, mT0_w(_T0_w)
: mT0_w(_T0_w)
, mBw(_Bw)
, mTw_e(_Tw_e)
, mRng(std::unique_ptr<util::RNG>(
new util::RNGWrapper<std::default_random_engine>(0)))
, mStateSpace(std::make_shared<SE3>())
{
validate();
}

//=============================================================================
TSR::TSR(const TSR& other)
: mRng(std::move(other.mRng->clone()))
, mStateSpace(std::make_shared<SE3>())
, mT0_w(other.mT0_w)
, mTw_e(other.mTw_e)
: mT0_w(other.mT0_w)
, mBw(other.mBw)
, mTw_e(other.mTw_e)
, mRng(std::move(other.mRng->clone()))
, mStateSpace(std::make_shared<SE3>())
{
validate();
}

//=============================================================================
TSR::TSR(TSR&& other)
: mRng(std::move(other.mRng))
, mStateSpace(std::make_shared<SE3>())
, mT0_w(other.mT0_w)
, mTw_e(other.mTw_e)
: mT0_w(other.mT0_w)
, mBw(other.mBw)
, mTw_e(other.mTw_e)
, mRng(std::move(other.mRng))
, mStateSpace(std::make_shared<SE3>())
{
validate();
}

//=============================================================================
TSR& TSR::operator=(const TSR& other)
{
mRng = std::move(other.mRng->clone());

mT0_w = other.mT0_w;
mTw_e = other.mTw_e;
mBw = other.mBw;
mTw_e = other.mTw_e;
mRng = std::move(other.mRng->clone());

// Intentionally don't assign StateSpace.

Expand All @@ -140,11 +141,11 @@ TSR& TSR::operator=(const TSR& other)
//=============================================================================
TSR& TSR::operator=(TSR&& other)
{
mRng = std::move(other.mRng);
mStateSpace = std::move(other.mStateSpace);
mT0_w = std::move(other.mT0_w);
mTw_e = std::move(other.mTw_e);
mBw = std::move(other.mBw);
mTw_e = std::move(other.mTw_e);
mRng = std::move(other.mRng);
mStateSpace = std::move(other.mStateSpace);

return *this;
}
Expand Down Expand Up @@ -320,8 +321,8 @@ std::vector<ConstraintType> TSR::getConstraintTypes() const
}

//=============================================================================
bool TSR::project(const statespace::StateSpace::State* _s,
statespace::StateSpace::State* _out) const
bool TSR::project(const statespace::StateSpace::State* /*_s*/,
statespace::StateSpace::State* /*_out*/) const
{
// TODO
return false;
Expand Down
Loading

0 comments on commit 3a10630

Please sign in to comment.