Skip to content

Commit af375fd

Browse files
committed
Update tutorials
1 parent 71ee840 commit af375fd

File tree

18 files changed

+1110
-104
lines changed

18 files changed

+1110
-104
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ add_subdirectory(doc/how_to_guides/parallel_planning)
6969
add_subdirectory(doc/how_to_guides/chomp_planner)
7070
add_subdirectory(doc/how_to_guides/persistent_scenes_and_states)
7171
add_subdirectory(doc/how_to_guides/pilz_industrial_motion_planner)
72+
add_subdirectory(doc/how_to_guides/pipeline_testbench)
7273
add_subdirectory(doc/how_to_guides/using_ompl_constrained_planning)
7374
add_subdirectory(doc/tutorials/pick_and_place_with_moveit_task_constructor)
7475
add_subdirectory(doc/tutorials/quickstart_in_rviz)

doc/concepts/motion_planning.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,30 @@ Pre-processing is useful in several situations, e.g. when a start state for the
4747
Post-processing is needed for several other operations, e.g. to convert paths generated for a robot into time-parameterized trajectories.
4848
MoveIt provides a set of default motion planning adapters that each perform a very specific function.
4949

50-
FixStartStateBounds
50+
CheckStartStateBounds
5151
^^^^^^^^^^^^^^^^^^^
5252

5353
The fix start state bounds adapter fixes the start state to be within the joint limits specified in the URDF.
5454
The need for this adapter arises in situations where the joint limits for the physical robot are not properly configured.
5555
The robot may then end up in a configuration where one or more of its joints is slightly outside its joint limits.
5656
In this case, the motion planner is unable to plan since it will think that the starting state is outside joint limits.
57-
The "FixStartStateBounds" planning request adapter will "fix" the start state by moving it to the joint limit.
57+
The "CheckStartStateBounds" planning request adapter will "fix" the start state by moving it to the joint limit.
5858
However, this is obviously not the right solution every time - e.g. where the joint is really outside its joint limits by a large amount.
5959
A parameter for the adapter specifies how much the joint can be outside its limits for it to be "fixable".
6060

61-
FixWorkspaceBounds
61+
ValidateWorkspaceBounds
6262
^^^^^^^^^^^^^^^^^^
6363

6464
The fix workspace bounds adapter will specify a default workspace for planning: a cube of size 10 m x 10 m x 10 m.
6565
This workspace will only be specified if the planning request to the planner does not have these fields filled in.
6666

67-
FixStartStateCollision
67+
CheckStartStateCollision
6868
^^^^^^^^^^^^^^^^^^^^^^
6969

7070
The fix start state collision adapter will attempt to sample a new collision-free configuration near a specified configuration (in collision) by perturbing the joint values by a small amount.
7171
The amount that it will perturb the values by is specified by the **jiggle_fraction** parameter that controls the perturbation as a percentage of the total range of motion for the joint.
7272
The other parameter for this adapter specifies how many random perturbations the adapter will sample before giving up.
7373

74-
FixStartStatePathConstraints
75-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76-
77-
This adapter is applied when the start state for a motion plan does not obey the specified path constraints.
78-
It will attempt to plan a path between the current configuration of the robot to a new location where the path constraint is obeyed.
79-
The new location will serve as the start state for planning.
8074

8175
AddTimeParameterization
8276
^^^^^^^^^^^^^^^^^^^^^^^

doc/examples/motion_planning_pipeline/src/motion_planning_pipeline_tutorial.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ int main(int argc, char** argv)
141141
req.pipeline_id = "ompl";
142142
req.planner_id = "RRTConnectkConfigDefault";
143143
req.allowed_planning_time = 1.0;
144+
req.max_velocity_scaling_factor = 1.0;
145+
req.max_acceleration_scaling_factor = 1.0;
144146
planning_interface::MotionPlanResponse res;
145147
geometry_msgs::msg::PoseStamped pose;
146148
pose.header.frame_id = "panda_link0";

doc/examples/moveit_cpp/config/moveit_cpp.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ planning_scene_monitor_options:
99

1010
planning_pipelines:
1111
#namespace: "moveit_cpp" # optional, default is ~
12-
pipeline_names: ["ompl"]
12+
pipeline_names: ["stomp"]
1313

1414
plan_request_params:
1515
planning_attempts: 1
16-
planning_pipeline: ompl
16+
planning_pipeline: stomp
17+
planner_id: "stomp"
1718
max_velocity_scaling_factor: 1.0
1819
max_acceleration_scaling_factor: 1.0

