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。

相关推荐
衫水15 分钟前
ubuntu系统如何检查和安装以及运行redis
redis·ubuntu·bootstrap
苏宸啊25 分钟前
Linux权限
linux·运维·服务器
xqhoj1 小时前
Linux——make、makefile
linux·运维·服务器
张童瑶1 小时前
Linux 在线安装编译Python3.11
linux·运维·python3.11
Shi_haoliu1 小时前
SolidTime 在 Rocky Linux 9.5 上的完整部署流程
linux·运维·nginx·postgresql·vue·php·laravel
Lkygo2 小时前
LlamaIndex使用指南
linux·开发语言·python·llama
qq_254617772 小时前
nslookup 这个命令解析dns,和系统接口gethostbyname解析区别在哪?
linux·网络
HIT_Weston3 小时前
100、【Ubuntu】【Hugo】搭建私人博客:元信息&翻译(一)
linux·运维·ubuntu
Mr. Cao code3 小时前
Docker匿名数据卷实战指南
运维·ubuntu·docker·容器
自由的好好干活3 小时前
UBI镜像文件打包与编辑
linux·嵌入式硬件