Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 35 additions & 30 deletions mkdocs_rt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,38 +82,43 @@ extra:


nav:
- Getting Started: ./getting_started.md
- Motion Commands: ./jogging.md
- Robot Drivers: ./robot_drivers.md
# - Writing Nodes: ./writing_nodes.md # TODO
- Navigation with Nav2:
- Overview: ./README.md
- Creating Packages & Nodes: ./writing_nodes.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Simulation Tutorial: ./stretch_simulation.md
- Teleoperation: ./teleoperating_stretch.md
- RViz Tutorial: ./rviz_basics.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rviz tutorial is missing how to visualize points clouds, imagery, lidar, etc.
https://github.com/hello-robot/stretch_tutorials/blob/feature/ros2-nav/ros2/rviz_basics.md

- Follow Joint Trajectory & Joint States: ./follow_joint_trajectory.md
- Motion Commands via hello_utils: ./jogging.md
Comment on lines +93 to +94
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's combine these two.

- Robot Driver: ./robot_drivers.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move the sensor stuff into sensors_tutorial.md

- Twist Control: ./twist_control.md
- Sensors Tutorial: ./sensors_tutorial.md
- Nav Stack Tutorial:
- Overview: ./navigation_overview.md
- Nav2 Basics: ./navigation_stack.md
- Nav2 Simple Commander: ./navigation_simple_commander.md
# - Manipulation with MoveIt2: # TODO
# - MoveIt Basics: ./moveit_basics.md # TODO
# - MoveIt with RViz: ./moveit_rviz_demo.md # TODO
# - MoveGroup C++ API: ./moveit_movegroup_demo.md # TODO
- FUNMAP: https://github.com/hello-robot/stretch_ros2/tree/humble/stretch_funmap#overview
# - Mapping: ./writing_nodes.md #TODO
# - Navigation: ./writing_nodes.md #TODO
# - Manipulation: ./writing_nodes.md # TODO
- Perception: ./perception.md
- Perception Tutorial: ./perception.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge this into rviz_basics.md

- Deep Perception: ./deep_perception.md
- ArUco Markers: ./aruco_marker_detection.md
- Offloading Computation Tutorial: ./remote_compute.md
- Autonomy Demos:
- Hello World: ./demo_hello_world.md
- Grasp Object: ./demo_grasp_object.md
- Handover Object: ./demo_handover_object.md
- Open Drawer: ./demo_open_drawer.md
- Surface Cleaning: ./demo_surface_cleaning.md
- FUNMAP Tutorial: ./funmap_tutorial.md
- Examples:
- Move Stretch with Twist Controller: ./example_1.md
- Trajectory Control: ./follow_joint_trajectory.md
- Voice Teleop: ./voice_teleop.md
- Speech to Text: ./speech_to_text.md
- Lidar Based Sensing: ./lidar_filtering.md
- Custom RViz Marker: ./rviz_markers.md
- Effort Value Plotting: ./joint_effort_plotting.md
- Tf2 Listener and Broadcaster: ./tf2_transforms.md
- Realsense Camera: ./realsense_camera.md
- Align to ArUco Tutorial: ./align_to_aruco.md
- ArUco Locator: ./aruco_locator.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge aruco_locator.md and aruco_marker_detection.md

- Joint States: ./joint_states.md
- Collision Avoidance: ./collision_avoidance.md
- Obstacle Avoidance: ./obstacle_avoider.md
- Collision Avoidance: ./example_3.md
- Rviz Markers: ./example_4.md
- Offloading Computation: ./remote_compute.md
- Align to ArUco: ./ros2/align_to_aruco.md
- ArUco Locator: ./example_12.md
- Joints:
- Joint States: ./example_5.md
- Static Transformations: ./example_10.md
- Joint Effort: ./example_6.md
- Deep Perception: ./ros2/deep_perception.md
- Filter Laser Scans: ./example_2.md
- Realsense Camera: ./example_7.md
- Microphones: ./example_8.md
- Voice Teleop: ./example_9.md


75 changes: 42 additions & 33 deletions ros2/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
![](../images/banner.png)
# Tutorial Track: Stretch ROS 2 (Beta)
# Tutorial Track: Stretch ROS 2

This tutorial series covers writing ROS 2 software for Stretch. ROS 2 programs can be written in a variety of programming languages, but this series uses Python. We'll write programs that enable Stretch to navigate autonomously in its environment, manipulate objects with Stretch's gripper, perceive its environment, and much more.

## Prerequisites

Ensure that:

1. Your Stretch has the latest robot distribution installed
- These tutorials were written for the latest robot distribution. Take a look at the [Distributions & Roadmap](../../software/distributions/) guide to identify your current distribution and upgrade if necessary.
2. You are comfortable developing with Stretch
- If you've never developed with Stretch before or are new to programming, check out the [Developing with Stretch](../../developing/basics/) tutorial series. In particular, the [Using ROS 2 with Stretch](#TODO) tutorial from that series is a good resource for those new to ROS 2.

## Robot Operating System 2 (ROS 2)

Expand All @@ -16,44 +27,42 @@ This tutorial track is for users looking to get familiar with programming Stretc

