-
Notifications
You must be signed in to change notification settings - Fork 957
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
Allow user to specify planner termination condition. #1695
Conversation
…er instances and their parameters via config file
Repeating Robert's comment in #1686, is it (easily) possible to |
…older versions of MoveIt
I added an OMPL version check for backwards compatibility. This feature should probably be documented somewhere. Where? |
I cannot verify compatibility with released OMPL. Generally looks good to me. Please fix the compiler warning disturbing Travis. |
@henningkayser can you approve & merge? I need this to add your multi query planner support that touches some of the same code. |
moveit_planners/ompl/ompl_interface/src/model_based_planning_context.cpp
Show resolved
Hide resolved
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.
LGTM. Some documentation, either in the header or in a tutorial would help (not sure if there's a open PR for that already).
@@ -317,6 +317,8 @@ class ModelBasedPlanningContext : public planning_interface::PlanningContext | |||
virtual ob::StateSamplerPtr allocPathConstrainedSampler(const ompl::base::StateSpace* ss) const; | |||
virtual void useConfig(); | |||
virtual ob::GoalPtr constructGoal(); | |||
virtual ob::PlannerTerminationCondition constructPlannerTerminationCondition(double timeout, |
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'd add documentation here, with what params the functions looks at (the spec's "termination condition"), and what it expects/ generates.
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.
Done.
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.
Beautiful documentation! Can you copy it to https://ros-planning.github.io/moveit_tutorials/doc/ompl_interface/ompl_interface_tutorial.html also?
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.
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.
Looking good!
@@ -317,6 +317,8 @@ class ModelBasedPlanningContext : public planning_interface::PlanningContext | |||
virtual ob::StateSamplerPtr allocPathConstrainedSampler(const ompl::base::StateSpace* ss) const; | |||
virtual void useConfig(); | |||
virtual ob::GoalPtr constructGoal(); | |||
virtual ob::PlannerTerminationCondition constructPlannerTerminationCondition(double timeout, |
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.
Beautiful documentation! Can you copy it to https://ros-planning.github.io/moveit_tutorials/doc/ompl_interface/ompl_interface_tutorial.html also?
moveit_planners/ompl/ompl_interface/src/model_based_planning_context.cpp
Show resolved
Hide resolved
ompl::base::PlannerTerminationCondition ompl_interface::ModelBasedPlanningContext::constructPlannerTerminationCondition( | ||
double timeout, const ompl::time::point& start) | ||
{ | ||
auto it = spec_.config_.find("termination_condition"); |
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.
Add code to the setup assistant to add this feature to the OMPL outputOMPLPlanningYAML()
config file:
https://github.com/ros-planning/moveit/blob/master/moveit_setup_assistant/src/tools/moveit_config_data.cpp#L206
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.
It's an advanced, optional setting. Like optimization_objective
it typically doesn't get set explicitly.
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.
Fair, as long as its in the tutorials
moveit_planners/ompl/ompl_interface/src/model_based_planning_context.cpp
Show resolved
Hide resolved
…c and older has been dropped
#include <ompl/base/samplers/UniformValidStateSampler.h> | ||
#include <ompl/base/goals/GoalLazySamples.h> | ||
#include <ompl/tools/config/SelfConfig.h> | ||
#include <ompl/base/spaces/SE3StateSpace.h> | ||
#include <ompl/datastructures/PDF.h> | ||
// \todo remove when ROS Melodic and older are no longer supported |
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.
// \todo remove when ROS Melodic and older are no longer supported | |
// TODO(mamoll) remove when ROS Melodic and older are no longer supported |
Small style standard that wasnt documented. Now it is:
https://github.com/ros-planning/moveit.ros.org/pull/379/files
ompl::base::PlannerTerminationCondition ompl_interface::ModelBasedPlanningContext::constructPlannerTerminationCondition( | ||
double timeout, const ompl::time::point& start) | ||
{ | ||
auto it = spec_.config_.find("termination_condition"); |
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.
Fair, as long as its in the tutorials
Description
It adds the ability to specify planner termination conditions in the ompl_planning.yaml file. It is mostly useful for optimizing/anytime planners, since it allows you to let them terminate before the timeout occurs (using either the CostConvergence or ExactSolution termination condition) and testing purposes (running for a fixed number of iterations). The default behavior doesn't change.
Checklist