Ubuntu中vscode如何选择ROS版本

Ubuntu中可能安装了多个ROS版本,比如ROS1 noetic, ROS2 foxy, humble等。有时候需要在vscode中对ROS程序进行debug,一般会先安装ROS插件。当电脑上有多个ROS版本时,选择Debug中选择ROS:Launch ROS:Attach(ROS1)或者ROS:Debug Launch File(ROS2)时,会没有反应,并且会提示:vscode unable to deteremine the ros distribution。这是因为系统中有多个ROS版本,vscode中ROS插件不知道选哪个版本。这个时候在.vscode目录中新建settings.json文件,内容如下:

bash 复制代码
{
    "ros.distro": "foxy", #ros版本
    "ros.rosSetupScript": "/opt/ros/foxy/install/setup.bash",#
    "ros.isolateEnvironment": "false"
}

然后重启vscode就可以使用GDB对ROS launch文件进行Debug。

相关推荐
开开心心就好2 分钟前
免费流畅的远程控制实用工具
linux·运维·服务器·网络·智能手机·excel
渣渣灰95871 小时前
Windows 10 环境部署 Claude Code 教程
windows·vscode·calude code
黑猫学长呀2 小时前
存储宝典第2篇:盲封TT wafer是什么意思?
linux·嵌入式硬件·项目·芯片·ufs·晶圆·产测
Strugglingler2 小时前
【Linux 用户态操作 UART】
linux·uart
代码熬夜敲Q2 小时前
ENSP 网络工程实验
linux·运维·服务器
csdn_life182 小时前
OpenClaw v2026.5.12+ 高级密钥管理:使用SecretRef实现真正的隐蔽存储
linux·openclaw
Terrence Shen2 小时前
Claude Code Harness 源码学习讲义
linux·学习·ubuntu
赵药师3 小时前
dpkg: warning: files list file for package ‘libselinux1:amd64‘ missing;
linux·运维·服务器
STDD3 小时前
Samba 文件共享:Linux 服务器与 Windows/Mac 共享文件夹
linux·服务器·windows
liudanzhengxi3 小时前
CRM系统技术文章
linux·服务器·网络·人工智能·新人首发