-
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
Adds SE2BoxConstraint #135
Conversation
Why did you close this? These look like a great set of changes. |
I realized that I wanted to make some changes, e.g. making the distance
function weighted sum of radial distance and R^2 norm , and add at least
some basic tests. Not sure I could do it in the next a few days (given IROS
deadline), so I'll re open it as soon as its ready!
Thanks for noticing.
- Gilwoo
…On Sun, Feb 12, 2017 at 7:47 PM, Michael Koval ***@***.***> wrote:
Why did you close this? These look like a great set of changes.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE7LaGHTVR8psOgKlBNhZNZnsGm_pxbdks5rb6gRgaJpZM4L96dl>
.
|
This is not demo-priority but we'll need it eventually for base planning. I haven't made any changes I promised, but it'd be great if someone could take a quick pass and comment/agree on the general structure. |
Conflicts: include/aikido/distance/detail/defaults-impl.hpp
Codecov Report
@@ Coverage Diff @@
## master #135 +/- ##
=========================================
Coverage ? 73.19%
=========================================
Files ? 148
Lines ? 4092
Branches ? 632
=========================================
Hits ? 2995
Misses ? 650
Partials ? 447
|
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.
Changes look good overall. It'd be great if you have time to add the weighted norm and tests, but it might be easier to address it in a future PR and merge this now!
throw std::invalid_argument( | ||
"Rotational component of SE2Joint must not have limits."); | ||
} | ||
else if (!joint->hasPositionLimit(1) && !joint->hasPositionLimit(2)) |
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.
Should this condition be !(joint->hasPositionLimit(1) && joint->hasPositionLimit(2))
?
@@ -146,7 +146,7 @@ RBoxConstraint<N>::RBoxConstraint(std::shared_ptr<statespace::R<N>> _space, | |||
{ | |||
std::stringstream msg; | |||
msg << "Unable to sample from StateSpace because lower limit exeeds" |
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: exeeds
-> exceeds
, mRnDimension(2) | ||
, mDimension(3) | ||
{ | ||
mLowerLimits[0] = -M_PI; |
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: can we explicitly document that the limits are [theta, x, y]
? It seems that this is a result of SE2::logMap
.
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.
👍 to adding documentation for this.
Also, I wonder why we don't take the bounds for the rotation angle of SE(2) here. @gilwoolee Do we have a reason not to do so?
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.
@jslee02 was this documented somewhere? I don't seem to see it.
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.
Never mind, found it!
src/distance/SE2.cpp
Outdated
const aikido::statespace::StateSpace::State* _state1, | ||
const aikido::statespace::StateSpace::State* _state2) const | ||
{ | ||
Eigen::VectorXd tangent1; |
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.
Should these be Vector3d
?
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.
VectorXd
is correct here. logMap
, which is a virtual function of StateSpace
, takes VectorXd
and resize it if needed.
👍 If we merge this without those great changes, then it would be less great to add issues to track this issues. 😄 |
@@ -29,7 +29,7 @@ class MotionValidatorTest : public ::testing::Test | |||
std::make_shared<MockTranslationalRobotConstraint>( | |||
stateSpace, Eigen::Vector3d(-0.1, -0.1, -0.1), | |||
Eigen::Vector3d(0.1, 0.1, 0.1)); | |||
auto vchecker = | |||
::ompl::base::StateValidityCheckerPtr vchecker = |
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.
@jslee02 not specifying explicitly the type was resulting in a build error due to ambiguity of the variable type, between StateValidityCheckerPtr
and StateValidityCheckerFn
. I thought you might want to confirm this change.
Introduced the weighted norm and added tests. Please do review. Thanks! |
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.
@aditya-vk Thanks for adding the tests.
I've made some style fixes and one minor but the necessary fix in computing SE2 distance (see the comment below).
As we have two distance metric classes, I would like to suggest changing the name of Weighted
class to something like CartesianProductWeighted
. For the backward compatibility, we could also alias Weighted
to the new class name with a warning when a user tries to use Weighted
.
To do this:
(1) create CartesianProductWeighted.hpp/cpp
files and move class Weighted
to them renaming the class name
(2) remove Weighted.cpp
(3) remove the original code in Weighted.hpp
and alias Weighted
to CartesianProductWeighted
(4) add the warning preprocessor directive #warning Weighted is deprecated. Please use CartesianProductWeighted instead by including CartesianProductWeighted.hpp
.
src/distance/SE2Weighted.cpp
Outdated
if (angularDistance > M_PI) | ||
{ | ||
angularDistance -= 2.0 * M_PI; | ||
angularDistance = -angularDistance; |
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.
@aditya-vk I added this line to make angularDistance
to be always positive. Previously, angluarDistance
could be negative if we get in this if-statement.
Unrelated issue: It seems the Travis tests on ubuntu isn't working due to |
@aditya-vk After I changed the logic of |
src/distance/SE2Weighted.cpp
Outdated
angularDistance -= 2.0 * M_PI; | ||
angularDistance = -angularDistance; | ||
} | ||
angularDistance = 2*M_PI - angularDistance; |
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.
@jslee02 thanks for the change! Simplified it into a single statement.
@@ -24,7 +24,7 @@ class SE2BoxConstraintTests : public ::testing::Test | |||
static constexpr size_t NUM_X_TARGETS { 10 }; | |||
static constexpr size_t NUM_Y_TARGETS { 10 }; | |||
static constexpr size_t NUM_SAMPLES { 1000 }; | |||
static constexpr double DISTANCE_THRESHOLD { 0.15 }; | |||
static constexpr double DISTANCE_THRESHOLD { 0.8 }; |
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.
@jslee02 For the number of samples taken and the resolution, the maximum distance between a sample and a target in this case is ~0.74. increasing the threshold to 0.8 is sensible in my opinion.
@jslee02 I agree, the Weighted class needs to be renamed. Pushed the relevant changes and issued a warning message suggesting using the new class, in the |
include/aikido/distance/Weighted.hpp
Outdated
|
||
} // namespace distance | ||
} // namespace aikido | ||
#warning Weighted is deprecated. Please use CartesianProductWeighted instead by including "CartesianProductWeighted". | ||
|
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.
Please add using Weighted = CartesianProductWeighted
.
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.
LGTM! 👍
This PR adds:
SE2BoxConstraint
which isTestable
,Sampleable
, andProjectable
.JoinStateSpaceHelpers-Impl.hpp
so that dart's SE2 joints with x, y constraints can use be tested, sampled, and projected.distance::SE2
which takes l2 norm of (dx, dy, dw). (Happy to take other suggestions too.)To be consistent with SO2 and SO3 samplers, this does not allow limit on rotational joint, but only on x, y dimensions.
This change is