diff --git a/include/aikido/constraint/detail/JointStateSpaceHelpers-impl.hpp b/include/aikido/constraint/detail/JointStateSpaceHelpers-impl.hpp index d19e42202c..92db13fa1e 100644 --- a/include/aikido/constraint/detail/JointStateSpaceHelpers-impl.hpp +++ b/include/aikido/constraint/detail/JointStateSpaceHelpers-impl.hpp @@ -242,7 +242,7 @@ struct createSampleableFor_impl if (isLimited(_stateSpace->getJoint())) throw std::invalid_argument("SO2Joint must not have limits."); - return dart::common::make_unique( + return dart::common::make_unique( std::move(_stateSpace), std::move(_rng)); } }; diff --git a/include/aikido/constraint/uniform/SO2UniformSampler.hpp b/include/aikido/constraint/uniform/SO2UniformSampler.hpp index 9c070168ef..8ca0d656bc 100644 --- a/include/aikido/constraint/uniform/SO2UniformSampler.hpp +++ b/include/aikido/constraint/uniform/SO2UniformSampler.hpp @@ -1,5 +1,6 @@ #ifndef AIKIDO_CONSTRAINT_UNIFORM_SO2UNIFORMSAMPLER_HPP_ #define AIKIDO_CONSTRAINT_UNIFORM_SO2UNIFORMSAMPLER_HPP_ + #include "../../statespace/SO2.hpp" #include "../Sampleable.hpp" @@ -9,14 +10,14 @@ namespace constraint { /// Uniform sampler for SO2States. Its SampleGenerators will sample /// uniformly from SO2, and the sequence of samples is /// deterministically generated given a random number generator seed. -class SO2Sampleable : public constraint::Sampleable +class SO2UniformSampler : public constraint::Sampleable { public: /// Constructor. /// \param _space SO2 in which this constraint operates. /// \param _rng Random number generator which determines the sampling /// sequence of this constraint's SampleGenerators. - SO2Sampleable( + SO2UniformSampler( std::shared_ptr _space, std::unique_ptr _rng); diff --git a/include/aikido/constraint/uniform/SO3UniformSampler.hpp b/include/aikido/constraint/uniform/SO3UniformSampler.hpp index 0a50b54458..e4e108ef8b 100644 --- a/include/aikido/constraint/uniform/SO3UniformSampler.hpp +++ b/include/aikido/constraint/uniform/SO3UniformSampler.hpp @@ -1,5 +1,6 @@ #ifndef AIKIDO_CONSTRAINT_UNIFORM_SO3UNIFORMSAMPLER_HPP_ #define AIKIDO_CONSTRAINT_UNIFORM_SO3UNIFORMSAMPLER_HPP_ + #include "../../statespace/SO3.hpp" #include "../Sampleable.hpp" diff --git a/src/constraint/uniform/SO2UniformSampler.cpp b/src/constraint/uniform/SO2UniformSampler.cpp index abda691036..8e61968134 100644 --- a/src/constraint/uniform/SO2UniformSampler.cpp +++ b/src/constraint/uniform/SO2UniformSampler.cpp @@ -29,7 +29,7 @@ class SO2UniformSampleGenerator : public constraint::SampleGenerator std::unique_ptr mRng; std::uniform_real_distribution mDistribution; - friend class SO2Sampleable; + friend class SO2UniformSampler; }; //============================================================================== @@ -67,7 +67,7 @@ bool SO2UniformSampleGenerator::canSample() const } //============================================================================== -SO2Sampleable::SO2Sampleable( +SO2UniformSampler::SO2UniformSampler( std::shared_ptr _space, std::unique_ptr _rng) : mSpace(std::move(_space)), mRng(std::move(_rng)) { @@ -79,14 +79,14 @@ SO2Sampleable::SO2Sampleable( } //============================================================================== -statespace::StateSpacePtr SO2Sampleable::getStateSpace() const +statespace::StateSpacePtr SO2UniformSampler::getStateSpace() const { return mSpace; } //============================================================================== std::unique_ptr -SO2Sampleable::createSampleGenerator() const +SO2UniformSampler::createSampleGenerator() const { return std::unique_ptr( new SO2UniformSampleGenerator(mSpace, mRng->clone())); diff --git a/tests/constraint/test_CyclicSampleable.cpp b/tests/constraint/test_CyclicSampleable.cpp index 6d3b196c67..b24050b948 100644 --- a/tests/constraint/test_CyclicSampleable.cpp +++ b/tests/constraint/test_CyclicSampleable.cpp @@ -9,7 +9,7 @@ using aikido::statespace::SO2; -using aikido::constraint::SO2Sampleable; +using aikido::constraint::SO2UniformSampler; using aikido::statespace::R1; using aikido::statespace::R2; using aikido::constraint::CyclicSampleable; @@ -34,7 +34,7 @@ TEST(CyclicSampleableTest, ConstructorThrowsOnNullConstraint) TEST(CyclicSampleableTest, ConstructorThrowsOnUnlimitiedSampleGenerator) { auto so2 = std::make_shared(); - auto constraint = std::make_shared(so2, make_rng()); + auto constraint = std::make_shared(so2, make_rng()); EXPECT_THROW(std::make_shared(constraint), std::invalid_argument); } diff --git a/tests/constraint/test_SO2UniformSampler.cpp b/tests/constraint/test_SO2UniformSampler.cpp index 86f43fc78f..2991178286 100644 --- a/tests/constraint/test_SO2UniformSampler.cpp +++ b/tests/constraint/test_SO2UniformSampler.cpp @@ -5,7 +5,7 @@ #include "SampleGeneratorCoverage.hpp" using aikido::statespace::SO2; -using aikido::constraint::SO2Sampleable; +using aikido::constraint::SO2UniformSampler; using aikido::constraint::SampleGenerator; using aikido::common::RNG; using aikido::common::RNGWrapper; @@ -44,26 +44,26 @@ class SO2UniformSamplerTests : public ::testing::Test TEST_F(SO2UniformSamplerTests, constructor_StateSpaceIsNull_Throws) { EXPECT_THROW({ - SO2Sampleable(nullptr, mRng->clone()); + SO2UniformSampler(nullptr, mRng->clone()); }, std::invalid_argument); } TEST_F(SO2UniformSamplerTests, constructor_RNGIsNull_Throws) { EXPECT_THROW({ - SO2Sampleable(mStateSpace, nullptr); + SO2UniformSampler(mStateSpace, nullptr); }, std::invalid_argument); } TEST_F(SO2UniformSamplerTests, getStateSpace) { - SO2Sampleable constraint(mStateSpace, mRng->clone()); + SO2UniformSampler constraint(mStateSpace, mRng->clone()); EXPECT_EQ(mStateSpace, constraint.getStateSpace()); } TEST_F(SO2UniformSamplerTests, createSampleGenerator) { - SO2Sampleable constraint(mStateSpace, mRng->clone()); + SO2UniformSampler constraint(mStateSpace, mRng->clone()); auto generator = constraint.createSampleGenerator(); ASSERT_TRUE(!!generator); diff --git a/tests/constraint/test_SampleableSubspace.cpp b/tests/constraint/test_SampleableSubspace.cpp index 4302f7211c..6984e92eff 100644 --- a/tests/constraint/test_SampleableSubspace.cpp +++ b/tests/constraint/test_SampleableSubspace.cpp @@ -12,7 +12,7 @@ using aikido::constraint::CartesianProductSampleable; using aikido::constraint::SampleablePtr; using aikido::statespace::CartesianProduct; using aikido::statespace::SO2; -using aikido::constraint::SO2Sampleable; +using aikido::constraint::SO2UniformSampler; using aikido::statespace::R3; using aikido::constraint::R3BoxConstraint; using aikido::common::RNG; @@ -32,7 +32,7 @@ class CartesianProductSampleableTest : public testing::Test new RNGWrapper(0)); rvSampler = std::make_shared( rvss, rng->clone(), Eigen::Vector3d(0, 0, 0), Eigen::Vector3d(1, 1, 1)); - so2Sampler = std::make_shared( + so2Sampler = std::make_shared( so2, rng->clone()); sampleables.push_back(rvSampler); sampleables.push_back(so2Sampler); @@ -46,7 +46,7 @@ class CartesianProductSampleableTest : public testing::Test std::shared_ptr rvss; std::shared_ptr so2; std::shared_ptr rvSampler; - std::shared_ptr so2Sampler; + std::shared_ptr so2Sampler; };