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

Don't default to random algorithm if no plugin is defined #2228

Merged
merged 5 commits into from Jun 15, 2023

Conversation

sjahr
Copy link
Contributor

@sjahr sjahr commented Jun 6, 2023

Description

Currently, if planner_plugin_name_.empty() & multiple planner plugin classes are defined, we default to the first one (In many cases that is CHOMP because the elements seem to be alphabetically ordered 🤷 ). This PR changes that to throw in case no planner plugin name is defined and multiple options are available because it is more useful to throw here rather than loading a random pipeline.

Also, I added throw statements at the end of the plugin lib exception catch blocks to propagate the exception upwards. Please correct me if that is not correct.

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

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (8e48329) 50.50% compared to head (6fe601f) 50.50%.

❗ Current head 6fe601f differs from pull request most recent head 2342de1. Consider uploading reports for the commit 2342de1 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2228   +/-   ##
=======================================
  Coverage   50.50%   50.50%           
=======================================
  Files         386      386           
  Lines       31730    31730           
=======================================
  Hits        16022    16022           
  Misses      15708    15708           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

"Multiple planning plugins available. You should specify the '~planning_plugin' parameter. Using '%s' for "
"now.",
planner_plugin_name_.c_str());
if (classes.size() == 1)
Copy link
Member

Choose a reason for hiding this comment

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

I think that this is a really weird edge case. Reacting to what a use might or might not have installed selectively just asks for hard to reproduce issues. Let's just focus on these options: A) we have a non-empty and valid plugin name and B) we don't. Everything else is a config issue that we should push "up" in the abstraction layer.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

I agree with throwing these exceptions early. But please consider making this code even simpler by failing in more predictable ways (planning plugin name is not valid)

@sjahr sjahr requested a review from henningkayser June 12, 2023 13:56
@sjahr sjahr force-pushed the pr-change_planning_pipeline_default_behavior branch from c79db30 to 6340675 Compare June 12, 2023 13:57
@@ -194,6 +196,10 @@ void planning_pipeline::PlanningPipeline::configure()
}
}
}
else
{
RCLCPP_INFO(LOGGER, "No planning request adapter names specified.");
Copy link
Contributor

@MarqRazz MarqRazz Jun 15, 2023

Choose a reason for hiding this comment

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

This seems like it should be a warning or error. Is it valid to load MoveIt without any adapters specified?

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 thought about this too and concluded that it is not necessarily something invalid. If you have a super fancy planning plugin that generates a full motion plan response and that is robust without any pre-processing: Go for it. Nonetheless, I think this INFO print statement is nice to have because none of our existing planning plugins can do this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think WARN sounds like it fits better because as you stated we don't have any planning plugins that can perform an end to end solution.

Copy link
Contributor

@MarqRazz MarqRazz left a comment

Choose a reason for hiding this comment

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

Not going to block on the message severity. Everything else looks good.

@sjahr sjahr enabled auto-merge (squash) June 15, 2023 15:19
@sjahr sjahr merged commit b079db8 into moveit:main Jun 15, 2023
6 of 7 checks passed
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

3 participants