This repository holds ROS 2 Jazzy packages for the Stretch 4 mobile manipulator from Hello Robot Inc. On a fresh robot, these packages are built and available through the ~/ament_ws workspace.
Stretch 4 ROS packages contain breaking changes from Stretch 3 and earlier hardware versions. ROS packages for earlier versions can be found in stretch_ros2.
| Resource | Description |
|---|---|
| stretch_core | ROS 2 drivers for Stretch 4 |
| stretch_description | Visualize Stretch 4's URDF |
| stretch_nav2 | Navigation stack built on Nav2 |
| stretch_simulation | Simulation of Stretch 4, built on Stretch4 Mujoco |
| stretch_tag_perception | Detect aruco tags with Stretch 4 |
| stretch_python_bridge | A high-level Python API that abstracts away rclpy |
| hello_helpers | Miscellaneous helper code used across the stretch_ros2 repository |
For license details for this repository, see the LICENSE files found in the directories. A summary of the licenses follows:
| Directory | License |
|---|---|
| stretch_core | Apache 2.0 |
| stretch_description | BSD 3-Clause Clear License |
| stretch_nav2 | Apache 2.0 |
| stretch_simulation | Apache 2.0 |
| stretch_tag_perception | Apache 2.0 |
| stretch_python_bridge | Apache 2.0 |
| hello_helpers | Apache 2.0 |
Below is an unordered list of common or useful ROS2 commands:
- Start Stretch Driver:
ros2 launch stretch_core stretch_driver.launch.py- Teleop twist keyboard:
ros2 run teleop_twist_keyboard teleop_twist_keyboard
- Teleop twist keyboard:
- Start Lidars:
ros2 launch stretch_core dual_hesai.launch.py - Start Cameras:
ros2 launch stretch_core luxonis.launch.py use_center:=true use_left:=true use_right:=truefor the head cameras andros2 launch stretch_core gripper_camera.launch.pyfor the gripper camera. - Navigation (See https://docs.hello-robot.com/stretch4_docs/working-with-stretch/getting-started/demo-mapping-and-navigation#set-a-navigation-goal):
- Start Mapping:
ros2 launch stretch_nav2 offline_mapping.launch.pyandstretch_gamepad_teleop - Save a map:
ros2 run nav2_map_server map_saver_cli -f ${HELLO_FLEET_PATH}/maps/<map_name> - Start nav2:
ros2 launch stretch_nav2 navigation_mppi.launch.py map:=${HELLO_FLEET_PATH}/maps/<map_name>.yaml
- Start Mapping:
- Web teleop (See https://docs.hello-robot.com/stretch4_docs/working-with-stretch/getting-started/demo-web-teleoperation):
~/ament_ws/src/stretch4_web_teleop/launch_interface.shand navigate tohttps://localhost/operator - Record rosbags/mcap files:
ros2 bag record -a. Note:-arecords all the topics, if lidar and cameras are streaming, a few minutes of recording are hundreds of gigabytes large.- Play rosbags/mcap files:
ros2 bag play ./path/to/recording
- Play rosbags/mcap files:
- View topics:
ros2 topic listandros2 topic echo /joint_states - View kinematic links:
ros2 run tf2_tools view_frames- View transform between two links:
ros2 run tf2_ros tf2_echo base_link head_link
- View transform between two links:
Zenoh should start as a linux user service on Stretch 4. Run systemctl --user status zenoh.service to see if it has failed to start. Run systemctl --user restart zenoh.service to restart it.
If you would like to manually start it, use ros2 run rmw_zenoh_cpp rmw_zenohd.
There is a known conflict between opencv and rviz2 in ROS2 Jazzy that is documented and a solution is proposed here: #19
There are a number of reasons for topics to not appear.
- Check that you are running the ros2 node and the client on the same computer. If you are trying to connect from a different computer, you may need to add the following environment variables to your client session:
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
# Replace ROBOT_IP with your Stretch's IP address
ROBOT_IP=192.168.X.XXX
export ZENOH_CONFIG_OVERRIDE='mode="client";connect/endpoints=["tcp/$ROBOT_IP:7447"]'
- Stretch 4 is configured with
export RMW_IMPLEMENTATION=rmw_zenoh_cppin the .bashrc file to tell ROS2 to use the Zenoh middleware. Make sure your terminal session with this env variable. - Use
ros2 topic listto list topics. Also,ros2 topic echo /joint_statesto listen to a topic - Check that the TF tree has all the links:
ros2 run tf2_tools view_frames