2021-10-28

ROS:新手使用VScode过程中用launch文件进行多节点运行时遇到ERROR: cannot launch node of type

刚刚学ROS,遇到这个问题百度看了以下,用他们 办法解决不了,在我探索一会儿解决了,分享给大家。
下面展示一些 内联代码片

// 

ERROR: cannot launch node of type [hello_vscode/hello _vscode_c]: Cannot locate node of type [hello _vscode_c] in package [hello_vscode]. Make sure file exists in package path and permission is set to executable (chmod +x)

// 
ERROR: cannot launch node of type [hello_vscode/hello _vscode_c]: Cannot locate node of type [hello _vscode_c] in package [hello_vscode]. Make sure file exists in package path and permission is set to executable (chmod +x)

在学习时为了自己弄懂并没有完全根据奥特学院做,他说的是type后面写的是rsc下的那个cpp文件名字,我也就是这样做的,但所运行就有错误,说找不到这个包。原因是CMakeLists.txt这个文件中给文件映射的名字不一样。
下面展示一些 内联代码片

// add_executable(baba src/hello_vscode_c.cpp)
// 
 add_executable(baba src/hello_vscode_c.cpp)

我这里写的是baba所以报出上面的错误,我将type=“baba”,再执行就正常了。

{
auto-starting new master
process[master]: started with pid [26279]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to f439e7fc-37d6-11ec-b58c-3cf01147c0f2
process[rosout-1]: started with pid [26290]
started core service [/rosout]
process[t1-2]: started with pid [26293]
process[key1-3]: started with pid [26299]
process[hello-4]: started with pid [26300]
[ INFO] [1635415690.817274596]: hello,哈哈哈哈
[hello-4] process has finished cleanly
log file: /home/sun/.ros/log/f439e7fc-37d6-11ec-b58c-3cf01147c0f2/hello-4*.log
[t1-2] process has finished cleanly
log file: /home/sun/.ros/log/f439e7fc-37d6-11ec-b58c-3cf01147c0f2/t1-2*.log
}

总结,pkg是你工程的名字, type是你在CMakeLists.txt文件中映射的名字。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值