Sensors
The Robotont platform includes an Intel RealSense D435i 3D camera, capable of streaming both regular color images and depth data. These camera feeds are available automatically as soon as the robot is turned on.
Setup
Clone the depthimage_to_laserscan package into your workspace and build:
cd ~/<your_colcon_workspace_name>/src git clone https://github.com/ros-perception/depthimage_to_laserscan.git --branch ros2 colcon build
Setup distributed ROS 2 as shown here: Distributed ROS 2
Establish an SSH connection between the robot and the PC as shown here: SSH
Displaying the camera feed
Getting distances from objects
The depthimage_to_laserscan node converts the RealSense camera’s depth image into a 2D LaserScan message, which you can use to estimate distances to objects directly in front of the robot.
Launch the depthimage_to_laserscan node on the Robotont or your PC:
ros2 run depthimage_to_laserscan depthimage_to_laserscan_node
Hint
Make sure the parameters for the depth image topic and camera info match your camera’s output, e.g.:
ros2 run depthimage_to_laserscan depthimage_to_laserscan_node \ --ros-args \ --remap depth:=/camera/depth/image_raw \ --remap depth_camera_info:=/camera/color/camera_info
Visualize and analyze the LaserScan data:
Option 1: Rviz2
Click on Add and select LaserScan. In the LaserScan Topic field, select /scan
Gazebo simulation
Rviz2 LaserScan visualization
Option 2: View raw data
In Terminal:
ros2 topic echo /scan
- The messages are of type
sensor_msgs/LaserScan— see its structure on the ROS 2 sensor_msgs/LaserScan documentation
- The messages are of type
