6.ROS2-topic

文章目录

终端中的topic操作

bash 复制代码
# 可以查看主题的信息
ros2 topic info /robot_news
# ros2终端也是一个订阅者
ros2 topic echo /robot_news
# 查看接口
ros2 interface show <Type>
ros2 interface show example_interfaces/msg/String
# 会显示一些关键词 datatype
# 消息终端的频率
ros2 topic hz /robot_news
# 消息的带宽
ros2 topic bw /robot_news
# 发布主题 -r 是rate -r 5 表示 
ros2 topic pub -r 5 /robot_news example_interfaces/msg/String "{data: 'hello from the terminal'}"

重命名(remap) topic

bash 复制代码
# 更改节点名称
ros2 run my_py_pkg robot_news_station --ros-args -r __node:=my_station
# 更改主题名称
ros2 run <pkg_name> <node_name> --ros-args -r <topic_name>:=<new_topic_name>
# 例子,同时更改主题和节点
ros2 run my_py_pkg robot_news_station --ros-args -r __node:=my_station -r robot_news:=abc

用RQT检测topic

bash 复制代码
# 打开rqt图形界面
rqt-graph 
相关推荐
爱凤的小光5 天前
ROS Service ---个人学习篇
ros
绍磊leo9 天前
ROS2 交互式调试工具:告别繁琐的命令行操作
ros
kobesdu9 天前
连接大模型与物理机器人-RoboNeuron让机器人真正“听懂人话”
机器人·开源·ros·人形机器人
kobesdu9 天前
【ROS2实战笔记-13】Foxglove Studio:ROS可视化工具的另一条路
笔记·机器人·自动驾驶·ros
kobesdu10 天前
【ROS2实战笔记-12】rosshow:终端里的盲文可视化与无头机器人的现场调试
笔记·机器人·ros·移动机器人
txz203511 天前
2,使用功能包组织C++节点
开发语言·c++·ros
dragen_light14 天前
2.ROS2-Packages
ros
dragen_light14 天前
1.ROS2-Install
c++·python·ros
dragen_light14 天前
3.ROS2-Nodes
ros