For the complete documentation index, see llms.txt. This page is also available as Markdown.

Accessing the Lidars

Stretch 4 has two hemispherical lidars in the head. Each lidar yields 115,200 points per frame at 10 Hz (1,152,000 points/second).

This document will cover:

Visualizing The Lidars With ROS2

In your terminal, start these launch files:

Terminal 1:

ros2 launch stretch_core stretch_driver.launch.py

Terminal 2:

ros2 launch stretch_core dual_hesai.launch.py use_rviz:=true

The latter command will start rviz2, with a live visualization of the lidars aligned using the urdf.

image

dual_hesai.launch.py is a launch file that lives on the robot at ~/ament_ws/src/stretch4_ros2/stretch_core/launch. A preview of the file can be found here.

Using The Lidars In Your Code With ROS2

The dual_hesai.launch.py launch file will publish two PointCloud2 topics:

  • /lidar_points_left

  • /lidar_points_right

You can subscribe to these topics in your ROS2 node to receive point cloud points.

Visualizing The Lidars With Python

To access the lidars using python, use stretch4_pyhesai_wrapper.

In your terminal, launch:

This will start a Rerun window with the raw, untransformed points from each lidar.

image

Using The Lidars In Your Code With Python

Similar to the Camera API, stretch4_pyhesai_wrapper offers a Stream API that allows you to access lidar points using a python Generator:

Last updated

Was this helpful?