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

Clean up constraint namespace #342

Merged
merged 6 commits into from
Feb 24, 2018
Merged

Conversation

brianhou
Copy link
Contributor

@brianhou brianhou commented Feb 21, 2018


Before creating a pull request

  • Document new methods and classes
  • Format code with make format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@brianhou brianhou added this to the Aikido 0.3.0 milestone Feb 21, 2018
@brianhou brianhou requested a review from jslee02 February 21, 2018 04:03
@codecov
Copy link

codecov bot commented Feb 21, 2018

Codecov Report

Merging #342 into master will increase coverage by 0.01%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master     #342      +/-   ##
==========================================
+ Coverage      81%   81.02%   +0.01%     
==========================================
  Files         205      205              
  Lines        6003     6003              
==========================================
+ Hits         4863     4864       +1     
+ Misses       1140     1139       -1
Impacted Files Coverage Δ
...rc/planner/vectorfield/BodyNodePoseVectorField.cpp 66.66% <ø> (ø) ⬆️
src/constraint/dart/FrameDifferentiable.cpp 77.27% <ø> (ø)
...rc/constraint/dart/InverseKinematicsSampleable.cpp 85.71% <ø> (ø)
src/constraint/uniform/SO2UniformSampler.cpp 100% <ø> (ø) ⬆️
...aikido/constraint/dart/FramePairDifferentiable.hpp 100% <ø> (ø)
include/aikido/constraint/dart/CollisionFree.hpp 100% <ø> (ø)
...de/aikido/constraint/uniform/SO2UniformSampler.hpp 100% <ø> (ø) ⬆️
include/aikido/constraint/dart/TSR.hpp 100% <ø> (ø)
src/constraint/dart/FramePairDifferentiable.cpp 77.55% <ø> (ø)
...lude/aikido/constraint/uniform/RnBoxConstraint.hpp 100% <ø> (ø) ⬆️
... and 20 more

using dart::createDifferentiableBounds;
using dart::createProjectableBounds;
using dart::createTestableBounds;
using dart::createSampleableBounds;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems using namespace dart (in aikido::constraint namespace) also works here instead of listing all the classes. But I'm not sure if this is a good practice. @psigen Could you shed some light on here? 😄

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some nitpick comments. Otherwise, looks good to go.

@@ -51,7 +51,7 @@ class InteractiveMarkerViewer
/// \param basename Basename for markers
/// \return TSRMarkerPtr contains sampled frames of TSR.
TSRMarkerPtr addTSRMarker(
const aikido::constraint::TSR& tsr,
const aikido::constraint::dart::TSR& tsr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's simplify this to const constraint::dart::TSR.

#include "aikido/constraint/uniform/RnConstantSampler.hpp"

#undef dtwarn
#define dtwarn (::dart::common::colorErr("Warning", __FILE__, __LINE__, 33))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because of namespace dart ambiguous between ::dart and ::aikido::[~]::dart? Let me make an upstream fix for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I created #348 to track this.

int nSamples,
const std::string& basename)
{
using dart::dynamics::Frame;
using dart::dynamics::SimpleFrame;
using aikido::constraint::TSR;
using aikido::constraint::dart::TSR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's remove leading namespace aikido::.

@@ -61,13 +61,13 @@ FrameMarkerPtr InteractiveMarkerViewer::addFrame(

//==============================================================================
TSRMarkerPtr InteractiveMarkerViewer::addTSRMarker(
const aikido::constraint::TSR& tsr,
const aikido::constraint::dart::TSR& tsr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's remove leading namespace aikido::.

@@ -231,7 +231,7 @@ std::unique_ptr<aikido::trajectory::Spline> planToEndEffectorPose(
= std::make_shared<aikido::constraint::TestableIntersection>(stateSpace);
compoundConstraint->addConstraint(constraint);
compoundConstraint->addConstraint(
aikido::constraint::createTestableBounds(stateSpace));
aikido::constraint::dart::createTestableBounds(stateSpace));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's remove leading namespace aikido::.

@@ -181,7 +181,7 @@ std::unique_ptr<aikido::trajectory::Spline> planToEndEffectorOffset(
= std::make_shared<aikido::constraint::TestableIntersection>(stateSpace);
compoundConstraint->addConstraint(constraint);
compoundConstraint->addConstraint(
aikido::constraint::createTestableBounds(stateSpace));
aikido::constraint::dart::createTestableBounds(stateSpace));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's remove leading namespace aikido::.

@@ -181,7 +181,7 @@ std::unique_ptr<aikido::trajectory::Spline> planToEndEffectorOffset(
= std::make_shared<aikido::constraint::TestableIntersection>(stateSpace);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's remove leading namespace aikido::.

@brianhou brianhou merged commit 63d3f5f into master Feb 24, 2018
@brianhou brianhou deleted the enhancement/brianhou/ns-cleanup branch February 24, 2018 04:01
@aditya-vk aditya-vk mentioned this pull request May 10, 2018
5 tasks
gilwoolee pushed a commit that referenced this pull request Jan 21, 2019
* Create constraint::uniform namespace.

Add shorter aliases in aikido/constraint.hpp.

* Create constraint::dart namespace.

* Fix tests after introducing constraint::dart.

* Update CHANGELOG.md.

* Address @jslee02's comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants