-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
Add shorter aliases in aikido/constraint.hpp.
Codecov Report
@@ Coverage Diff @@
## master #342 +/- ##
==========================================
+ Coverage 81% 81.02% +0.01%
==========================================
Files 205 205
Lines 6003 6003
==========================================
+ Hits 4863 4864 +1
+ Misses 1140 1139 -1
|
using dart::createDifferentiableBounds; | ||
using dart::createProjectableBounds; | ||
using dart::createTestableBounds; | ||
using dart::createSampleableBounds; |
There was a problem hiding this comment.
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? 😄
There was a problem hiding this 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, |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/rviz/InteractiveMarkerViewer.cpp
Outdated
int nSamples, | ||
const std::string& basename) | ||
{ | ||
using dart::dynamics::Frame; | ||
using dart::dynamics::SimpleFrame; | ||
using aikido::constraint::TSR; | ||
using aikido::constraint::dart::TSR; |
There was a problem hiding this comment.
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::
.
src/rviz/InteractiveMarkerViewer.cpp
Outdated
@@ -61,13 +61,13 @@ FrameMarkerPtr InteractiveMarkerViewer::addFrame( | |||
|
|||
//============================================================================== | |||
TSRMarkerPtr InteractiveMarkerViewer::addTSRMarker( | |||
const aikido::constraint::TSR& tsr, | |||
const aikido::constraint::dart::TSR& tsr, |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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::
.
* 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.
constraint::uniform
namespace to mirror the existing directory structureconstraint::dart
namespaceBefore creating a pull request
make format
Before merging a pull request
CHANGELOG.md