ros路径 vscode_使用Vscode开发ROS

本文介绍了如何在Visual Studio Code (VSCode)中设置ROS(melodic)开发环境,包括安装必要的插件,创建ROS工作区,配置编译任务,并通过VSCode运行ROS节点。文章详细讲解了VSCode的task配置,以及如何使用ROS核心服务。
摘要由CSDN通过智能技术生成

使用Visual Studio Code 开发ROS方法

前提条件:安装好了ROS(melotic) 和 VSCODE

1、vscode安装必要的插件

2、提前准备好一个ROS的catkin workspace

在workspace下面使用vscode打开

$ code .

打开之后,第一步安装的ROS插件就会自动识别到这个workspace,同时会出现一个文件夹.vscode

里面有两个json文件:

c_cpp_properties.json

settings.json

c_cpp_properties.json 主要是和头文件 ros/ros.h这种头文件包含有关系。

settings.json 暂时好像是和Python的自动补全有关系。

3、将catkin_make放到vscode里面编译

原来的方式是,在catkin_ws下使用catkin_make命令:如下

hou@hou-ThinkPad-P52s:~/catkin_ws$ catkin_make

Base path: /home/hou/catkin_ws

Source space: /home/hou/catkin_ws/src

Build space: /home/hou/catkin_ws/build

Devel space: /home/hou/catkin_ws/devel

Install space: /home/hou/catkin_ws/install

####

#### Running command: "cmake /home/hou/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/hou/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/hou/catkin_ws/install -G Unix Makefiles" in "/home/hou/catkin_ws/build"

####

-- Using CATKIN_DEVEL_PREFIX: /home/hou/catkin_ws/devel

-- Using CMAKE_PREFIX_PATH: /home/hou/catkin_ws/devel;/opt/ros/melodic

-- This workspace overlays: /home/hou/catkin_ws/devel;/opt/ros/melodic

-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")

-- Using PYTHON_EXECUTABLE: /usr/bin/python2

-- Using Debian Python package layout

-- Using empy: /usr/bin/empy

-- Using CATKIN_ENABLE_TESTING: ON

-- Call enable_testing()

-- Using CATKIN_TEST_RESULTS_DIR: /home/hou/catkin_ws/build/test_results

-- Found gtest sources under '/usr/src/googletest': gtests will be built

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值