Skip to content

Adding Planning Context Plugin Framework to OMPL Planning Plugin - #897

Closed
zkingston wants to merge 52 commits into
moveit:melodic-develfrom
KavrakiLab:feature/ompl_plugin
Closed

zkingston wants to merge 52 commits into
moveit:melodic-develfrom
KavrakiLab:feature/ompl_plugin

Conversation

@zkingston

@zkingston zkingston commented May 15, 2018 •

Copy link
Copy Markdown
Contributor

Description

Fixes #117 by adding a plugin framework to easily incorporate adding new OMPL-based planning contexts without having to recompile the moveit_planners_ompl plugin.

The new interface works with existing ompl_planning.yaml files. You can simply extend the .yaml planner specification to specify the plugin where the ompl_interface::PlannerContextManager can create the planning context for the given planner.

Here is an example ompl_planning.yaml that points out the new feature:

planner_configs:
  RRT_Default:
    plugin: ompl_interface/ModelBasedPlanningContext  # This line was added. This is the fully-qualified name of the plugin. ModelBasedPlanningContext is the default option.
    type: geometric::RRT
    range: 0.0
    goal_bias: 0.05
  RRTConnect_Pose:
    plugin: ompl_interface/PoseModelBasedPlanningContext  # This line was added. Here, we specify a planning context plugin that uses the PoseModelBasedStateSpace always.
    type: geometric::RRTConnect
    range: 0.0
  RRTConnect_Default: # Note that no line needs to be added, and the ModelBasedPlanningContext will be used by default.
    type: geometric::RRTConnect
    range: 0.0

Additionally, the setup assistant has been modified to output the default plugin in the configuration file (plugin: ompl_interface/ModelBasedPlanningContext).

The interface is plugin centric, where the planning context is responsible for the majority of its own configuration. New plugins must derive from ompl_interface::OMPLPlanningContext. For standard geometric planning, it is possible to derive from the existing ompl_interface::ModelBasedPlanningContext class and simply configure your new planner. By default, there are three plugins provided:

  1. ompl_interface/ModelBasedPlanningContext: The default planning context that was used before adding the plugin framework.
  2. ompl_interface/JointModelBasedPlanningContext: A planning context that is ompl_interface::ModelBasedPlanningContext but will always choose JointModelBasedStateSpace.
  3. ompl_interface/PoseModelBasedPlanningContext: A planning context that is ompl_interface::ModelBasedPlanningContext but will always choose PoseModelBasedStateSpace.

Note that the addition of plugins 2 & 3 removes the need for #541 (whose features are still implemented in plugin 1), and is left to not break existing API. With the plugin framework, you can simply specify plugin: ompl_interface/JointModelBasedPlanningContext in the planner configuration for the same effect.

Additionally, the ModelBasedStateSpace has been updated to inherit from OMPL's RealVectorStateSpace. This enables a few of the newer planners in OMPL to work with MoveIt, such as BIT* and Informed RRT*, which are both added to ModelBasedPlanningContext and to the setup assistant. This fixes #615.

See https://github.com/KavrakiLab/moveit/pull/1 for some prior discussion, and https://github.com/KavrakiLab/moveit_ompl_planning_interface for the original plugin this pull request was inspired from.

Checklist

  • Required: Code is auto formatted using clang-format
  • Extended the tutorials / documentation, if necessary reference

zkingston added 29 commits May 25, 2018 10:32

@davetcoleman davetcoleman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we split this into two PRs please? The current PR is enormous and hard to test.

  • C++11 modernization and other cleanup
  • The plugin manager part?

Also are there any tests we can implement that ensure basic planning functionality has not changed before and after this PR?

"Flag indicating whether computed motion plans are also simplified", True)
gen.add("minimum_waypoint_count", int_t, 2,
"Set the minimum number of waypoints to include in a motion plan", 10, 2, 10000)
gen.add("max_solution_segment_length", double_t, 3,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is a change of api from "maximum_waypoint_distance", please at minimum document this in the CHANGELOG in the root of moveit

gen.add("minimum_waypoint_count", int_t, 2, "Set the minimum number of waypoints to include in a motion plan", 10, 2, 10000)
gen.add("maximum_waypoint_distance", double_t, 3, "The maximum distance between consecutive waypoints along the solution path (0.0 means 'ignore')", 0.0, 0.0, 50.0)
gen.add("link_for_exploration_tree", str_t, 4, "Show the exploration tree for a particular link", "")
gen.add("display_random_valid_states", bool_t, 5, "Flag indicating whether random valid states are to be published", False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

document in changelog why these two reconfig params have been removed

@@ -34,9 +34,8 @@

/* Author: Ioan Sucan */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I vote we remove this service - its unused in moveit anyway

bool sample(ompl::base::State* state) override;
virtual bool project(ompl::base::State* state);
virtual bool sampleNear(ompl::base::State* state, const ompl::base::State* near, const double distance);
bool sampleNear(ompl::base::State* state, const ompl::base::State* near, const double distance) override;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i assume you ran clang-tidy or clang-modernize on this package? could you do that in a preliminary PR first so that reviewing this one is much easier?

* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

changes like this should be in a first PR that doesn't change actual functionality

@davetcoleman

Copy link
Copy Markdown
Member

Remaining TODO:

  • Deleting the constraint library
  • Cleaning up dead code & minor re-org of header and source files
  • Plugin interface

@henningkayser

Copy link
Copy Markdown
Member

Can we split this into two PRs please? The current PR is enormous and hard to test.

@zkingston is this PR still being worked on or will it be replaced by a second PR after #990? Also, will you be able to continue it in the next time? It's really a great feature!

@BryceStevenWilley

Copy link
Copy Markdown
Contributor

@henningkayser I recently talked to @zkingston and I don't think he has the cycles to work on this anytime soon. I am interested in picking this up, but personally I won't be able to start working on it until early April.

@henningkayser

Copy link
Copy Markdown
Member

@henningkayser I recently talked to @zkingston and I don't think he has the cycles to work on this anytime soon. I am interested in picking this up, but personally I won't be able to start working on it until early April.

Nice, this is a huge effort! Do you want to keep this PR open in the meantime or would you rather create a new one for the second part?

@BryceStevenWilley

Copy link
Copy Markdown
Contributor

Given some recent usage of the constraint library, this PR would have to go through a rather large refactor to keep that library in. It's probably easier to close this for now.

@davetcoleman

Copy link
Copy Markdown
Member

Closing for now. Looking forward to seeing this picked up again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants