-
Notifications
You must be signed in to change notification settings - Fork 90
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
Made Body::containsPoint() consistent in surface points inclusion. #90
Made Body::containsPoint() consistent in surface points inclusion. #90
Conversation
See #91 for context. |
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.
Thanks a lot. Some minor comments remain.
test/test_point_inclusion.cpp
Outdated
const double sq2 = sqrt(2) / 2; | ||
double sq2_eps = sq2; |
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.
Same here of course.
0b698b4
to
21b060e
Compare
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.
Looks good to me. One final request: Could you please squash the last two commits (bug fix + refactoring) into one. Then I propose a merge-commit to keep the clean history of this PR branch.
21b060e
to
c91ca1f
Compare
I squashed and force-pushed. I didn't quite get the part about merge commit - there seems to be nothing to merge... Or did you mean merge instead of force-push? |
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.
One more nitpick.
@@ -360,8 +373,10 @@ TEST(CylinderPointContainment, Basic) | |||
|
|||
// near two-axis maximum | |||
const double sq2 = sqrt(2) / 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.
Looks like sq2 is only used in a single location. Do you mind to use sq2_eps for this location too, thus allowing to rename s2_eps back to sq2. This way, the bugfix wouldn't require too many changes for the test.
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 is actually used at 2 locations: line 400 and 406. I wanted to use this "clean" value where it works, and only use sq2_eps at places which are really affected by IEEE 754 rounding errors. If you just don't like the name sq2_eps, I can try finding a new one :)
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.
Yeah, I don't like the name very much. But it don't have a better idea either. I'm not so strong on names ;-)
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 renamed sq2_eps
to sq2e
. Also, to keep consistency throughout the code, I renamed sq2
to sq2e
in the sphere test.
To merge this PR branch into its parent, github provides several options: explicit merge commit, rebase, or squash-rebase. To keep the history of your 3 commits (thanks a lot cleaning them up), I suggested the merge commit. |
Hmm, is this something new on github? I don't see any such setting in the PR options from my side. It looks to me like options for the one who is finally merging this PR, which is not me (I don't have commit access). Or do I miss a point? Should I create an explicit merge commit in my repo and then send a PR from my indigo-devel to upstream? |
Hope this helps to explain the different policies. |
Ok, got it. There's still an unanswered question in #90 (comment) . |
Sorry. Didn't noticed this one. Answered now. |
c91ca1f
to
f706072
Compare
test/test_point_inclusion.cpp
Outdated
EXPECT_TRUE( cylinder.containsPoint(Eigen::Vector3d(0.70, 0.70, 0.00))); | ||
EXPECT_SURF( cylinder.containsPoint(Eigen::Vector3d(sq2 , sq2 , 0.00))); | ||
EXPECT_SURF(cylinder.containsPoint(Eigen::Vector3d(sq2e , sq2e , 0))); |
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.
Better. Could you also restore the previous fixed number format: 0 -> 0.00
and clean spaces, commas, etc.
Your original code looked better in this regard. 😉
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.
Done.
f706072
to
a5121d0
Compare
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.
Great! Thanks for your patience.
Closing this in favor of #97. |
No description provided.