doc/examples/moveit_cpp/launch/moveit_cpp_tutorial.launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def generate_launch_description():
1111
MoveItConfigsBuilder("moveit_resources_panda")
1212
.robot_description(file_path="config/panda.urdf.xacro")
1313
.trajectory_execution(file_path="config/gripper_moveit_controllers.yaml")
14+
.planning_pipelines("stomp", ["stomp"])
1415
.moveit_cpp(
1516
file_path=get_package_share_directory("moveit2_tutorials")
1617
+ "/config/moveit_cpp.yaml"

doc/examples/planning_adapters/planning_adapters_tutorial.rst

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Planning Adapter Tutorials
77
==========================
88

9-
Planning Request Adapters is a concept in MoveIt which can be used to modify the trajectory (pre-processing and/or post-processing) for a motion planner. Some examples of existing planning adapters in MoveIt include AddTimeParameterization, FixWorkspaceBounds, FixStartBounds, FixStartStateCollision, FixStartStatePathConstraints, CHOMPOptimizerAdapter, etc. ! Using the concepts of Planning Adapters, multiple motion planning algorithms can be used in a pipeline to produce robust motion plans. For example, a sample pipeline of motion plans might include an initial plan produced by OMPL which can then be optimized by CHOMP to produce a motion plan which would likely be better than a path produced by OMPL or CHOMP alone. Similarly, using the concept of Planning Adapters, other motion planners can be mixed and matched depending on the environment the robot is operating in. This section provides a step by step tutorial on using a mix and match of different motion planners and also provides insights on when to use which particular motion planners.
9+
Planning Request Adapters is a concept in MoveIt which can be used to modify the trajectory (pre-processing and/or post-processing) for a motion planner. Some examples of existing planning adapters in MoveIt include AddTimeParameterization, ValidateWorkspaceBounds, FixStartBounds, CheckStartStateCollision, CHOMPOptimizerAdapter, etc. ! Using the concepts of Planning Adapters, multiple motion planning algorithms can be used in a pipeline to produce robust motion plans. For example, a sample pipeline of motion plans might include an initial plan produced by OMPL which can then be optimized by CHOMP to produce a motion plan which would likely be better than a path produced by OMPL or CHOMP alone. Similarly, using the concept of Planning Adapters, other motion planners can be mixed and matched depending on the environment the robot is operating in. This section provides a step by step tutorial on using a mix and match of different motion planners and also provides insights on when to use which particular motion planners.
1010

1111
Getting Started
1212
---------------
@@ -46,11 +46,10 @@ To achieve this, follow the steps:
4646
#. Open the ``ompl_planning_pipeline.launch`` file in the ``<robot_moveit_config>/launch`` folder of your robot. For the Panda robot it is this `file <https://github.com/ros-planning/panda_moveit_config/blob/melodic-devel/launch/ompl_planning_pipeline.launch.xml>`_. Edit this launch file, find the lines where ``<arg name="planning_adapters">`` is mentioned and change it to: ::
4747

4848
<arg name="planning_adapters"
49-
value="default_planner_request_adapters/AddTimeParameterization
50-
default_planner_request_adapters/FixWorkspaceBounds
51-
default_planner_request_adapters/FixStartStateBounds
52-
default_planner_request_adapters/FixStartStateCollision
53-
default_planner_request_adapters/FixStartStatePathConstraints
49+
value="default_planning_request_adapters/AddTimeParameterization
50+
default_planning_request_adapters/ValidateWorkspaceBounds
51+
default_planning_request_adapters/CheckStartStateBounds
52+
default_planning_request_adapters/CheckStartStateCollision
5453
chomp/OptimizerAdapter" />
5554

5655
#. The values of the ``planning_adapters`` is the order in which the mentioned adapters are called / invoked. Order here matters. Inside the CHOMP adapter, a :moveit_codedir:`call <moveit_planners/chomp/chomp_optimizer_adapter/src/chomp_optimizer_adapter.cpp#L169>` to OMPL is made before invoking the CHOMP optimization solver, so CHOMP takes the initial path computed by OMPL as the starting point to further optimize it.
@@ -81,11 +80,10 @@ To achieve this, follow the steps:
8180

8281
#. Open the ``stomp_planning_pipeline.launch`` file in the ``<robot_moveit_config>/launch`` folder of your robot. For the Panda robot it is `this <https://github.com/ros-planning/panda_moveit_config/blob/melodic-devel/launch/stomp_planning_pipeline.launch.xml>`_ file. Edit this launch file, find the lines where ``<arg name="planning_adapters">`` is mentioned and change it to: ::
8382

84-
<arg name="planning_adapters" value="default_planner_request_adapters/AddTimeParameterization
85-
default_planner_request_adapters/FixWorkspaceBounds
86-
default_planner_request_adapters/FixStartStateBounds
87-
default_planner_request_adapters/FixStartStateCollision
88-
default_planner_request_adapters/FixStartStatePathConstraints
83+
<arg name="planning_adapters" value="default_planning_request_adapters/AddTimeParameterization
84+
default_planning_request_adapters/ValidateWorkspaceBounds
85+
default_planning_request_adapters/CheckStartStateBounds
86+
default_planning_request_adapters/CheckStartStateCollision
8987
chomp/OptimizerAdapter" />
9088

9189
#. The values of the ``planning_adapters`` is the order in which the mentioned adapters are called / invoked. Order here matters. Inside the CHOMP adapter, a call to STOMP is made before invoking the CHOMP optimization solver, so CHOMP takes the initial path computed by STOMP as the starting point to further optimize it.
@@ -118,11 +116,10 @@ To achieve this, follow the steps:
118116

119117
#. Open the ``ompl_planning_pipeline.launch`` file in the ``<robot_moveit_config>/launch`` folder of your robot. For the Panda robot it is this `file <https://github.com/ros-planning/panda_moveit_config/blob/melodic-devel/launch/ompl_planning_pipeline.launch.xml>`_. Edit this launch file, find the lines where ``<arg name="planning_adapters">`` is mentioned and change it to: ::
120118

121-
<arg name="planning_adapters" value="default_planner_request_adapters/AddTimeParameterization
122-
default_planner_request_adapters/FixWorkspaceBounds
123-
default_planner_request_adapters/FixStartStateBounds
124-
default_planner_request_adapters/FixStartStateCollision
125-
default_planner_request_adapters/FixStartStatePathConstraints
119+
<arg name="planning_adapters" value="default_planning_request_adapters/AddTimeParameterization
120+
default_planning_request_adapters/ValidateWorkspaceBounds
121+
default_planning_request_adapters/CheckStartStateBounds
122+
default_planning_request_adapters/CheckStartStateCollision
126123
stomp_moveit/StompSmoothingAdapter" />
127124

128125
#. The values of the ``planning_adapters`` is the order in which the mentioned adapters are called / invoked. Order here matters. Inside the STOMP adapter, a call to OMPL is made before invoking the STOMP smoothing solver, so STOMP takes the initial path computed by OMPL as the starting point to further optimize it.

doc/examples/subframes/subframes_tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ For older moveit_config packages that you have not generated yourself recently,
6969
required for subframes might not be configured, and the subframe link might not be found. To fix this for your
7070
moveit_config package, open the ``ompl_planning_pipeline.launch`` file in the ``<robot_moveit_config>/launch``
7171
folder of your robot. For the Panda robot it is :panda_codedir:`this <launch/ompl_planning_pipeline.launch.xml>` file.
72-
Edit this launch file, find the lines where ``<arg name="planning_adapters">`` is mentioned and insert ``default_planner_request_adapters/ResolveConstraintFrames`` after
73-
the line ``default_planner_request_adapters/FixStartStatePathConstraints``.
72+
Edit this launch file, find the lines where ``<arg name="planning_adapters">`` is mentioned and insert ``default_planning_request_adapters/ResolveConstraintFrames`` after
73+
the line ``default_planning_request_adapters/FixStartStatePathConstraints``.

doc/examples/time_parameterization/time_parameterization_tutorial.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Finally, add the Ruckig smoothing algorithm to the list of planning request adap
3434

3535
.. code-block:: yaml
3636
37-
request_adapters: >-
38-
default_planner_request_adapters/AddRuckigTrajectorySmoothing
39-
default_planner_request_adapters/AddTimeOptimalParameterization
37+
response_adapters:
38+
- default_planning_request_adapters/AddRuckigTrajectorySmoothing
39+
- default_planning_request_adapters/AddTimeOptimalParameterization
4040
...

doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,20 @@ def generate_launch_description():
4646
# Load additional OMPL pipeline
4747
ompl_planning_pipeline_config = {
4848
"ompl_rrtc": {
49-
"planning_plugin": "ompl_interface/OMPLPlanner",
50-
"request_adapters": """\
51-
default_planner_request_adapters/AddTimeOptimalParameterization \
52-
default_planner_request_adapters/FixWorkspaceBounds \
53-
default_planner_request_adapters/FixStartStateBounds \
54-
default_planner_request_adapters/FixStartStateCollision \
55-
default_planner_request_adapters/FixStartStatePathConstraints \
56-
""",
57-
"start_state_max_bounds_error": 0.1,
49+
"planning_plugins": [
50+
"ompl_interface/OMPLPlanner",
51+
],
52+
"request_adapters": [
53+
"default_planning_request_adapters/ResolveConstraintFrames",
54+
"default_planning_request_adapters/ValidateWorkspaceBounds",
55+
"default_planning_request_adapters/CheckStartStateBounds",
56+
"default_planning_request_adapters/CheckStartStateCollision",
57+
],
58+
"response_adapters": [
59+
"default_planning_response_adapters/AddTimeOptimalParameterization",
60+
"default_planning_response_adapters/ValidateSolution",
61+
"default_planning_response_adapters/DisplayMotionPath",
62+
],
5863
}
5964
}
6065
ompl_planning_yaml = load_yaml(

doc/how_to_guides/chomp_planner/chomp_planner_tutorial.rst

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -98,31 +98,3 @@ OMPL is a open source library for sampling based / randomized motion planning al
9898
CHOMP: While most high-dimensional motion planners separate trajectory generation into distinct planning and optimization stages, CHOMP capitalizes on covariant gradient and functional gradient approaches to the optimization stage to design a motion planning algorithm based entirely on trajectory optimization. Given an infeasible naive trajectory, CHOMP reacts to the surrounding environment to quickly pull the trajectory out of collision while simultaneously optimizing dynamic quantities such as joint velocities and accelerations. It rapidly converges to a smooth, collision-free trajectory that can be executed efficiently on the robot. A covariant update rule ensures that CHOMP quickly converges to a locally optimal trajectory.
9999

100100
For scenes containing obstacles, CHOMP often generates paths which do not prefer smooth trajectories by addition of some noise (*ridge_factor*) in the cost function for the dynamic quantities of the robot (like acceleration, velocity). CHOMP is able to avoid obstacles in most cases, but it can fail if it gets stuck in local minima due to a bad initial guess for the trajectory. OMPL can be used to generate collision-free seed trajectories for CHOMP to mitigate this issue.
101-
102-
Using CHOMP as a post-processor for OMPL
103-
----------------------------------------
104-
Here, we will demonstrate that CHOMP can also be used as a post-processing optimization technique for plans obtained by other planning algorithms. The intuition behind this is that some randomized planning algorithm produces an initial guess for CHOMP. CHOMP then takes this initial guess and further optimizes the trajectory.
105-
To achieve this, use the following steps:
106-
107-
#. Edit ``ompl_planning.yaml`` in the ``<robot_moveit_config>/config`` folder of your robot. Add ``chomp/OptimizerAdapter`` to the bottom of the list of request_adapters: ::
108-
109-
request_adapters: >-
110-
...
111-
default_planner_request_adapters/FixStartStatePathConstraints
112-
chomp/OptimizerAdapter
113-
114-
#. Change the ``trajectory_initialization_method`` parameter in ``chomp_planning.yaml`` to ``fillTrajectory`` so that OMPL can provide the input for the CHOMP algorithm: ::
115-
116-
trajectory_initialization_method: "fillTrajectory"
117-
118-
#. Add the CHOMP config file to the launch file of your robot, ``<robot_moveit_config>/launch/chomp_demo.launch.py``, if it is not there already: ::
119-
120-
.planning_pipelines(pipelines=["ompl", "chomp"])
121-
122-
#. Now you can launch the newly configured planning pipeline as follows: ::
123-
124-
ros2 launch moveit2_tutorials chomp_demo.launch.py rviz_tutorial:=True
125-
126-
This will launch RViz. Select OMPL in the Motion Planning panel under the Context tab. Set the desired start and goal states by moving the end-effector around in the same way as was done for CHOMP above. Finally click on the Plan button to start planning. The planner will now first run OMPL, then run CHOMP on OMPL's output to produce an optimized path. To make the planner's task more challenging, add obstacles to the scene using: ::
127-
128-
ros2 run moveit2_tutorials collision_scene_example

0 commit comments

Comments
 (0)