Giter Club home page Giter Club logo

vscode_ros2_config's Introduction

Visual Studio Code ROS 2 Work Space Configuration

这是什么 - What is it

这是一个便于配置ROS 2开发环境的VS Code插件.

This is a VS Code plugin that is easy to configure the ROS 2 development environment.

如何使用 - How to use it

  1. 将环境里的.vscode(有可能是隐藏文件) 复制到ROS 2的工作空间, 即你可以直接运行colcon的目录.

    目录结构如下, 其中.vscode下面的一些文件夹并不在本仓库,像buildinstalllog是在编译中生成的文件夹,而src_0src_1代指你的代码文件夹。

    |--.vscode |--build |--install |--log |--src_0 |--src_1

  2. 修改.vscode目录下的c_cpp_properties.json里的路径, 如果ROS 2是按照源码编译, 并且指定到/opt/ros2/galactic目录的话, 路径是/opt/ros2/galactic/include/**, 同时, 需要保证所有的/opt/相关的路径, 都与该路径保持一致.

  3. 如果使用了不同的C/C++版本, 如C11, C++ 17, 需要修改c_cpp_properties.json中的cStandardC11, cppStandardC++17.

  4. 批量替换Python版本到设备上的Python版本, 文件为settings.json, 在里面找到python3., 然后修改后面的数字为自己的版本. 一般情况, Ubuntu 18.04是Python3.6, Ubuntu 20.04是Python 3.8, 我使用的是Arch Linux, 对应Python 3.9.

  5. 在工作空间根目录打开VS Code, 即运行code .即可.

  6. 此时会弹出推荐安装的插件, 允许即可.

  7. 推荐同时安装如下插件, 以便于开发.

    1. C/C++
    2. C++ Intellisense
    3. CMake
    4. CMake Integration
    5. CMake Tools
    6. Compare Folders
    7. Better C++ Syntax
    8. compareit
    9. XML Tools
    10. Python
  8. 完成安装后, 再开发ROS 2相关的工程时, 可以快速查看各类变量函数定义声明等, 和其他IDE功能相同, 不赘述.

参考自 - Reference

vscode_ros2_workspace

vscode_ros2_config's People

Contributors

homalozoa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.