当前位置:网站首页>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: 自己生成的项目
边栏推荐
- 名创优品通过上市聆讯:寻求双重主要上市 年营收91亿
- code snippet
- 智能化转型被加速,企业需要新的工具箱
- How to solve the following problems in the Seata database?
- Seata数据库中出现以下问题要怎么解决啊?
- R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果横向构成新的结果可视化组合图(使用|符号)
- Spacetutorial (continuous updating...)
- Steve Jobs of the United States, died; China jobs, sold
- Rails advanced -- framework theory cognition and construction scheme construction (I)
- After QQ was stolen, a large number of users "died"
猜你喜欢
字节跳动埋点数据流建设与治理实践
PMP真的有用吗?
Angers medical sprint scientific innovation board: annual revenue of RMB 300million and proposed fund raising of RMB 770million
第四大运营商,难成「鲶鱼」
安杰思医学冲刺科创板:年营收3亿 拟募资7.7亿
[C language] nextday problem
Facebook! Adaptive gradient defeats manual parameter adjustment
Construction and management practice of ByteDance buried point data flow
Leetcode 705. Design hash collection
快手投资电商服务商易心优选
随机推荐
Combined sum leetcode
High "green premium" of environmental protection products? How far is the low-carbon lifestyle from people
云杉网络DeepFlow帮助5G核心网和电信云构建可观测性
dolphinscheduler2.X的安装(亲测有效)
美国乔布斯,殁了;中国乔布斯,卖了
买卖股票的最佳时机
sent2vec教程
Classmate Zhang hasn't learned to be an anchor yet
BatchNorm2d原理、作用及其pytorch中BatchNorm2d函数的参数讲解
Summary of technical difficulties of wearable neural signal and behavior data detection and recording system for birds in flight
抽奖动画 - 鲤鱼跳龙门
[spatial & single cellomics] phase 1: Study on PDAC tumor microenvironment by single cell binding spatial transcriptome
Rails进阶——框架理论认知与构建方案建设(一)
智能化转型被加速,企业需要新的工具箱
代码片段
【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境
Youju new material rushes to Shenzhen Stock Exchange: it plans to raise 650million yuan, with an annual revenue of 333million yuan
Does Frankfurt currently support SQL?
PMP真的有用吗?
PMP认证证书的续证费用是多少?