-
Notifications
You must be signed in to change notification settings - Fork 938
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
Integration test to defend subframe tutorial (and bugfix for subframes of attached collision objects) #1757
Integration test to defend subframe tutorial (and bugfix for subframes of attached collision objects) #1757
Conversation
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.
Really glad we're improving the test coverage!!
37f8c2d
to
5551a33
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.
Thanks for doing the test I should have had in my PR to start with!
The testAtSubframe
function seems very specialized and I found it pretty hard to read. It seemed like a lot of lines are spent getting the subframe pose for each object in different ways and with different variable names. I think a function getSubframePoseInWorld(subframe, psi, group)
would have made it a lot clearer. If you have any cycles left I think this would be a good exercise and good for the code. Otherwise just correcting the comments/bugs will be fine.
Thanks again!
@felixvd I'm not sure how this passed locally for me. It looks like even with the huge margin (0.1) I didn't get close enough with the math. I'll revisit this and address your feedback this next week when I have time. Thank you for the review. |
892228f
to
42999b5
Compare
@felixvd I'm sorry this took me a while to get around to. I responded to your feedback and I believe this is now in a much better state. Please review (assuming it passes CI). |
This doesn't pass on kinetic. Is there a chance subframes isn't backported or something similar? |
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 for iterating on this. But somehow I feel like this is now a lot longer and more complex.
The logic of searching subframes and applying transforms should not be reimplemented in this test – you can just use planning_scene::getFrameTransform. Reimplementing it here would only hide issues in the codebase.
Also, the functions getCylinderTipInWorld
, getBoxSubframeInWorld
and getTargetInWorld
seem redundant. Why not simply confirm that the code below doesn't produce an error or null pointer?
Eigen::Isometry3d tip_in_world = planning_scene.getFrameTransform("cylinder/tip");
Eigen::Isometry3d box_subframe_in_world = planning_scene.getFrameTransform("box/" + subframe_name);
Eigen::Isometry3d target_in_world = planning_scene.getFrameTransform("box/" + target_subframe_name);
Lastly, please confirm the rotation as well. I suggested a way to implement it and some code.
Thanks again!
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.
@felixvd thank you for your patience with me on this one. I am new to the moveit codebase and still don't know the quick way to do things. I will ask around but I'm unsure how to get a PlanningScene
from the MoveGroupInterface
or PlanningSceneInterace
. I have found some things saying I should create a PlanningSceneMonitor
. I will ask around and update here if I figure it out.
@tylerjw let's get this merged in :-) |
e372f9e
to
8f871a4
Compare
@mlautman I got the psm to work as expected. Now I'm actually having some weird issue with subframes. Here is the debug output (getFrameTransform translations), the values in cylinder_tip look wrong, however box_subframe seem reasonable:
@felixvd do you see what I'm doing wrong here? |
For more debugging here is the planning scene message representation of
|
Based on what I posted above, I think there might be a bug in how |
d1041e6
to
cfa5b10
Compare
Before you ask, I rebased on master and pushed. Did not change the results. |
To run the test use this command after sourcing your workspace and building with the
|
b8ee81c
to
384563b
Compare
Sadness, this failed on line 259 of the test for clang only (but passed for gcc). Any ideas why that would be? Here is a link to the test that failed: https://travis-ci.org/github/ros-planning/moveit/jobs/667472631?utm_medium=notification&utm_source=github_status Somehow travis is failing to report it's status on this one, weird. |
4d2f2b2
to
529e929
Compare
rebased on master to see if that'd kick travis integration into working here. Didn't work, it still just shows "expected" below for me. Here is the travis run: https://travis-ci.org/github/ros-planning/moveit/builds/667849848 |
Codecov Report
@@ Coverage Diff @@
## master #1757 +/- ##
==========================================
+ Coverage 49.98% 51.77% +1.78%
==========================================
Files 315 319 +4
Lines 24776 25000 +224
==========================================
+ Hits 12384 12943 +559
+ Misses 12392 12057 -335
Continue to review full report at Codecov.
|
It looks like this is a flaky test (as it failed on one of the other tests this time). @rhaschke do you have any ideas on how to make this less flaky and yet still test the behavior of the tutorial and subframes? Here is the output of the one that failed:
Those look to be really cose to me in translation (I can't intuit the rotation portion). Is there a chance I could reduce EPSILON to something not so strict and this would be more robust and still be a good test? |
Once again, travis doesn't seem to be syncing with github here, but this latest one passed on all tests. |
We need to investigate this flaky test in more detail. The orientation should match as well! |
Putting epsilon back to 1e-3 (1mm) I can get it to fail locally after running the test a dozen or so times. Here is what the robot looks like when it failed (I'd post one of success but it looks the same to me): Here is the output from the console:
For comparison this is a success:
Can someone who knows more about the math of a rotation matrix see if they can understand what is happening wrong here? @AndyZe @rhaschke |
I wrote a bit of python to compare the failing and passing difference between the box and cylinder subframes and this is the result:
Note that some of this difference is expected as the comparison is actually between (box_subframe * target_pose) and the cylinder tip pose to account for the target pose offset. If you look at just the orders of magnitude of the diffs there is only one that differs from e-3 to e-4. I honestly can't tell a difference between passing and failing transforms, they both look really similar to me. |
My suggestion is we relax the requirement of epsilon to account for small differences in the ending pose from 1mm to 1cm. I can't get it to fail locally at 1cm. I don't think is actually a flaky test, I think we were just testing the result of a motion plan too finely. |
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 didn't notice that the printed target frame was different from the evaluated one, resulting in strong deviations of the rotation parts. I think, when the fix below is applied and we stick with 1cm resolution, this is ready for merging.
Co-Authored-By: Robert Haschke <rhaschke@users.noreply.github.com>
done @rhaschke |
Thanks to both of you for cleaning up after this :) |
Congratulations @tylerjw on seeing this through to the merge! :) |
Just stumbled on this. Should we add catkin_package(
INCLUDE_DIRS
${THIS_PACKAGE_INCLUDE_DIRS}
LIBRARIES
moveit_exceptions
# more here ...
${OCTOMAP_LIBRARIES}
CATKIN_DEPENDS
eigen_stl_containers
eigen_conversions # <=============== should we add this ???
geometric_shapes
geometry_msgs
kdl_parser
moveit_msgs
octomap_msgs
random_numbers
sensor_msgs
shape_msgs
srdfdom
std_msgs
tf2_eigen
tf2_geometry_msgs
trajectory_msgs
visualization_msgs
DEPENDS
Boost
# more here ...
${BULLET_ENABLE}
) |
@poweic, what kind of issue did you observe? |
Description
Issue: #1733
This PR is an integration test for the subframe tutorial that tests that the tutorial continues to work.
Future work:
Thank you @jaas14 for helping me write this.