ROS-vscode:helloworld

《看山是山》视觉导航技术系列


学术方向改成了视觉惯性导航技术,打算从学习VINS-mono技术开始。
首先完成ROS系统的使用。
完成第一个ROS工程:helloworld
使用系统:ubuntu18.04
使用软件:vscode2019

使用VScode搭建ROS开发环境

参考鬼木士的博客创建hellowworld,出现以下问题:

  1. 没有生成exe可执行文件
  2. 没有生成相应的package包
  3. 在output里面出现警告:[2021/4/11 下午3:45:48] 在“${workspaceFolder}/build/compile_commands.json”中未找到“helloworld.cpp”。此文件将改用文件夹“test_ros”中来自 c_cpp_properties.json 的 “includePath”。

对于问题三:
在c_cpp_properties.json文件中手动添加 ros工作区的环境,可以消除这个警告
重新编译的话 rospack list可以看到编译得到helloworld软件包
然而
运行:

roscore
rosrun helloworld helloworld

报错:

[rosrun] Couldn't find executable named helloworld below /home/nbwang/project/test_ros/src/helloworld

参考博主qqLML_ZR 说明:
ros入门程序,报错 Couldn‘t find executable named hello below /home/c415/desktop/test/src
原有生成的可执行文件在${workspaceFolder}/build
把生成的可执行文件复制在 ${workspaceFolder}/devel/lib中
再次运行即可成功

——————
不做代码生成者,只做代码搬运工
感谢以上两位大佬qqLML_ZR 和**[鬼木士的博文提供参考。

ROAS+VScode

Predefined variables#

The following predefined variables are supported:

${workspaceFolder} - the path of the folder opened in VS Code
${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/)
${file} - the current opened file
${fileWorkspaceFolder} - the current opened file's workspace folder
${relativeFile} - the current opened file relative to workspaceFolder
${relativeFileDirname} - the current opened file's dirname relative to workspaceFolder
${fileBasename} - the current opened file's basename
${fileBasenameNoExtension} - the current opened file's basename with no file extension
${fileDirname} - the current opened file's dirname
${fileExtname} - the current opened file's extension
${cwd} - the task runner's current working directory on startup
${lineNumber} - the current selected line number in the active file
${selectedText} - the current selected text in the active file
${execPath} - the path to the running VS Code executable
${defaultBuildTask} - the name of the default build task
${pathSeparator} - the character used by the operating system to separate components in file paths
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值