From bf4bde4dbb1e223ba54ab25f57d819b2a6fcc173 Mon Sep 17 00:00:00 2001 From: hello-chintan Date: Thu, 8 Sep 2022 16:39:51 -0400 Subject: [PATCH 1/3] Update image links --- ros2/example_1.md | 2 +- ros2/example_10.md | 6 +++--- ros2/example_2.md | 8 ++++---- ros2/example_3.md | 2 +- ros2/example_4.md | 4 ++-- ros2/follow_joint_trajectory.md | 4 ++-- ros2/gazebo_basics.md | 4 ++-- ros2/getting_started.md | 2 +- ros2/internal_state_of_stretch.md | 2 +- ros2/moveit_basics.md | 4 ++-- ros2/navigation_stack.md | 2 +- ros2/rviz_basics.md | 6 +++--- ros2/teleoperating_stretch.md | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ros2/example_1.md b/ros2/example_1.md index 27c34ed..640d41f 100644 --- a/ros2/example_1.md +++ b/ros2/example_1.md @@ -1,7 +1,7 @@ ## Example 1

- +

The goal of this example is to give you an enhanced understanding of how to control the mobile base by sending `Twist` messages to a Stretch robot. diff --git a/ros2/example_10.md b/ros2/example_10.md index c1f3297..14c4d37 100644 --- a/ros2/example_10.md +++ b/ros2/example_10.md @@ -27,7 +27,7 @@ ros2 run stretch_ros_tutorials tf2_broadcaster The gif below visualizes what happens when running the previous node.

- +

**OPTIONAL**: If you would like to see how the static frames update while the robot is in motion, run the stow command node and observe the tf frames in RViz. @@ -38,7 +38,7 @@ ros2 run stretch_ros_tutorials stow_command ```

- +

@@ -241,7 +241,7 @@ rotation: ```

- +

diff --git a/ros2/example_2.md b/ros2/example_2.md index e8f42be..7d91c34 100644 --- a/ros2/example_2.md +++ b/ros2/example_2.md @@ -25,15 +25,15 @@ float32[] intensities # intensity data [device-specific units] The above message tells you everything you need to know about a scan. Most importantly, you have the angle of each hit and its distance (range) from the scanner. If you want to work with raw range data, then the above message is all you need. There is also an image below that illustrates the components of the message type.

- +

For a Stretch robot the start angle of the scan, `angle_min`, and end angle, `angle_max`, are closely located along the x-axis of Stretch's frame. `angle_min` and `angle_max` are set at **-3.1416** and **3.1416**, respectively. This is illustrated by the images below.

- - + +

@@ -64,7 +64,7 @@ ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/rviz/stretch_simpl Change the topic name from the LaserScan display from */scan* to */filter_scan*.

- +

### The Code diff --git a/ros2/example_3.md b/ros2/example_3.md index f9a3433..96c4f46 100644 --- a/ros2/example_3.md +++ b/ros2/example_3.md @@ -16,7 +16,7 @@ ros2 run stretch_ros_tutorials avoider To stop the node from sending twist messages, type **Ctrl** + **c** in the terminal running the avoider node.

- +

### The Code diff --git a/ros2/example_4.md b/ros2/example_4.md index fbd11ec..7d48b48 100644 --- a/ros2/example_4.md +++ b/ros2/example_4.md @@ -1,6 +1,6 @@ ## Example 4 -![image](images/balloon.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/balloon.png) Let's bringup stretch in RViz by using the following command. @@ -15,7 +15,7 @@ ros2 run stretch_ros_tutorials marker ``` The gif below demonstrates how to add a new *Marker* display type, and change the topic name from `visualization_marker` to `balloon`. A red sphere Marker should appear above the Stretch robot. -![image](images/balloon.gif) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/balloon.gif) ### The Code diff --git a/ros2/follow_joint_trajectory.md b/ros2/follow_joint_trajectory.md index 9145dee..21717ba 100644 --- a/ros2/follow_joint_trajectory.md +++ b/ros2/follow_joint_trajectory.md @@ -4,7 +4,7 @@ Stretch driver offers a [`FollowJointTrajectory`](http://docs.ros.org/en/api/con ## Stow Command Example

- +

Begin by launching stretch_driver in a terminal. @@ -166,7 +166,7 @@ To make the script executable call the main() function like above. ## Multipoint Command Example

- +

