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 test to ompl interface for StateValidityChecker #2247

Merged
merged 9 commits into from
Oct 26, 2020

Conversation

JeroenDM
Copy link
Contributor

Description

I added some minimal tests for the ompl_interface::StateValidityChecker. My intend is to better understand how all the pieces fit together, not necessarily thorough testing of this class.

The test uses a new generic test class to make it easy to run the same test on several robots. (See the documentation in the code.) Addmiditly it might come across as a bit overengineered, but I plan to use this for other tests in the future.

As mentioned in the comment, I could simplify it by using rostest and passing robot specific setup over the parameter server. But these tests would run slower and as this package is outside moveit_ros (so ideally ROS independent I guess).

Or is there a better way?

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

Copy link
Contributor

@mamoll mamoll left a 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.

@JeroenDM JeroenDM requested a review from mamoll August 12, 2020 11:58
@JeroenDM
Copy link
Contributor Author

@mamoll The tests with path constraints just started working today. It must have been some issue with my local environment, although I have no idea what caused the issue. But if the tests also succeed on Travis I will take that as proof that it was my local environment.

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #2247 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2247   +/-   ##
=======================================
  Coverage   56.38%   56.38%           
=======================================
  Files         287      287           
  Lines       24451    24451           
=======================================
  Hits        13785    13785           
  Misses      10666    10666           
Impacted Files Coverage Δ
.../ompl_interface/src/detail/constrained_sampler.cpp 42.86% <0.00%> (-17.14%) ⬇️
...meterization/work_space/pose_model_state_space.cpp 83.09% <0.00%> (-1.47%) ⬇️
moveit_core/robot_state/src/robot_state.cpp 46.03% <0.00%> (+0.11%) ⬆️
...raint_samplers/src/default_constraint_samplers.cpp 81.89% <0.00%> (+0.37%) ⬆️
...dl_kinematics_plugin/src/kdl_kinematics_plugin.cpp 76.55% <0.00%> (+0.45%) ⬆️
...on/pick_place/src/approach_and_translate_stage.cpp 72.96% <0.00%> (+0.82%) ⬆️
...pl_interface/src/detail/state_validity_checker.cpp 44.12% <0.00%> (+5.89%) ⬆️

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 144adb7...071a835. Read the comment docs.

Comment on lines 63 to 66
/** \brief Use this flag to turn on extra output on std::cout for debugging. **/
constexpr bool VERBOSE{ false };
Copy link
Member

Choose a reason for hiding this comment

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

Why not use ROS logging macros and setting them to output DEBUG with a namespace for this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True! It's an old habit from when I didn't bother setting up my ROS debug levels correctly... I will fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I will change the log statements, but I also use it to set the verbosity of the state validity checker

checker->setVerbose(VERBOSE);

which in turn is passed on to the collision request. Maybe I can make it an optional command-line argument for the test. The verbose output from the collision checker can be really useful when debugging. I can also set it to true by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Talking about "minor" patches, it's really annoying that we can't specify arbitrary output streams for these methods. :-)

@JeroenDM JeroenDM force-pushed the add-state-validity-checker-test branch from 4984d0f to 0fdb435 Compare August 28, 2020 10:20
@JeroenDM JeroenDM closed this Sep 8, 2020
@JeroenDM JeroenDM reopened this Sep 8, 2020
@JeroenDM JeroenDM force-pushed the add-state-validity-checker-test branch from 173a0c8 to c73370e Compare September 8, 2020 07:57
@JeroenDM
Copy link
Contributor Author

JeroenDM commented Sep 8, 2020

I think this is ready to be merged after another review.
Then I can rebase #2248 (which reuses some of the code) and finish it.

@mamoll
Copy link
Contributor

mamoll commented Sep 8, 2020

This looks ready to be merged to me. @tylerjw / @v4hn, can one of you review one more time?

@JeroenDM
Copy link
Contributor Author

JeroenDM commented Sep 9, 2020

I just noticed I did not add the new test dependencies to the package.xml file, as this needs to be done for every test robot separately since recently.

<test_depend>moveit_resources_fanuc_description</test_depend>
<test_depend>moveit_resources_panda_description</test_depend>

Copy link
Member

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

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

Thank you for updating this. I made a couple comments about a minor nit but overall I think this test looks really good so I'm aproving it to make it easy to merge.

@JeroenDM
Copy link
Contributor Author

@tylerjw @mamoll I applied the last suggestions. This should be good to go now if CI says it's ok.

@JeroenDM JeroenDM force-pushed the add-state-validity-checker-test branch from 2032c2d to 14bd736 Compare October 19, 2020 07:55
@JeroenDM
Copy link
Contributor Author

@mamoll ping

@mamoll mamoll merged commit 225cb77 into moveit:master Oct 26, 2020
@JeroenDM
Copy link
Contributor Author

thanks!

@JeroenDM JeroenDM deleted the add-state-validity-checker-test branch January 9, 2021 09:07
@tylerjw tylerjw mentioned this pull request Apr 9, 2021
@tylerjw tylerjw mentioned this pull request Apr 29, 2021
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

4 participants