Skip to content

Commit e1044d2

Browse files
Fix typos and formatting in Getting Started and Python API tutorials (#696)
Co-authored-by: Stephanie Eng <[email protected]>
1 parent 0e689a6 commit e1044d2

File tree

2 files changed

+41
-24
lines changed

2 files changed

+41
-24
lines changed

doc/examples/motion_planning_python_api/motion_planning_python_api_tutorial.rst

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Motion Planning Python API
55

66
<iframe width="560" height="315" src="https://www.youtube.com/embed/7KvF7Dj7bz0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
77

8-
In this tutorial we cover the basics of the motion planning API for ``moveit_py``.
8+
In this tutorial, we will cover the basics of the motion planning API for ``moveit_py``.
99
This tutorial is broken down into the following sections:
1010

1111
* **Getting Started:** An outline of the tutorial setup requirements.
@@ -93,7 +93,7 @@ An example of such a configuration file is given below: ::
9393
planning_time: 1.5
9494

9595

96-
The first block of the configuration file sets the planning scene monitor options such as the topics that it subsribes to (Note: if you aren't familiar with the planning scene monitor, you should consider reviewing ... ): ::
96+
The first block of the configuration file sets the planning scene monitor options such as the topics that it subscribes to (Note: if you aren't familiar with the planning scene monitor, consider reviewing :doc:`this tutorial </doc/examples/planning_scene_monitor/planning_scene_monitor_tutorial>` ): ::
9797

9898
planning_scene_monitor_options:
9999
name: "planning_scene_monitor"
@@ -104,7 +104,9 @@ The first block of the configuration file sets the planning scene monitor option
104104
monitored_planning_scene_topic: "/moveit_cpp/monitored_planning_scene"
105105
wait_for_initial_state_timeout: 10.0
106106

107-
The second block of the configuration file sets the planning pipelines that we wish to use. MoveIt supports multiple motion planning libraries including OMPL, PILZ industrial motion planner, Stochastic Trajectory Optimization for Motion Planning (STOMP), Search-Based Planning Library (SBPL) and Covariant Hamiltonian Optimization for Motion Planning (CHOMP) to name a few. When configuring our ``moveit_py`` node, we need to specify the configuration for planning pipelines we wish to use: ::
107+
The second block of the configuration file sets the planning pipelines that we wish to use.
108+
MoveIt supports multiple motion planning libraries including OMPL, Pilz Industrial Motion Planner, Stochastic Trajectory Optimization for Motion Planning (STOMP), Search-Based Planning Library (SBPL), and Covariant Hamiltonian Optimization for Motion Planning (CHOMP) to name a few.
109+
When configuring our ``moveit_py`` node, we need to specify the configuration for planning pipelines we wish to use: ::
108110

109111
planning_pipelines:
110112
pipeline_names: ["ompl", "pilz_industrial_motion_planner", "chomp", "ompl_rrt_star"]
@@ -146,11 +148,13 @@ For each of these named pipelines we must provide a configuration that identifie
146148
max_acceleration_scaling_factor: 1.0
147149
planning_time: 1.5
148150

149-
These specified parameters will be made available as ``moveit_py`` node parameters and will be leveraged at runtime when performing planning. This is what we will investigate next.
151+
These specified parameters will be made available as ``moveit_py`` node parameters and will be leveraged at runtime when performing planning.
152+
This is what we will investigate next.
150153

151154
Instantiating moveit_py and planning component
152155
----------------------------------------------------
153-
Before we can plan motions we need to instantiate a ``moveit_py`` node and its derived planning component. We will also instantiate a rclpy logger object: ::
156+
Before we can plan motions, we need to instantiate a ``moveit_py`` node and its derived planning component.
157+
We will also instantiate a ``rclpy`` logger object: ::
154158

155159
rclpy.init()
156160
logger = rclpy.logging.get_logger("moveit_py.pose_goal")
@@ -160,7 +164,8 @@ Before we can plan motions we need to instantiate a ``moveit_py`` node and its d
160164
panda_arm = panda.get_planning_component("panda_arm")
161165
logger.info("MoveItPy instance created")
162166

163-
Using the planning component represented by the ``panda_arm`` variable we can begin to perform motion planning. We also define a helper function for planning and executing motions: ::
167+
Using the planning component represented by the ``panda_arm`` variable, we can begin to perform motion planning.
168+
We also define a helper function for planning and executing motions: ::
164169

165170
def plan_and_execute(
166171
robot,
@@ -206,8 +211,9 @@ We start exploring the ``moveit_py`` motion planning API through executing a sin
206211

207212
Single Pipeline Planning - Robot State
208213
----------------------------------------------------
209-
Next we will plan to a robot state.
210-
Such a method is quite flexible as we can alter the robot state configuration as we wish (e.g. through setting joint values), here we will just set the robot state to a random configuration for simplicity. We will use the ``set_start_state_to_current_state`` method to set the start state of the robot to its current state and the ``set_goal_state`` method to set the goal state of the robot.
214+
Next, we will plan to a robot state.
215+
Such a method is quite flexible as we can alter the robot state configuration as we wish (e.g., through setting joint values).
216+
Here, we will use the ``set_start_state_to_current_state`` method to set the start state of the robot to its current state and the ``set_goal_state`` method to set the goal state to a random configuration.
211217
We will then plan to the goal state and execute the plan: ::
212218

213219
# instantiate a RobotState instance using the current robot model
@@ -249,7 +255,8 @@ Here we demonstrate how to set a pose goal for the end effector of the robot: ::
249255

250256
Single Pipeline Planning - Custom Constraints
251257
----------------------------------------------------
252-
You can also control the output of motion planning via custom constraints. Here we demonstrate planning to a configuration that satisfies a set of joint constraints: ::
258+
You can also control the output of motion planning via custom constraints.
259+
Here we demonstrate planning to a configuration that satisfies a set of joint constraints: ::
253260

254261
# set plan start state to current state
255262
panda_arm.set_start_state_to_current_state()
@@ -310,13 +317,13 @@ The code for this section requires you to run a different Python file, which you
310317

311318
ros2 launch moveit2_tutorials motion_planning_python_api_tutorial.launch.py example_file:=motion_planning_python_api_planning_scene.py
312319

313-
Interacting with a planning scene requires you to create a planning scene monitor ::
320+
Interacting with a planning scene requires you to create a planning scene monitor: ::
314321

315322
panda = MoveItPy(node_name="moveit_py_planning_scene")
316323
panda_arm = panda.get_planning_component("panda_arm")
317324
planning_scene_monitor = panda.get_planning_scene_monitor()
318325

319-
You can then add collision objects to a planning scene using the planning scene monitor's ``read_write`` context ::
326+
You can then add collision objects to a planning scene using the planning scene monitor's ``read_write`` context: ::
320327

321328
with planning_scene_monitor.read_write() as scene:
322329
collision_object = CollisionObject()
@@ -339,14 +346,14 @@ You can then add collision objects to a planning scene using the planning scene
339346
scene.apply_collision_object(collision_object)
340347
scene.current_state.update() # Important to ensure the scene is updated
341348

342-
Removing objects can be achieved similarly using the ``CollisionObject.REMOVE`` operation, or by removing all objects from the scene ::
349+
Removing objects can be achieved similarly using the ``CollisionObject.REMOVE`` operation, or by removing all objects from the scene: ::
343350

344351
with planning_scene_monitor.read_write() as scene:
345352
scene.remove_all_collision_objects()
346353
scene.current_state.update()
347354

348355
You can also use the ``read_only`` context of a planning scene monitor for tasks that do not require modifying the scene, such as collision checking.
349-
For example ::
356+
For example: ::
350357

351358
with planning_scene_monitor.read_only() as scene:
352359
robot_state = scene.current_state

doc/tutorials/getting_started/getting_started.rst

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
Getting Started
22
===============
33

4-
Here we will setup your environment for best running the tutorials. This will create a Colcon workspace, download all of the latest MoveIt source code, and build everything from source to ensure you have the latest fixes and improvements.
4+
Here, we will setup your environment for best running the tutorials.
5+
This will create a colcon workspace, download all of the latest MoveIt source code, and build everything from source to ensure you have the latest fixes and improvements.
56

6-
Building all the source code of MoveIt can take 20-30 minutes, depending on the CPU speed and available RAM of your computer. If you are on a less performant system, or generally just want to get started quicker, checkout our :doc:`Docker Guide </doc/how_to_guides/how_to_setup_docker_containers_in_ubuntu>`.
7+
Building all the source code of MoveIt can take 20-30 minutes, depending on the CPU speed and available RAM of your computer.
8+
If you are on a less performant system, or generally just want to get started quicker, check out our :doc:`Docker Guide </doc/how_to_guides/how_to_setup_docker_containers_in_ubuntu>`.
79

8-
Install ROS 2 and Colcon
10+
Install ROS 2 and colcon
911
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1012
MoveIt 2 currently supports multiple versions of ROS.
1113
Install whichever version you prefer.
1214
We primarily support ROS installed Ubuntu 22.04 but other methods and platforms may work with small changes to the instructions listed below.
13-
If you are just getting started we would recommend you use the latest stable version of ROS (Iron) on Ubuntu 22.04 for the most seamless experience.
15+
If you are just getting started, we recommend you use the latest stable version of ROS (Iron) on Ubuntu 22.04 for the most seamless experience.
1416

1517
* `Rolling Ridley <https://docs.ros.org/en/rolling/Installation.html>`_ - Rolling Development Release
16-
* `Irin Irwini <https://docs.ros.org/en/iron/Installation.html>`_ - Latest Stable Release - May 2023
17-
* `Humble Haskbill <https://docs.ros.org/en/humble/Installation.html>`_ - LTS Release - May 2022
18+
* `Iron Irwini <https://docs.ros.org/en/iron/Installation.html>`_ - Latest Stable Release - May 2023
19+
* `Humble Hawksbill <https://docs.ros.org/en/humble/Installation.html>`_ - LTS Release - May 2022
1820

19-
It is easy to miss steps when going through the ROS 2 installation tutorial. If you run into errors in the next few steps, a good place to start is to go back and make sure you have installed ROS 2 correctly. One that users commonly forget is to source the ROS 2 install itself. Note to source the version of ROS you installed. ::
21+
It is easy to miss steps when going through the ROS 2 installation tutorial.
22+
If you run into errors in the next few steps, a good place to start is to go back and make sure you have installed ROS 2 correctly.
23+
One that users commonly forget is to source the ROS 2 install itself.
24+
Note to source the version of ROS you installed. ::
2025

2126
source /opt/ros/iron/setup.bash
2227

@@ -61,11 +66,13 @@ Next we will download the source code for the rest of MoveIt: ::
6166

6267
vcs import < moveit2_tutorials/moveit2_tutorials.repos
6368

64-
The import command may ask for your GitHub credentials. You can just press Enter until it moves on (ignore the "Authentication failed" error).
69+
The import command may ask for your GitHub credentials.
70+
You can just press Enter until it moves on (ignore the "Authentication failed" error).
6571

6672
Build your Colcon Workspace
6773
^^^^^^^^^^^^^^^^^^^^^^^^^^^
68-
The following will install from Debian any package dependencies not already in your workspace. This is the step that will install MoveIt and all of its dependencies: ::
74+
The following will install from Debian any package dependencies not already in your workspace.
75+
This is the step that will install MoveIt and all of its dependencies: ::
6976

7077
sudo apt update && rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y
7178

@@ -102,12 +109,15 @@ Optional: add the previous command to your ``.bashrc``: ::
102109
Switch to Cyclone DDS
103110
^^^^^^^^^^^^^^^^^^^^^
104111

105-
As of Sep 26, 2022, the default ROS 2 middleware (RMW) implementation has an issue. As a workaround, switch to Cyclone DDS. (Note: this makes all nodes started using this RMW incompatible with any other nodes not using Cyclone DDS.) ::
112+
As of Sep 26, 2022, the default ROS 2 middleware (RMW) implementation has an issue.
113+
As a workaround, switch to Cyclone DDS.
114+
(Note: this makes all nodes started using this RMW incompatible with any other nodes not using Cyclone DDS.) ::
106115

107116
sudo apt install ros-rolling-rmw-cyclonedds-cpp
108117
# You may want to add this to ~/.bashrc to source it automatically
109118
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
110119

111120
Next Step
112121
^^^^^^^^^
113-
Nice job! Next we will :doc:`Visualize a robot with the interactive motion planning plugin for RViz </doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial>`
122+
Nice job!
123+
Next, we will :doc:`Visualize a robot with the interactive motion planning plugin for RViz </doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial>`

0 commit comments

Comments
 (0)