Skip to content

Commit 02f784f

Browse files
authored
Tutorial updates (#455)
1 parent a41de5a commit 02f784f

File tree

7 files changed

+133
-142
lines changed

7 files changed

+133
-142
lines changed

doc/tutorials/pick_and_place_with_moveit_task_constructor/launch/pick_place_demo.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def generate_launch_description():
99
# MTC Demo node
1010
pick_place_demo = Node(
1111
# package="mtc_tutorial",
12-
# executable="mtc_tutorial",
12+
# executable="mtc_node",
1313
package="moveit2_tutorials",
1414
executable="mtc_tutorial",
1515
output="screen",

doc/tutorials/pick_and_place_with_moveit_task_constructor/pick_and_place_with_moveit_task_constructor.rst

Lines changed: 92 additions & 125 deletions
Large diffs are not rendered by default.

doc/tutorials/planning_around_objects/planning_around_objects.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ First, update the target pose with the following change to make the robot plan t
4343
^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444

4545
In the next block of code, we create a collision object.
46-
The first thing to notice is that it is being placed in the frame of the robot.
46+
The first thing to notice is that it is being placed in the coordinate frame of the robot.
4747
If we had a perception system that reported the location of obstacles in our scene, then this is the sort of message it would build.
4848
Because this is just an example, we are creating it manually.
4949
One thing to notice at the end of this block of code is that we set the operation on this message to ``ADD``.
@@ -69,7 +69,7 @@ Place this code block between setting the target pose from the previous step and
6969

7070
// Define the pose of the box (relative to the frame_id)
7171
geometry_msgs::msg::Pose box_pose;
72-
box_pose.orientation.w = 1.0;
72+
box_pose.orientation.w = 1.0; // We can leave out the x, y, and z components of the quaternion since they are initialized to 0
7373
box_pose.position.x = 0.2;
7474
box_pose.position.y = 0.2;
7575
box_pose.position.z = 0.25;

doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ Step 4: Use Motion Planning with the Panda
165165

166166
* Make sure both states are not in collision with the robot itself.
167167

168-
* Make sure the Planned Path is being visualized. Also check the
169-
**Show Trail** checkbox in the **Planned Path** tree menu.
168+
* Un-check the **Show Trail** checkbox in the **Planned Path** tree menu.
170169

171-
* In the **MotionPlanning** window under the **Planning** tab, press the **Plan** button. You
172-
should be able to see a visualization of the arm moving and a trail.
170+
* In the **MotionPlanning** window under the **Planning** tab, press the **Plan** button.
171+
172+
* Check the **Show Trail** checkbox in the **Planned Path** tree menu. You should see the arm's path represented by a series of manipulator poses.
173173

174174
.. image:: rviz_plugin_planned_path.png
175175
:width: 700px
@@ -185,7 +185,8 @@ You can visually introspect trajectories point by point in RViz.
185185

186186
* Play with the "*Slider*" panel, e.g. move the slider, push "*Play*" button.
187187

188-
NOTE: Once you placed your EEF to a new goal, be sure to run *Plan* before running *Play* -- otherwise you'll see the waypoints for the previous goal if available.
188+
Note: Once you placed your end-effector to a new goal, be sure to run *Plan* before running *Play* -- otherwise you'll see the waypoints for the previous goal if available.
189+
189190

190191
.. image:: rviz_plugin_slider.png
191192
:width: 700px

doc/tutorials/visualizing_in_rviz/hello_moveit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main(int argc, char* argv[])
3636
auto const draw_title = [&moveit_visual_tools](auto text) {
3737
auto const text_pose = [] {
3838
auto msg = Eigen::Isometry3d::Identity();
39-
msg.translation().z() = 1.0;
39+
msg.translation().z() = 1.0; // Place text 1m above the base link
4040
return msg;
4141
}();
4242
moveit_visual_tools.publishText(text_pose, text, rviz_visual_tools::WHITE, rviz_visual_tools::XLARGE);

doc/tutorials/visualizing_in_rviz/visualizing_in_rviz.rst

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,32 +55,42 @@ To test that this all worked, open a terminal in the workspace directory (rememb
5555
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5656

5757
Before we can initialize MoveItVisualTools, we need to have a executor spinning on our ROS node.
58-
This is necessary because of how MoveItVisualTools interacts with ROS services and topics.
58+
This is necessary because of how MoveItVisualTools interacts with ROS services and topics. First, add the threading library to your includes at the top.
5959

6060
.. code-block:: C++
6161

6262
#include <thread> // <---- add this to the set of includes at the top
6363

64-
...
64+
By creating and naming loggers, we are able to keep our program logs organized.
65+
66+
.. code-block:: C++
6567

6668
// Create a ROS logger
6769
auto const logger = rclcpp::get_logger("hello_moveit");
6870

69-
// We spin up a SingleThreadedExecutor so MoveItVisualTools interact with ROS
71+
Next, add your executor before creating the MoveIt MoveGroup Interface.
72+
73+
.. code-block:: C++
74+
75+
// Spin up a SingleThreadedExecutor for MoveItVisualTools to interact with ROS
7076
rclcpp::executors::SingleThreadedExecutor executor;
7177
executor.add_node(node);
7278
auto spinner = std::thread([&executor]() { executor.spin(); });
7379

7480
// Create the MoveIt MoveGroup Interface
75-
...
81+
82+
...
83+
84+
Finally, make sure to join the thread before exiting.
85+
86+
.. code-block:: C++
7687

7788
// Shutdown ROS
7889
rclcpp::shutdown(); // <--- This will cause the spin function in the thread to return
7990
spinner.join(); // <--- Join the thread before exiting
8091
return 0;
81-
}
8292

83-
After each one of these changes, you should rebuild your workspace to make sure you don't have any syntax errors.
93+
After making these changes, rebuild your workspace to make sure you don't have any syntax errors.
8494

8595
3 Create and Initialize MoveItVisualTools
8696
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -116,7 +126,7 @@ After we've constructed and initialized, we now create some closures (function o
116126
auto const draw_title = [&moveit_visual_tools](auto text) {
117127
auto const text_pose = [] {
118128
auto msg = Eigen::Isometry3d::Identity();
119-
msg.translation().z() = 1.0;
129+
msg.translation().z() = 1.0; // Place text 1m above the base link
120130
return msg;
121131
}();
122132
moveit_visual_tools.publishText(text_pose, text, rviz_visual_tools::WHITE,

doc/tutorials/your_first_project/your_first_project.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,24 @@ After that, we have the normal call to initialize rclcpp, and then we create our
110110
rclcpp::NodeOptions().automatically_declare_parameters_from_overrides(true)
111111
);
112112

113-
The first argument is a string that ROS will use to make a unique node.
113+
The first argument is a string that ROS will use to name a unique node.
114114
The second is needed for MoveIt because of how we use ROS Parameters.
115115

116+
Next, we `create a logger <https://docs.ros.org/en/humble/Tutorials/Demos/Logging-and-logger-configuration.html>`_ named "hello_moveit" to keep our log outputs organized and configurable.
117+
118+
.. code-block:: C++
119+
120+
// Create a ROS logger
121+
auto const logger = rclcpp::get_logger("hello_moveit");
122+
116123
Lastly, we have the code to shutdown ROS.
117124

125+
.. code-block:: C++
126+
127+
// Shutdown ROS
128+
rclcpp::shutdown();
129+
return 0;
130+
118131
3 Plan and Execute using MoveGroupInterface
119132
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120133

0 commit comments

Comments
 (0)