| | Tutorial | Description |
|--|---------------------------------------------------------------------------------|----------------------------------------------------|
| 1 | [Getting Started](getting_started.md) | Setup instructions for ROS 2 on Stretch|
| 2 | [Introduction to ROS 2](intro_to_ros2.md.md) | Explore the client library used in ROS2 |
| 3 | [Introduction to HelloNode](intro_to_hellonode.md) | Explore the Hello Node class to create a ROS2 node for Stretch |
| 4 | [Teleoperating Stretch](teleoperating_stretch.md) | Control Stretch with a Keyboard or a Gamepad controller. |
| 5 | [Internal State of Stretch](internal_state_of_stretch.md) | Monitor the joint states of Stretch. |
| 6 | [RViz Basics](rviz_basics.md) | Visualize topics in Stretch. |
| 7 | [Nav2 Stack](navigation_overview.md) | Motion planning and control for mobile base. |
| 8 | [Follow Joint Trajectory Commands](follow_joint_trajectory.md) | Control joints using joint trajectory server. |
| 9 | [Perception](perception.md) | Use the Realsense D435i camera to visualize the environment. |
| 10 | [ArUco Marker Detection](aruco_marker_detection.md) | Localize objects using ArUco markers. |
| 11 | [ReSpeaker Microphone Array](respeaker_mic_array.md) | Learn to use the ReSpeaker Microphone Array. |
| 12 | [FUNMAP](https://github.com/hello-robot/stretch_ros2/tree/humble/stretch_funmap) | Fast Unified Navigation, Manipulation and Planning. |
<!--| 5 | [MoveIt2 Basics](moveit_basics.md) | Motion planning and control for the arm using MoveIt. |
| 6 | [MoveIt2 with Rviz](moveit_rviz_demo.md) | Motion planning and control for the arm using MoveIt. |
| 7 | [MoveIt2 MoveGroup C++ API](moveit_movegroup_demo.md) | Motion planning and control for the arm using MoveIt. |
| 13 | [ROS testing](coming_soon.md) | Write ROS system tests for introspection. |
| 14 | [Other Nav Stack Features](coming_soon.md) | Advanced features for Nav 2. | -->
| 1 | [Creating your own package, launch files, nodes](writing_nodes.md) | Setup instructions for ROS 2 on Stretch|
| 2 | [Simulation Tutorial](stretch_simulation.md) | Explore the client library used in ROS2 |
| 3 | [Teleoperating Stretch](teleoperating_stretch.md) | Control Stretch with a Keyboard or a Gamepad controller. |
| 4 | [RViz Basics](rviz_basics.md) | Visualize topics in Stretch. |
| 5 | [Follow Joint Trajectory Commands](follow_joint_trajectory.md) | Control joints using joint trajectory server. |
| 6 | [Introduction to HelloNode](intro_to_hellonode.md) | Explore the Hello Node class to create a ROS2 node for Stretch |
| 7 | [Robot Driver](robot_drivers.md) | ROS2 Wrapper for the python API. |
| 8 | [Twist Control](twist_control.md) | Using Twist messages to control the mobile base. |
| 9 | [Sensors](sensors_tutorial.md) | Stretch sensors including the ReSpeaker microphone array, IMU, bump sensors, and cliff sensors. |
| 10 | [Nav2 Stack](navigation_overview.md) | Motion planning and control for mobile base. |
| 11 | [Perception](perception.md) | Use the Realsense D435i camera to visualize the environment. |
| 12 | [Deep Perception](deep_perception.md) | Perception using Deep Learning. |
| 13 | [ArUco Marker Detection](aruco_marker_detection.md) | Localize objects using ArUco markers. |
| 14 | [Offloading Computation Tutorial](remote_compute.md) | Offloading computationally intensive processes. |
| 15 | [Avoiding Race Conditions and Deadlocks](avoiding_deadlocks_race_conditions.md) | Learn how to avoid Race Conditions and Deadlocks |
| 16 | [Autonomy Demos](demo_hello_world.md) | A few demos showcasing Stretch's autonomous capabilities. |
| 17 | [FUNMAP](https://github.com/hello-robot/stretch_ros2/tree/humble/stretch_funmap) | Fast Unified Navigation, Manipulation and Planning. |



## Other Examples
To help get you started on your software development, here are examples of nodes to have Stretch perform simple tasks.


| | Tutorial | Description |
|---|-------------------------------------------------|----------------------------------------------------|
| 1 | [Mobile Base Velocity Control](example_1.md) | Use a python script that sends velocity commands. |
| 2 | [Filter Laser Scans](example_2.md) | Publish new scan ranges that are directly in front of Stretch.|
| 3 | [Mobile Base Collision Avoidance](example_3.md) | Stop Stretch from running into a wall.|
| 4 | [Give Stretch a Balloon](example_4.md) | Create a "balloon" marker that goes where ever Stretch goes.|
| 5 | [Print Joint States](example_5.md) | Print the joint states of Stretch.|
| 6 | [Store Effort Values](example_6.md) | Print, store, and plot the effort values of the Stretch robot.|
| 7 | [Capture Image](example_7.md) | Capture images from the RealSense camera data.|
| 8 | [Voice to Text](example_8.md) | Interpret speech and save transcript to a text file.|
| 9 | [Voice Teleoperation of Base](example_9.md) | Use speech to teleoperate the mobile base.|
| 10 | [Tf2 Broadcaster and Listener](example_10.md) | Create a tf2 broadcaster and listener.|
| 11 | [ArUco Tag Locator](example_12.md) | Actuate the head to locate a requested ArUco marker tag and return a transform.|
| 1 | [Voice to Text](speech_to_text.md) | Interpret speech and save transcript to a text file.|
| 2 | [Voice Teleoperation of Base](voice_teleop.md) | Use speech to teleoperate the mobile base.|
| 3 | [Filter Laser Scans](lidar_filtering.md) | Publish new scan ranges that are directly in front of Stretch.|
| 4 | [Give Stretch a Balloon](rviz_markers.md) | Create a "balloon" marker that goes where ever Stretch goes.|
| 5 | [Align to ArUco](align_to_aruco.md) | Detect ArUco fiducials using OpenCV and align to them.|
| 6 | [ArUco Tag Locator](aruco_locator.md) | Actuate the head to locate a requested ArUco marker tag and return a transform.|
| 7 | [Print Joint States](joint_states.md) | Print the joint states of Stretch.|
| 8 | [Store Effort Values](joint_effort_plotting.md) | Print, store, and plot the effort values of the Stretch robot.|
| 9 | [Tf2 Broadcaster and Listener](tf2_transforms.md) | Create a tf2 broadcaster and listener.|
| 10 | [Capture Image](realsense_camera.md) | Capture images from the RealSense camera data.|
| 11 | [Mobile Base Collision Avoidance](collision_avoidance.md) | Stop Stretch from running into a wall.|
| 12 | [Obstacle Avoider](obstacle_avoider.md) | Avoid obstacles using the planar lidar. |
| 13 | [Align to ArUco](align_to_aruco.md) | Detect ArUco fiducials using OpenCV and align to them.|
| 14 | [Deep Perception](deep_perception.md) | Use YOLOv5 to detect 3D objects in a point cloud.|
| 15 | [Avoiding Race Conditions and Deadlocks](avoiding_deadlocks_race_conditions.md) | Learn how to avoid Race Conditions and Deadlocks |
<!--| 11 | [PointCloud Transformation](example_11.md) | Convert PointCloud2 data to a PointCloud and transform to a different frame.| -->

2 changes: 1 addition & 1 deletion ros2/align_to_aruco.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Stretch comes preconfigured to identify ArUco markers. The ROS node that enables

## Computing Transformations

If you have not already done so, now might be a good time to review the [tf listener](https://docs.hello-robot.com/latest/ros2/example_10/) tutorial. Go on, we can wait...
If you have not already done so, now might be a good time to review the [tf listener](https://docs.hello-robot.com/latest/ros2/tf2_transforms/) tutorial. Go on, we can wait...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove stuff like "Go on, we can wait..."

Now that we know how to program stretch to return the transform between known reference frames, we can use this knowledge to compute the transform between the detected marker and the robot's base_link. From its current pose, for Stretch to align itself in front of the marker, we need to command it to reach there. But even before that, we need to program Stretch to know the goal pose. We define the goal pose to be 0.75 meter outward from the marker in the marker negative y-axis (Green axis). This is easier to visualize through the figure below.

<p align="center">
Expand Down
1 change: 1 addition & 0 deletions ros2/example_12.md → ros2/aruco_locator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ArUco Locator

For this example, we will send follow joint trajectory commands for the head camera to search and locate an ArUco tag. In this instance, a Stretch robot will try to locate the docking station's ArUco tag.

## Modifying Stretch Marker Dictionary YAML File
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions ros2/funmap_tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# FUNMAP Tutorial

{%
include-markdown "https://raw.githubusercontent.com/hello-robot/stretch_ros2/refs/heads/humble/stretch_funmap/README.md"
rewrite-relative-urls=false
%}
37 changes: 0 additions & 37 deletions ros2/gazebo_basics.md

This file was deleted.

27 changes: 0 additions & 27 deletions ros2/getting_started.md

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions ros2/example_5.md → ros2/joint_states.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Example 5

In this example, we will review a Python script that prints out the positions of a selected group of Stretch joints. This script is helpful if you need the joint positions after you teleoperated Stretch with the Xbox controller or physically moved the robot to the desired configuration after hitting the run stop button.

If you are looking for a continuous print of the joint states while Stretch is in action, then you can use the [ros2 topic command-line tool](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.html) shown in the [Internal State of Stretch Tutorial](https://github.com/hello-robot/stretch_tutorials/blob/master/ros2/internal_state_of_stretch.md).
Expand Down
1 change: 1 addition & 0 deletions ros2/example_2.md → ros2/lidar_filtering.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

## Example 2

!!! note
ROS 2 tutorials are still under active development.

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions ros2/example_4.md → ros2/rviz_markers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

## Example 4

!!! note
ROS 2 tutorials are still under active development.

Expand Down
Loading