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

add tests for move_group interface #1995

Merged
merged 12 commits into from
Apr 8, 2020

Conversation

tylerjw
Copy link
Member

@tylerjw tylerjw commented Mar 28, 2020

Description

I realized there was no test of the c++ interface of move_group. This PR fixes that to defend the interface used by our newest users against unintended breakages.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Moves the CodeCov report in the right direction ⬆️ ⬆️ ⬆️

@codecov-io
Copy link

codecov-io commented Mar 28, 2020

Codecov Report

Merging #1995 into master will increase coverage by 2.20%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1995      +/-   ##
==========================================
+ Coverage   51.82%   54.02%   +2.20%     
==========================================
  Files         319      319              
  Lines       24959    24959              
==========================================
+ Hits        12934    13485     +551     
+ Misses      12025    11474     -551     
Impacted Files Coverage Δ
moveit_core/robot_state/src/robot_state.cpp 45.61% <0.00%> (+0.40%) ⬆️
moveit_core/robot_state/src/conversions.cpp 43.49% <0.00%> (+0.44%) ⬆️
...ution_manager/src/trajectory_execution_manager.cpp 46.86% <0.00%> (+0.51%) ⬆️
...mpl_interface/src/model_based_planning_context.cpp 58.55% <0.00%> (+0.53%) ⬆️
...raint_samplers/src/default_constraint_samplers.cpp 83.63% <0.00%> (+1.09%) ⬆️
...dl_kinematics_plugin/src/kdl_kinematics_plugin.cpp 78.92% <0.00%> (+1.34%) ⬆️
...anning_scene_monitor/src/current_state_monitor.cpp 52.82% <0.00%> (+1.53%) ⬆️
moveit_core/planning_scene/src/planning_scene.cpp 57.68% <0.00%> (+2.44%) ⬆️
...nning_scene_monitor/src/planning_scene_monitor.cpp 70.95% <0.00%> (+2.84%) ⬆️
...veit_core/robot_model/src/floating_joint_model.cpp 48.35% <0.00%> (+3.29%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d989220...528fb02. Read the comment docs.

@tylerjw tylerjw force-pushed the p/tylerjw/move_group_test branch 5 times, most recently from 8ff7563 to 3fff271 Compare March 29, 2020 00:51
@tylerjw
Copy link
Member Author

tylerjw commented Mar 29, 2020

I've tried rebasing this on earlier versions of master to get it past travis (failing unrelated tests) but gave up when I couldn't find a version where it doesn't fail on clang. I think this must be as a result of some external dependency changing. I created an issue for it here: #1996

The clang CI failure is unrelated (this new test passes).

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

Great work. Please try to avoid code duplication, but introduce functions instead.
This helps to increase code readability.

EXPECT_EQ(move_group_->getGoalPositionTolerance(), 0.0001);
EXPECT_EQ(move_group_->getGoalOrientationTolerance(), 0.001);

const std::vector<std::string> NAMED_TARGETS = { "ready", "extended" };
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests rely on specific details of panda_moveit_config.
Changing these details, e.g. adding more named targets, renaming joints, etc. will make this test fail for no reason.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changing parts of the panda_moveit_config could cause the tutorials to stop working. I'm not sure we need this level of testing on this. Would you like me to just drop this test?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to adapt the test such that only required prerequisites are validated.
Thus, if you need let's say the named target ready in your test, just test for its existence, but don't constrain the list of other named targets.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll update this test to still call those interfaces but loosen what it tests for to just what is needed for the tutorial to work.

@tylerjw
Copy link
Member Author

tylerjw commented Mar 31, 2020

This is currently failing one of the tests on travis, and is therefore WIP, I'll post here when I get it fully working again.

@tylerjw tylerjw changed the title add tests for move_group tutorials WIP: add tests for move_group tutorials Mar 31, 2020
@rhaschke
Copy link
Contributor

rhaschke commented Apr 1, 2020

Weird, that the bullet collision test are failing now. You just added a test, which should not affect other tests.

@tylerjw tylerjw force-pushed the p/tylerjw/move_group_test branch 2 times, most recently from 282fbf3 to a0be191 Compare April 3, 2020 19:59
@tylerjw tylerjw changed the title WIP: add tests for move_group tutorials add tests for move_group interface Apr 6, 2020
@tylerjw
Copy link
Member Author

tylerjw commented Apr 7, 2020

Rebased on master, this is ready for review again (assuming it passes CI) @v4hn and @rhaschke. Thank you for the reviews so far.

@tylerjw
Copy link
Member Author

tylerjw commented Apr 7, 2020

This succeeded on travis.

@tylerjw
Copy link
Member Author

tylerjw commented Apr 8, 2020

@v4hn Thank you for the review. CI is passing with my latest changes. I am ready for another pass on this.

Copy link
Contributor

@v4hn v4hn left a comment

Choose a reason for hiding this comment

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

CI succeeded, though it did not report back to github again. sigh

I'm happy with the current patch as is.

As @rhaschke also commented here before I will leave the final pass&merge to him or any other maintainer :)

