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

Draft: OMPL Planner Refactor #138

Open
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

marip8
Copy link
Contributor

@marip8 marip8 commented Nov 23, 2021

This PR introduces new interfaces for waypoint, composite, and planner profiles to support a refactor of the motion planners. The OMPL motion planner was also updated to utilize the new profile definitions.

This PR implements a refactor of the OMPL motion planner based on changes from #156 and #157

To-do

  • Understand why JointStartCartesianGoal unit test fails (currently produces only 1 valid OMPL goal state)
    • The IK solution for the goal state seemed to be too close to the collision wall separating the start/end states such that the solution itself was not in collision but it prevented valid samples from being generated. The IK solution was not equivalent to the joint state used to create the Cartesian pose because the KDL IK solver resolved the 7th joint to a different value. Spacing the nominal start/goal poses further away from the collision wall solved the issue
  • Cast data object to ompl::base::SimpleSetup if it is not a nullptr
  • Cast data object to ompl::base::PlannerData if it is not nullptr; save response.data as ompl::base::PlannerData for use with future planners or external graph search algorithms
  • Decide which instructions to extract planner and composite profiles from
  • Consolidate return instruction to be a single composite where the start move is in the start instruction of the composite
  • Accept input composite instructions with more than one waypoint and plan trajectories in series
    • Need to decide how parameters like maximum planning time apply for this strategy
  • Implement waypoint profiles for generating the start and goal states
  • Test with demos

To-do in future PRs

  • Rename from OMPL planner "configurator" to "factory" or "allocator"
  • Add an override method for construction OMPL planners with ompl::base::PlannerData
    • This is only valid for multi-query planners like the PRM variants
    • If a planner doesn't support construction from ompl::base::PlannerData itself, it also has a pointer to the SpaceInformation which could be used to construct the planner
  • Add a pointer to an ompl::base::PlannerData (or a file from which to load one using ompl::base::PlannerDataStorage) to the multi-query planner factories
  • Consider creating an OMPL WaypointProfile that leverages OMPL goal sampling

@marip8 marip8 force-pushed the refactor/planner-interface branch from 07e6569 to 705ab7e Compare November 23, 2021 23:21
…omposite, and planner profiles in profile dictionary
@marip8 marip8 force-pushed the refactor/planner-interface branch from f769fcd to 638416a Compare January 8, 2022 01:57
@marip8 marip8 changed the title WIP: New Profile Interfaces and OMPL Planner Refactor OMPL Planner Refactor Jan 8, 2022
@marip8
Copy link
Contributor Author

marip8 commented Jan 8, 2022

@Levi-Armstrong I think this is ready for review. The unit tests pass (locally), and I'm working on visualizing the freespace example to confirm proper behavior

@Levi-Armstrong
Copy link
Contributor

It looks like several of the process planner units are now failing.

@marip8
Copy link
Contributor Author

marip8 commented Jan 8, 2022

I think the process planner unit tests are failing because no default profiles were added to the new profile dictionary maps for the OMPL planner. I'll look into it. Strange that the Windows build succeeds. Does it not run unit tests?

@Levi-Armstrong
Copy link
Contributor

Yea it does not run the unit test on the windows build. It just makes sure everything build. A few were segfaulting which I believe it's due to trying to write to temp directory.

@marip8 marip8 force-pushed the refactor/planner-interface branch 2 times, most recently from 309f2f8 to 52a6ae6 Compare January 9, 2022 21:51
@codecov
Copy link

codecov bot commented Jan 9, 2022

Codecov Report

Merging #138 (e7900e7) into master (31afa29) will decrease coverage by 4.97%.
The diff coverage is 83.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #138      +/-   ##
==========================================
- Coverage   66.30%   61.32%   -4.98%     
==========================================
  Files         199      200       +1     
  Lines        9407     9102     -305     
==========================================
- Hits         6237     5582     -655     
- Misses       3170     3520     +350     
Impacted Files Coverage Δ
...tesseract_command_language/composite_instruction.h 100.00% <ø> (ø)
...act_command_language/utils/get_instruction_utils.h 51.28% <ø> (ø)
...act_command_language/src/composite_instruction.cpp 52.12% <0.00%> (+5.38%) ⬆️
...planners/ompl/weighted_real_vector_state_sampler.h 100.00% <ø> (ø)
tesseract_motion_planners/ompl/src/utils.cpp 58.62% <ø> (-3.88%) ⬇️
...ct_process_managers/core/process_planning_server.h 100.00% <ø> (ø)
...de/tesseract_command_language/profile_dictionary.h 85.89% <58.33%> (-12.26%) ⬇️
...mmand_language/src/utils/get_instruction_utils.cpp 42.20% <66.66%> (+42.20%) ⬆️
...s/ompl/src/profile/ompl_composite_profile_rvss.cpp 72.22% <72.22%> (ø)
...eract_command_language/src/utils/flatten_utils.cpp 55.71% <75.00%> (ø)
... and 27 more

@marip8 marip8 force-pushed the refactor/planner-interface branch 2 times, most recently from 34ab66b to 82662fc Compare January 10, 2022 01:13
@marip8 marip8 force-pushed the refactor/planner-interface branch from 82662fc to e7900e7 Compare January 10, 2022 01:18
@marip8
Copy link
Contributor Author

marip8 commented Jan 10, 2022

I resolved the issue with the unit tests, and I was able to successfully run the examples in this repository (and tesseract_ros_examples with a few minor changes). It looks like code coverage fails, presumably because of the few functions that I added to the profile dictionary to support this. I could add a unit test for this capability in this PR, but I think the idea is that we would eventually replace the existing profile dictionary with the new implementation once all the planners are updated. I would propose holding off on making those unit tests until we are ready to finish the profile dictionary

@marip8 marip8 changed the title OMPL Planner Refactor Draft: OMPL Planner Refactor Apr 14, 2022
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.

2 participants