You're encountering an issue with 'ros2 topic echo /scan' because the topic '/scan' publishes multiple message types: 'radar_msgs/msg/RadarScan' and 'sensor_msgs/msg/LaserScan'. This prevents 'ros2 topic echo' from displaying the data directly.

To view specific message types on the topic, you can use the following command:

ros2 topic echo /scan sensor_msgs/msg/LaserScan

This will subscribe only to the 'LaserScan' messages published on the '/scan' topic. You can similarly use:

ros2 topic echo /scan radar_msgs/msg/RadarScan

To view the 'RadarScan' messages. This allows you to selectively view the data you need.

ROS2 Topic Echo: How to Handle Multiple Message Types

原文地址: https://www.cveoy.top/t/topic/jzsC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录