I just saw @mlautman's approval a few days ago, so I'll merge right away.

Thanks again @tylerjw !

<arg name="allow_trajectory_execution" value="true"/>
<arg name="fake_execution" value="true"/>
<arg name="info" value="true"/>
</include>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a lot of redundancy in the launch files and the only reason why you did not use the demo.launch is because it does not include a flag to disable rviz.

I'm fine with merging this patch as-is, but maybe we want to have such a flag in the demo.launch in the future so that tests can just include that one?

@v4hn v4hn merged commit 9681f50 into moveit:master Apr 8, 2020
@tylerjw
Copy link
Member Author

tylerjw commented Apr 8, 2020

@v4hn thank you for the help getting this in. We are slowly making a dent in the code coverage.

@rhaschke
Copy link
Contributor

rhaschke commented Apr 8, 2020

Sorry, just noticed this now: Our test cases shouldn't use panda_moveit_config (see #1904).
@tylerjw, could you please replace this package with moveit_resources? The patch moveit/panda_moveit_config#63 should be applied there as well.

@v4hn
Copy link
Contributor

v4hn commented Apr 9, 2020

One more addendum: MoveIt's fake controllers support multiple simulation modes and it makes sense to have tests use different modes to avoid unnecessary runtimes.

For this test, I propose to set the types to 'last point', as you do not test the actual execution of the trajectory.

This should be achievable via

<param name="/move_group/controller_list[0]/type" value="last point"/>
<param name="/move_group/controller_list[1]/type" value="last point"/>

or

<rosparam param='move_group/controller_list'>[ { type: 'last point'}, { type: 'last point' }]</rosparam>

But the syntax to address individual list elements ([0]) does not work and the latter command overrides the rest of the yaml tree, removing the main controller configuration...

I just digged through the rosparam APIs and cannot find a way to set an individual ros parameter inside a list at all and this seems to go all the way down to xmlrpc, although one could probably write a cumbersome construct to parse this in rosparam and add a patch there grml.

Alternatively, we could allow a global default for the fake controllers to be set in /move_group/controller_list/type, but someone would have to write a patch for that too (assuming it does not work yet). 👀

@tylerjw tylerjw deleted the p/tylerjw/move_group_test branch April 9, 2020 16:09
@tylerjw tylerjw mentioned this pull request May 8, 2020
20 tasks
tylerjw added a commit to PickNikRobotics/moveit that referenced this pull request May 11, 2020
* add tests for move_group tutorials

* easier to reach joint positions for less flaky test

* allow more time for planning

* remove move to start pose

* reduce epsilon to 1e-5
tylerjw added a commit to PickNikRobotics/moveit that referenced this pull request May 12, 2020
* add tests for move_group tutorials

* easier to reach joint positions for less flaky test

* allow more time for planning

* remove move to start pose

* reduce epsilon to 1e-5
tylerjw added a commit to PickNikRobotics/moveit that referenced this pull request May 12, 2020
* add tests for move_group tutorials

* easier to reach joint positions for less flaky test

* allow more time for planning

* remove move to start pose

* reduce epsilon to 1e-5
tylerjw added a commit to PickNikRobotics/moveit that referenced this pull request May 13, 2020
* add tests for move_group tutorials

* easier to reach joint positions for less flaky test

* allow more time for planning

* remove move to start pose

* reduce epsilon to 1e-5
@v4hn v4hn mentioned this pull request May 20, 2020
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.

None yet

5 participants