If you have killed the above instance of stretch_driver relaunch it again through the terminal. diff --git a/ros2/gazebo_basics.md b/ros2/gazebo_basics.md index a92c857..53efdfa 100644 --- a/ros2/gazebo_basics.md +++ b/ros2/gazebo_basics.md @@ -13,7 +13,7 @@ roslaunch stretch_gazebo gazebo.launch This will bringup the robot in the gazebo simulation similar to the image shown below. -![image](images/stretch_gazebo_empty_world.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/stretch_gazebo_empty_world.png) ### Custom World Simulation In gazebo, you are able to spawn Stretch in various worlds. First, source the gazebo world files by running the following command in a terminal @@ -28,6 +28,6 @@ Then using the world argument, you can spawn the stretch in the willowgarage wor roslaunch stretch_gazebo gazebo.launch world:=worlds/willowgarage.world ``` -![image](images/stretch_willowgarage_world.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/stretch_willowgarage_world.png) **Next Tutorial:** [Teleoperating Stretch](teleoperating_stretch.md) diff --git a/ros2/getting_started.md b/ros2/getting_started.md index 32c8556..a804924 100644 --- a/ros2/getting_started.md +++ b/ros2/getting_started.md @@ -9,9 +9,9 @@ Instructions on installing Ubuntu 20.04 with ROS Noetic and ROS 2 Galactic can b ## ROS 2 Tutorials Setup on Local Computer Once your system is setup, clone the [stretch_ros_tutorials](https://github.com/hello-sanchez/stretch_ros_tutorials.git) to the src directory of the ament workspace, then build the packages. + ``` cd ~/ament_ws/src - git clone https://github.com/hello-sanchez/stretch_ros_tutorials.git cd ~/ament_ws colcon build diff --git a/ros2/internal_state_of_stretch.md b/ros2/internal_state_of_stretch.md index 0534089..9030cd2 100644 --- a/ros2/internal_state_of_stretch.md +++ b/ros2/internal_state_of_stretch.md @@ -34,7 +34,7 @@ A powerful tool to visualize the ROS communication is through the rqt_graph pack ``` ros2 run rqt_graph rqt_graph ``` -![image](images/rqt_graph.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rqt_graph.png) The graph allows a user to observe and affirm if topics are broadcasted to the correct nodes. This method can also be utilized to debug communication issues. diff --git a/ros2/moveit_basics.md b/ros2/moveit_basics.md index 130c036..9793847 100644 --- a/ros2/moveit_basics.md +++ b/ros2/moveit_basics.md @@ -22,7 +22,7 @@ ros2 launch stretch_moveit_config movegroup_moveit2.launch.py ``` This will brining up an RViz instance where you can move the robot around using [interactive markers](http://wiki.ros.org/rviz/Tutorials/Interactive%20Markers%3A%20Getting%20Started) and create plans between poses. You can reference the bottom gif as a guide to plan and execute motion. -![image](images/moveit.gif) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/moveit.gif) Additionally, the demo allows a user to select from the five groups, *stretch_arm*, *stretch_gripper*, *stretch_head*, *mobile_base_arm* and *position* to move. The option to change groups in the in *Planning Request* section in the *Displays* tree. A few notes to be kept in mind: @@ -34,7 +34,7 @@ Additionally, the demo allows a user to select from the five groups, *stretch_ar * When planning with *stretch_head* group make sure you select *Approx IK Solutions* in Planning tab of Motion Planning RViz plugin. -![image](images/moveit_groups.gif) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/moveit_groups.gif) ## Running Gazebo with MoveIt! and Stretch diff --git a/ros2/navigation_stack.md b/ros2/navigation_stack.md index d812868..6028bca 100644 --- a/ros2/navigation_stack.md +++ b/ros2/navigation_stack.md @@ -15,7 +15,7 @@ roslaunch stretch_navigation mapping.launch Rviz will show the robot and the map that is being constructed. With the terminal open, use the instructions printed by the teleop package to teleoperate the robot around the room. Avoid sharp turns and revisit previously visited spots to form loop closures.

- +

