ROS2常用命令工具

ROS2常用命令工具

包管理工具ros2 pkg

ros2 pkg create

ros2 pkg create --build-type ament_python pkg_name rclpy std_msgs sensor_msgs  

–build-type : C++或者C ament_cmake ,Python ament_python

pkg_name :创建功能包的名字

rclpy std_msgs sensor_msgs :编译依赖

ros2 pkg list

查看系统中功能包列表

ros2 pkg executeables

查看包内可执行文件列表

ros2 pkg executables pkg_name

节点运行 ros2 run

运行功能包节点程序

ros2 run pkg_name node_name  

pkg_name:功能包名字
node_name:可执行程序的名字

节点相关工具 ros2 node

ros2 node list

罗列出所有在当前域内节点名称

ros2 node list

ros2 node info

查看节点详细信息,包括订阅、发布的消息,开启的服务和动作等

ros2 node info node_name

主题相关工具 ros2 topic

ros2 topic list

罗列出当前域内的所有主题

ros2 topic list

ros2 topic info

显示主题消息类型,订阅者/发布者数量

ros2 topic info topic_name

ros2 topic type

查看话题的消息类型

ros2 topic type topic_name

ros2 topic hz

显示主题平均发布频率

ros2 topic hz topic_name

ros2 topic echo

在终端打印主题消息,类似于一个订阅者

ros2 topic echo topic_name

ros2 topic pub

在终端发布指定话题消息

ros2 topic pub topic_name message_type message_content

topic_name:需要发布话题消息的话题的名字

message_type:话题的数据类型

message_content:消息内容

接口相关工具ros2 interface

ros2 interface list

罗列当前系统的所有接口,包括话题、服务、动作。

ros2 interface list

ros2 interface show

ros2 interface show interface_name

ros2 interface show interface_name

服务相关工具 ros2 service

ros2 service list

罗列出当前域内所有的服务

ros2 interface show interface_name

ros2 service call

调用指定服务

ros2 interface call service_name service_Type arguments

service_name:需要调用的服务

service_Type:服务数据类型

arguments:提供服务需要的参数

  • 6
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

计算机小混子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值