当前位置:网站首页>ROS知识点——使用VScode搭建ROS开发环境
ROS知识点——使用VScode搭建ROS开发环境
2022-06-28 15:04:00 【Jerry_Sea】
参考:https://blog.csdn.net/qq_42688495/article/details/107750466
bug1: 配置c_cpp_properties.json
{
"configurations": [
{
"browse": {
"databaseFilename": "${workspaceFolder}/.vscode/browse.vc.db",
"limitSymbolsToIncludedHeaders": false
},
"includePath": [
"/opt/ros/melodic/include/**",
// "/home/wuhd/catkin_ws/src/dcl_driver/include/**",
// "/home/wuhd/ws/src/learning/include/**",
// "/home/wuhd/catkin_ws/src/multi_lidar_calibration/include/**",
"/usr/include/**"
],
"name": "ROS",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "c++14"
}
],
"version": 4
}
bug2:找不到ros/ros.h和std_msgs/String.h
我配置的时候,没有在build文件夹下生成compile_commands.json文件,因为可以找到ros/ros.h和std_msgs/String.h
bug3:按住Fn+F5启动调试,就会生成launch.json
如果无法生成,手动在项目目录下创建.vscode文件夹,以及.vscode/launch.json文件
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/devel/lib/cal/cal",// 表示可执行程序所在的路径,其中,${workspaceRoot}表示VScode加载的文件夹的根目录
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "catkin_make"
}
]
}
bug4:按住Fn+F1创建tasks.json文件
随便选择一个,然后修改tasks.json文件内容;
如果无法生成, 手动创建
{
"version": "2.0.0",
"tasks": [
{
"label": "catkin_make", //代表提示的描述性信息
"type": "shell", //可以选择shell或者process,如果是shell代码是在shell里面运行一个命令,如果是process代表作为一个进程来运行
"command": "catkin_make",//这个是我们需要运行的命令
"args": ["-DCMAKE_EXPORT_COMPILE_COMMANDS=1"],//如果需要在命令后面加一些后缀,可以写在这里,比如-DCATKIN_WHITELIST_PACKAGES=“pac1;pac2”
"group": {"kind":"build","isDefault":true},
"presentation": {
"reveal": "always"//可选always或者silence,代表是否输出信息
},
"problemMatcher": "$msCompile"
},
]
}
bug5:结果测试时报错
[ERROR] [1656318039.735840529]: [registerPublisher] Failed to contact master at [localhost:11311]. Retrying…
开一个终端运行,运行roscore即可。
bug6: 自己生成的项目
边栏推荐
- Combined sum leetcode
- Seata数据库中出现以下问题要怎么解决啊?
- R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果横向构成新的结果可视化组合图(使用|符号)
- 324. swinging sort II: not a simple construction problem
- 解决Unable to create process using ‘D:\Program File
- With 120billion yuan, she will ring the bell for IPO again
- Kwai investment e-commerce service provider Yixin optimization
- 5000倍回报,南非报业投资腾讯赚了一个省
- 从莫高窟到太平洋,海量数据找到了新家园
- The boss told me three times: low key, low key, low key
猜你喜欢

坐拥1200亿,她又要IPO敲钟了

Recommended practice sharing of Zhilian recruitment based on Nebula graph

Facebook! Adaptive gradient defeats manual parameter adjustment

After nearly 20 years of operation, the Mars probe software based on win 98 has been upgraded for the first time

Q-Tester 3.2:适用于开发、生产和售后的诊断测试软件

dolphinscheduler2.X的安装(亲测有效)

C#/VB.NET 将PDF转为Excel
![[C language] nextday problem](/img/7b/422792e07dd321e3a37c1fff55c0ca.png)
[C language] nextday problem
![[C language] implementation of binary tree and three Traversals](/img/9f/384a73fb82265a76fc5eef884ce279.png)
[C language] implementation of binary tree and three Traversals

美国乔布斯,殁了;中国乔布斯,卖了
随机推荐
Q-tester 3.2: applicable to development, production and after-sales diagnostic test software
Rails advanced -- framework theory cognition and construction scheme construction (I)
[C language] how to generate normal or Gaussian random numbers
R语言ggplot2可视化:patchwork包将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图、两个可视化的组合结果对齐、并为组合图像的每个子图添加标题
[MySQL learning notes 24] index design principles
环保产品“绿色溢价”高?低碳生活方式离人们还有多远
Tencent was underweight again by prosus, the major shareholder: the latter also cashed out $3.7 billion from JD
雷科防务:4D毫米波雷达产品预计可以在年底量产供货
腾讯再遭大股东Prosus减持:后者还从京东套现37亿美元
组合总和-Leetcode
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和数据表格横向组合起来形成最终结果图
Yiwen teaches you to quickly generate MySQL database diagram
With 120billion yuan, she will ring the bell for IPO again
How to solve the following problems in the Seata database?
halcon 基础总结(一)裁切图片并旋转图像
MySQL主从切换的超详细步骤
Not being a meta universe now is like not buying a house 20 years ago!
What are the benefits of this PMP certificate?
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Summary of technical difficulties of wearable neural signal and behavior data detection and recording system for birds in flight