-
Notifications
You must be signed in to change notification settings - Fork 703
WIP: Tutorial on using OMPL's Constrained State Space #518
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
Open
JeroenDM
wants to merge
9
commits into
moveit:master
Choose a base branch
from
JeroenDM:ompl-constrained-planning-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e8d01ce
add first version ompl constrained planning tutorial
JeroenDM 84fa2bb
add animations and improve / fix text
JeroenDM 1fc7945
Catch interrupt when the user presses ctrl-c
JeroenDM 54bfe08
add code to publish obstacles in the planning scene
JeroenDM 95c21df
add another example that is not part of the tutorial text yet
JeroenDM f42c90e
Writing suggestions and fixes from Omid's review
JeroenDM 463ecd3
Remove solve method and explicity solve the problem using the move group
JeroenDM b52379c
Change name in license
JeroenDM 94aafbe
move extra example outside tutorial script
JeroenDM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
install(PROGRAMS | ||
scripts/ompl_constrained_planning_tutorial.py | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions
85
doc/ompl_constrained_planning/ompl_constrained_planning.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
OMPL Constrained Planning | ||
========================= | ||
.. image:: ompl_constrained_planning_header.png | ||
:width: 600px | ||
|
||
This tutorial shows you how to use OMPL's `Constrained planning capabilities`_ from MoveIt. Three planning problems are solved with different types of path constraints. It will be easier to follow if you have read through the tutorial on the `move group Python interface`_. | ||
|
||
For a short walkthrough of running the tutorial, you can watch `this video`_. | ||
|
||
When can I use this planner? | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
The interface currently only supports position constraints on a robot link, where the constrained regions is represented using a box_. The planning approach provides an alternative for the `enforce_joint_model_state_space`_ option. It is expected to be most valuable for constraints regions that have a small (or zero) volume in Cartesian space, where the rejection sampling does not always works. For example, keeping the end-effector on a plane or along a line. | ||
JeroenDM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Configure OMPL | ||
^^^^^^^^^^^^^^^^ | ||
OMPL reads configurations parameters from a file called :code:`ompl_planning.yaml`. This tutorial uses the Panda robot, for which this file can be found in :code:`panda_moveit_config/config/ompl_planning.yaml`. We will add a parameter to tell OMPL to plan in a constrained state space by setting :code:`enforce_constrained_state_space`. In addition, if the parameter `projection_evaluator`_ was not yet specified we also need to add it. | ||
|
||
.. code-block:: yaml | ||
|
||
panda_arm: | ||
enforce_constrained_state_space: true | ||
projection_evaluator: joints(panda_joint1,panda_joint2) | ||
|
||
Note that, as we are changing configuration files, you should also clone the repository `panda_moveit_config`_ in you're workspace. (Instead of using the version installed with :code:`sudo apt install`. | ||
|
||
.. code-block:: bash | ||
|
||
cd catkin_ws/src | ||
git clone https://github.com/ros-planning/panda_moveit_config.git | ||
cd ../.. | ||
catkin build | ||
|
||
Run the tutorial | ||
^^^^^^^^^^^^^^^^ | ||
|
||
After you changed the configuration as explained in the previous section, launch the move group node for the panda robot: :: | ||
JeroenDM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
roslaunch panda_moveit_config demo.launch | ||
|
||
Then add a Marker display to Rviz: | ||
|
||
.. image:: rviz_add_marker_topic.png | ||
:width: 200px | ||
|
||
Open a new terminal window to run the tutorial node: :: | ||
|
||
rosrun moveit_tutorials ompl_constrained_planning_tutorial.py | ||
|
||
A red and green sphere should appear in Rviz to show the start and goal states. In addition, a grey box should appear that represents the position constraint on the link :code:`panda_link8`. If planning succeeds, you should see a preview of the trajectory that was planned. | ||
JeroenDM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. image:: case_1.gif | ||
:width: 300px | ||
|
||
The following message appears in the terminal: :: | ||
|
||
============ Press enter to continue with the second planning problem. | ||
|
||
After pressing enter, the next planning problem is solved. | ||
|
||
.. image:: case_2.gif | ||
:width: 300px | ||
|
||
Again, if planning succeeds, the trajectory is animated in rviz. And finally the last planning problem is solved after pressing enter again. | ||
|
||
.. image:: case_3.gif | ||
:width: 300px | ||
|
||
|
||
To see the output from the planner, look in the terminal window where you launched the Panda's move group node. To replay the planned trajectory, you can add a "Trajectory Slider" panel in Rviz. | ||
|
||
.. image:: trajectory_slider.png | ||
:width: 200px | ||
|
||
The code explained | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
.. tutorial-formatter:: ./scripts/ompl_constrained_planning_tutorial.py | ||
|
||
.. _this video: https://youtu.be/RkPydgtIq-M | ||
.. _panda_moveit_config: https://github.com/ros-planning/panda_moveit_config | ||
.. _Constrained planning capabilities: http://ompl.kavrakilab.org/constrainedPlanning.html | ||
.. _move group Python interface: ../move_group_python_interface/move_group_python_interface_tutorial.html | ||
.. _box: http://docs.ros.org/latest/api/shape_msgs/html/msg/SolidPrimitive.html | ||
.. _enforce_joint_model_state_space: ../ompl_interface/ompl_interface_tutorial.html#enforce-planning-in-joint-space | ||
.. _projection_evaluator: ../ompl_interface/ompl_interface_tutorial.html#projection-evaluator |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.