In Rviz, once you see a map that has reconstructed the space well enough, you can run the following commands to save the map to `stretch_user/`. diff --git a/ros2/rviz_basics.md b/ros2/rviz_basics.md index 2245e4b..319964a 100644 --- a/ros2/rviz_basics.md +++ b/ros2/rviz_basics.md @@ -13,11 +13,11 @@ ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/rviz/stretch_simpl ``` An RViz window should open, allowing you to see the various DisplayTypes in the display tree on the left side of the window. -![image](images/simple_rviz.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/simple_rviz.png) If you want to visualize Stretch's [tf transform tree](http://wiki.ros.org/rviz/DisplayTypes/TF), you need to add the display type to the RViz window. First, click on the *Add* button and include the *TF* type to the display. You will then see all of the transform frames of the Stretch robot and the visualization can be toggled off and on by clicking the checkbox next to the tree. Below is a gif for reference. -![image](images/rviz_adding_tf.gif) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rviz_adding_tf.gif) TODO: Add the correct link for working with rviz2 in ROS 2 There are further tutorials for RViz that can be found [here](http://wiki.ros.org/rviz/Tutorials). @@ -31,7 +31,7 @@ roslaunch stretch_gazebo gazebo.launch world:=worlds/willowgarage.world rviz:=tr ``` the `rviz` flag will open an RViz window to visualize a variety of ROS topics. -![image](images/willowgarage_with_rviz.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/willowgarage_with_rviz.png) Bringup the [keyboard teleop](teleoperating_stretch.md) to drive Stretch and observe its sensor input. diff --git a/ros2/teleoperating_stretch.md b/ros2/teleoperating_stretch.md index 454d2eb..4ebde52 100644 --- a/ros2/teleoperating_stretch.md +++ b/ros2/teleoperating_stretch.md @@ -6,7 +6,7 @@ Teleoperation support for Stretch in ROS 2 is under active development. Please r Refer to the instructions below if you want to test this functionality in ROS 1. ### Xbox Controller Teleoperating -![image](images/xbox_controller_commands.png) +![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/xbox_controller_commands.png) Stretch comes ready to run out of the box. The Xbox Teleoperation demo will let you quickly test out the robot capabilities by teleoperating it with an Xbox Controller. From 5d3aa0a72c2641f570152c259e15edbaf7142836 Mon Sep 17 00:00:00 2001 From: hello-chintan Date: Thu, 8 Sep 2022 16:53:04 -0400 Subject: [PATCH 2/3] Remove redundant next tutorial links --- ros2/example_1.md | 3 --- ros2/example_2.md | 2 -- ros2/example_3.md | 1 - ros2/gazebo_basics.md | 1 - ros2/getting_started.md | 1 - ros2/internal_state_of_stretch.md | 1 - ros2/moveit_basics.md | 1 - ros2/navigation_stack.md | 1 - ros2/rviz_basics.md | 1 - ros2/teleoperating_stretch.md | 1 - 10 files changed, 13 deletions(-) diff --git a/ros2/example_1.md b/ros2/example_1.md index 9ded7ed..a6a8ca1 100644 --- a/ros2/example_1.md +++ b/ros2/example_1.md @@ -139,6 +139,3 @@ cd catkin_ws/src/stretch_ros_turotials/src/ python3 move.py ``` --> To stop the node from sending twist messages, type **Ctrl** + **c**. - - -**Next Example:** [Example 2](example_2.md) diff --git a/ros2/example_2.md b/ros2/example_2.md index 38741d5..1ea9dfd 100644 --- a/ros2/example_2.md +++ b/ros2/example_2.md @@ -176,5 +176,3 @@ rclpy.spin(scan_filter) Give control to ROS. This will allow the callback to be called whenever new messages come in. If we don't put this line in, then the node will not work, and ROS will not process any messages. - -**Next Example:** [Example 3](example_3.md) diff --git a/ros2/example_3.md b/ros2/example_3.md index 6b272f2..a5601be 100644 --- a/ros2/example_3.md +++ b/ros2/example_3.md @@ -155,4 +155,3 @@ Setup Avoider class with `avoider = Avioder()` Give control to ROS with `rclpy.spin()`. This will allow the callback to be called whenever new messages come in. If we don't put this line in, then the node will not work, and ROS will not process any messages. -**Next Example:** [Example 4](example_4.md) diff --git a/ros2/gazebo_basics.md b/ros2/gazebo_basics.md index 9158281..43d742a 100644 --- a/ros2/gazebo_basics.md +++ b/ros2/gazebo_basics.md @@ -32,4 +32,3 @@ roslaunch stretch_gazebo gazebo.launch world:=worlds/willowgarage.world ![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/stretch_willowgarage_world.png) -**Next Tutorial:** [Teleoperating Stretch](teleoperating_stretch.md) diff --git a/ros2/getting_started.md b/ros2/getting_started.md index 55ffb67..8e5a3fe 100644 --- a/ros2/getting_started.md +++ b/ros2/getting_started.md @@ -24,4 +24,3 @@ Then source your workspace with the following command source ~/ament_ws/install/setup.bash" ``` -**Next Tutorial:** [Gazebo Basics](gazebo_basics.md) diff --git a/ros2/internal_state_of_stretch.md b/ros2/internal_state_of_stretch.md index f637ef0..df436f4 100644 --- a/ros2/internal_state_of_stretch.md +++ b/ros2/internal_state_of_stretch.md @@ -40,4 +40,3 @@ ros2 run rqt_graph rqt_graph The graph allows a user to observe and affirm if topics are broadcasted to the correct nodes. This method can also be utilized to debug communication issues. -**Next Tutorial:** [RViz Basics](rviz_basics.md) diff --git a/ros2/moveit_basics.md b/ros2/moveit_basics.md index d6bc90a..4e828fc 100644 --- a/ros2/moveit_basics.md +++ b/ros2/moveit_basics.md @@ -54,4 +54,3 @@ roslaunch stretch_moveit_config demo_gazebo.launch This will launch an Rviz instance that visualizes the joints with markers and an empty world in Gazebo with Stretch and load all the controllers. There are pre-defined positions for each joint group for demonstration purposes. There are three joint groups, namely stretch_arm, stretch_gripper and stretch_head that can be controlled individually via Motion Planning Rviz plugin. Start and goal positions for joints can be selected similar to [this moveit tutorial](https://ros-planning.github.io/moveit_tutorials/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.html#choosing-specific-start-goal-states). ![image](images/gazebo_moveit.gif) --> -**Next Tutorial:** [Follow Joint Trajectory Commands](follow_joint_trajectory.md) diff --git a/ros2/navigation_stack.md b/ros2/navigation_stack.md index ae5c79d..9048c10 100644 --- a/ros2/navigation_stack.md +++ b/ros2/navigation_stack.md @@ -54,4 +54,3 @@ roslaunch stretch_navigation teleop_keyboard.launch ``` --> -**Next Tutorial:** [MoveIt! Basics](moveit_basics.md) diff --git a/ros2/rviz_basics.md b/ros2/rviz_basics.md index c962868..cdc55ad 100644 --- a/ros2/rviz_basics.md +++ b/ros2/rviz_basics.md @@ -37,4 +37,3 @@ the `rviz` flag will open an RViz window to visualize a variety of ROS topics. Bringup the [keyboard teleop](teleoperating_stretch.md) to drive Stretch and observe its sensor input. -**Next Tutorial:** [Navigation Stack](navigation_stack.md) diff --git a/ros2/teleoperating_stretch.md b/ros2/teleoperating_stretch.md index 4ebde52..3a87c15 100644 --- a/ros2/teleoperating_stretch.md +++ b/ros2/teleoperating_stretch.md @@ -100,4 +100,3 @@ roslaunch stretch_gazebo teleop_joy.launch ``` Note that the teleop_twist_joy package has a deadman switch by default which disables the drive commands to be published unless pressed. For a Logitech F310 joystick, this button is A. -**Next Tutorial:** [Internal State of Stretch](internal_state_of_stretch.md) From a4a2585d0a5ef0c3e865f8b6dc15cb5fc85f9de7 Mon Sep 17 00:00:00 2001 From: hello-chintan Date: Thu, 8 Sep 2022 19:13:01 -0400 Subject: [PATCH 3/3] Burn down TODOs --- ros2/example_2.md | 5 ++--- ros2/example_4.md | 1 - ros2/follow_joint_trajectory.md | 3 +-- ros2/getting_started.md | 7 +++---- ros2/rviz_basics.md | 2 -- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ros2/example_2.md b/ros2/example_2.md index 1ea9dfd..312ed0f 100644 --- a/ros2/example_2.md +++ b/ros2/example_2.md @@ -5,8 +5,7 @@ The aim of this example is to provide instruction on how to filter scan messages. - -For robots with laser scanners, ROS provides a special Message type in the [sensor_msgs](http://wiki.ros.org/sensor_msgs) package called [LaserScan](http://docs.ros.org/en/api/sensor_msgs/html/msg/LaserScan.html) to hold information about a given scan. Let's take a look at the message specification itself: +For robots with laser scanners, ROS provides a special Message type in the [sensor_msgs](https://github.com/ros2/common_interfaces/tree/galactic/sensor_msgs) package called [LaserScan](https://github.com/ros2/common_interfaces/blob/galactic/sensor_msgs/msg/LaserScan.msg) to hold information about a given scan. Let's take a look at the message specification itself: ``` # @@ -14,7 +13,7 @@ For robots with laser scanners, ROS provides a special Message type in the [sens # with Stretch's LiDAR having both angle_min and angle_max facing forward # (very closely along the x-axis) of the device frame # -Header header +std_msgs/Header header # timestamp data in a particular coordinate frame float32 angle_min # start angle of the scan [rad] float32 angle_max # end angle of the scan [rad] float32 angle_increment # angular distance between measurements [rad] diff --git a/ros2/example_4.md b/ros2/example_4.md index 45a4c54..5e71d56 100644 --- a/ros2/example_4.md +++ b/ros2/example_4.md @@ -92,7 +92,6 @@ self.marker.header.stamp = self.get_clock().now().to_msg() self.marker.type = self.marker.SPHERE ``` - Create a maker. Markers of all shapes share a common type. Set the frame ID and type. The frame ID is the frame in which the position of the marker is specified. The type is the shape of the marker. Further details on marker shapes can be found here: [RViz Markers](http://wiki.ros.org/rviz/DisplayTypes/Marker) ```python diff --git a/ros2/follow_joint_trajectory.md b/ros2/follow_joint_trajectory.md index e181701..c7536ed 100644 --- a/ros2/follow_joint_trajectory.md +++ b/ros2/follow_joint_trajectory.md @@ -102,8 +102,7 @@ from control_msgs.action import FollowJointTrajectory from trajectory_msgs.msg import JointTrajectoryPoint from sensor_msgs.msg import JointState ``` - -You need to import rclpy if you are writing a ROS 2 Node. Import the FollowJointTrajectory from the [control_msgs.msg](http://wiki.ros.org/control_msgs) package to control the Stretch robot. Import JointTrajectoryPoint from the [trajectory_msgs](http://wiki.ros.org/trajectory_msgs) package to define robot trajectories. +You need to import rclpy if you are writing a ROS 2 Node. Import the FollowJointTrajectory from the [control_msgs.msg](http://wiki.ros.org/control_msgs) package to control the Stretch robot. Import JointTrajectoryPoint from the [trajectory_msgs](https://github.com/ros2/common_interfaces/tree/galactic/trajectory_msgs) package to define robot trajectories. ```python class StowCommand(Node): diff --git a/ros2/getting_started.md b/ros2/getting_started.md index 8e5a3fe..7434be1 100644 --- a/ros2/getting_started.md +++ b/ros2/getting_started.md @@ -5,16 +5,15 @@ ## Installing Ubuntu 20.04 with ROS 2 Galactic on Stretch Hello Robot utilizes Ubuntu, an open source Linux operating system, for the Stretch RE1 platform. If you are unfamiliar with the operating system, we encourage you to review a [tutorial](https://ubuntu.com/tutorials/command-line-for-beginners#1-overview) provided by Ubuntu. Additionally, the Linux command line, BASH, is used to execute commands and is needed to run ROS on the Stretch robot. Here is a [tutorial](https://ryanstutorials.net/linuxtutorial/) on getting started with BASH. - Instructions on installing Ubuntu 20.04 with ROS Noetic and ROS 2 Galactic can be found in our open source [installation guide](https://github.com/hello-robot/stretch_ros/blob/dev/noetic/install_noetic.md). Following these steps should create a separate Ubuntu 20.04 partition with an ament worskspace created in the home directory. ## ROS 2 Tutorials Setup on Local Computer -Once your system is setup, clone the [stretch_ros_tutorials](https://github.com/hello-sanchez/stretch_ros_tutorials.git) to the src directory of the ament workspace, then build the packages. +Once your system is setup, clone the [stretch_ros_tutorials](https://github.com/hello-sanchez/stretch_ros_tutorials.git) repo to the src directory of the ament workspace, then build the packages. - ``` cd ~/ament_ws/src -git clone https://github.com/hello-sanchez/stretch_ros_tutorials.git +git clone https://github.com/hello-robot/stretch_tutorials.git +git checkout ROS2 cd ~/ament_ws colcon build ``` diff --git a/ros2/rviz_basics.md b/ros2/rviz_basics.md index cdc55ad..e815fdc 100644 --- a/ros2/rviz_basics.md +++ b/ros2/rviz_basics.md @@ -8,7 +8,6 @@ You can utilize RViz to visualize Stretch's sensor information. To begin, run th ros2 launch stretch_core stretch_driver.launch.py ``` - Then run the following command to bring up a simple RViz configuration of the Stretch robot. ```bash ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/rviz/stretch_simple_test.rviz @@ -21,7 +20,6 @@ If you want to visualize Stretch's [tf transform tree](http://wiki.ros.org/rviz/ ![image](https://raw.githubusercontent.com/hello-robot/stretch_tutorials/ROS2/images/rviz_adding_tf.gif) -TODO: Add the correct link for working with rviz2 in ROS 2 There are further tutorials for RViz that can be found [here](http://wiki.ros.org/rviz/Tutorials).