ros2 topic命令行
查看topic输出: ros2 topic echo <topic_name>
查看topic频率:ros2 topic hz <topic_name>
查看有哪些topic:ros2 topic list
查看每个topic及其message type:ros2 topic list -t
在某个topic上使用命令行pub数据:
- 按默认周期发送:
ros2 topic pub <topic_name> <msg_type> '<args>'
注意,args要使用yaml格式 - 只发送一次:
ros2 topic pub --once <topic_name> <msg_type> '<args>'
- 按指定周期发送:
ros2 topic pub --rate 1 <topic_name> <msg_type> '<args>'