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 parameter api integration test #2662

Merged
merged 20 commits into from
Feb 13, 2024
Merged

Conversation

sjahr
Copy link
Contributor

@sjahr sjahr commented Jan 26, 2024

Description

Unittest to check if all parameters are correctly loaded when a move_group is launched

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

codecov bot commented Jan 26, 2024

Codecov Report

Attention: 121 lines in your changes are missing coverage. Please review.

Comparison is base (d962501) 50.74% compared to head (7f3072d) 43.03%.
Report is 9 commits behind head on main.

Files Patch % Lines
...it_core/robot_state/test/robot_state_benchmark.cpp 0.00% 91 Missing ⚠️
...default_capabilities/get_group_urdf_capability.cpp 0.00% 23 Missing ⚠️
moveit_ros/tests/src/move_group_api_test.cpp 88.47% 3 Missing ⚠️
.../rdf_loader/include/moveit/rdf_loader/rdf_loader.h 0.00% 2 Missing ⚠️
...py/src/moveit/moveit_ros/moveit_cpp/moveit_cpp.cpp 0.00% 1 Missing ⚠️
...nning_scene_monitor/src/planning_scene_monitor.cpp 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2662      +/-   ##
==========================================
- Coverage   50.74%   43.03%   -7.71%     
==========================================
  Files         392      692     +300     
  Lines       32553    56297   +23744     
  Branches        0     7273    +7273     
==========================================
+ Hits        16517    24219    +7702     
- Misses      16036    31913   +15877     
- Partials        0      165     +165     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjahr sjahr force-pushed the pr-add_param_api_unittest branch from 5ab2966 to c3d3c8b Compare January 28, 2024 16:58
@sjahr sjahr marked this pull request as ready for review January 28, 2024 16:58
@sjahr sjahr self-assigned this Jan 28, 2024
@@ -43,6 +43,9 @@
<test_depend>moveit_resources_panda_moveit_config</test_depend>
<test_depend>moveit_simple_controller_manager</test_depend>
<test_depend>moveit_planners_ompl</test_depend>
<test_depend>moveit_planners_chomp</test_depend>
<test_depend>moveit_planners_stomp</test_depend>
<test_depend>pilz_industrial_motion_planner</test_depend>
Copy link
Member

Choose a reason for hiding this comment

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

so this adds a circular test dependency, even though the planning interface is not listed here. I think we should have a higher-level package for running integration tests for that purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the test into its own package. At the moment it is part of moveit_ros but we can move it somewhere else too

@sjahr sjahr changed the title Add parameter api unittest Add parameter api integration test Feb 5, 2024
@sjahr sjahr requested a review from henningkayser February 5, 2024 10:42
for (const auto& param_name : move_group_test::PARAMETER_NAME_LIST)
{
bool param_exists = false;
if (params_client->wait_for_service(std::chrono::seconds(1)))
Copy link
Member

Choose a reason for hiding this comment

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

Is this going to cause it to wait 1 second for each parameter in the case where this fails? That will make this test take forever. You already have this outside the for loop so maybe consider dropping it here and assume that if we've connected before to the parameter client we are connected here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've experienced issues when I did not use this. My guess is that the other node couldn't handle getting so many service requests in little time. This fixes this as we're waiting for the service node to be ready to handle a request once it has answered another one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's try if the test still works if we drastically decrease the time

Copy link
Member

Choose a reason for hiding this comment

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

Looking at the API it of the parameter thing it looks like we could ask for multiple parameters at once. Maybe it makes sense to just ask for all of them in one shot?

for (const auto& param_name : move_group_test::PARAMETER_NAME_LIST)
{
bool param_exists = false;
if (params_client->wait_for_service(std::chrono::seconds(0.1)))
Copy link
Member

Choose a reason for hiding this comment

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

It seems that if this were to fail each parameter would cause a 1 second wait making this test take a long time. You already checked that the service is connected above.

Copy link

mergify bot commented Feb 13, 2024

This pull request is in conflict. Could you fix it @sjahr?

@sjahr sjahr force-pushed the pr-add_param_api_unittest branch from 2e3f19c to b197f9d Compare February 13, 2024 17:25
@sjahr sjahr requested a review from tylerjw February 13, 2024 17:26
@tylerjw tylerjw merged commit e9b214c into moveit:main Feb 13, 2024
11 of 12 checks passed
@tylerjw tylerjw deleted the pr-add_param_api_unittest branch February 13, 2024 17:54
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.

3 participants