ROS中launch文件的type和name的区别

ROS系统中,type指定节点的可执行文件名,如demo_hello,而name定义节点的运行时名称。在launch文件中,可以使用name参数重写节点名,如将talker改为bar,这将覆盖代码中原有的节点名。启动文件提供了动态配置节点名字的能力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • type是节点文件的名称,如对demo_hello.cpp节点,type="demo_hello"
  • name是节点的名称,如在语句 ros::init(argc,argv,"talker");中 ,name="talker",如果在launch文件中将name设为其他名称"bar",那即便代码里写的是"talker",也会被覆盖为"bar"

pkg/type/name: The argument pkg points to the package associated with the node that is to be launched, while “type” refers to the name of the node executable file. It is also possible to overwrite the name of the node with the name argument, this will take priority over the name that is given to the node in the code.

参考链接:LAUNCH FILES

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值