All Projects → athackst → vscode_ros2_workspace

athackst / vscode_ros2_workspace

Licence: Apache-2.0 license
A template for using VSCode as an IDE for ROS2 development.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to vscode ros2 workspace

Workspace D
Wraps dcd, dfmt and dscanner to one unified environment managed by dub
Stars: ✭ 73 (-86.15%)
Mutual labels:  workspace
Pile
⚡️ A simple & powerful app to organize your piled work at one place~
Stars: ✭ 158 (-70.02%)
Mutual labels:  workspace
dynamixel control
ros2_control packages for ROBOTIS Dynamixel
Stars: ✭ 69 (-86.91%)
Mutual labels:  ros2
Krypton Net 5.470
A update to Component factory's krypton toolkit to support the .NET 4.7 framework.
Stars: ✭ 79 (-85.01%)
Mutual labels:  workspace
Vim Ctrlspace
Vim Space Controller
Stars: ✭ 1,621 (+207.59%)
Mutual labels:  workspace
Chatbot Watson Android
An Android ChatBot powered by Watson Services - Assistant, Speech-to-Text and Text-to-Speech on IBM Cloud.
Stars: ✭ 169 (-67.93%)
Mutual labels:  workspace
Geoserver
geoserver is a Go library for manipulating a GeoServer instance via the GeoServer REST API.
Stars: ✭ 48 (-90.89%)
Mutual labels:  workspace
windbg-workspace
No description or website provided.
Stars: ✭ 23 (-95.64%)
Mutual labels:  workspace
Sensenet
Open Source Content Services Platform written in .NET
Stars: ✭ 153 (-70.97%)
Mutual labels:  workspace
introduction-nodejs
Introduction to NodeJS
Stars: ✭ 13 (-97.53%)
Mutual labels:  workspace
I3 Config
i3wm configuration files
Stars: ✭ 81 (-84.63%)
Mutual labels:  workspace
Notion Icons 2.0
Create a more vibrant and modern workspace. Use Github Issues to request more Icons.
Stars: ✭ 93 (-82.35%)
Mutual labels:  workspace
Graphiql Workspace
A graphical interactive in-browser GraphQL IDE enhanced with tabbed navigation, HTTP headers, arbitrary endpoints, etc.
Stars: ✭ 209 (-60.34%)
Mutual labels:  workspace
Vg
Virtualgo: Easy and powerful workspace based development for go
Stars: ✭ 1,213 (+130.17%)
Mutual labels:  workspace
DDS-Router
The DDS Router is an application developed by eProsima that allows, using Fast DDS, to communicate by DDS protocol different networks.
Stars: ✭ 34 (-93.55%)
Mutual labels:  ros2
Watbot
An Android ChatBot powered by IBM Watson Services (Assistant V1, Text-to-Speech, and Speech-to-Text with Speaker Recognition) on IBM Cloud.
Stars: ✭ 64 (-87.86%)
Mutual labels:  workspace
I3 Gnome Pomodoro
🍅 Integrate gnome-pomodoro into i3
Stars: ✭ 159 (-69.83%)
Mutual labels:  workspace
tmpo
Command line interface to create new workspaces based on templates
Stars: ✭ 25 (-95.26%)
Mutual labels:  workspace
iknet
Inverse kinematics estimation of ROBOTIS Open Manipulator X with neural networks
Stars: ✭ 27 (-94.88%)
Mutual labels:  ros2
li slam ros2
ROS2 package of tightly-coupled lidar inertial ndt/gicp slam
Stars: ✭ 160 (-69.64%)
Mutual labels:  ros2

VSCode ROS2 Workspace Template

This template will get you set up using ROS2 with VSCode as your IDE.

See how I develop with vscode and ros2 for a more in-depth look on how to use this workspace.

Features

Style

ROS2-approved formatters are included in the IDE.

  • c++ uncrustify; config from ament_uncrustify
  • python autopep8; vscode settings consistent with the style guide

Tasks

There are many pre-defined tasks, see .vscode/tasks.json for a complete listing. Feel free to adjust them to suit your needs.

Take a look at how I develop using tasks for an idea on how I use tasks in my development.

Debugging

This template sets up debugging for python files and gdb for cpp programs. See .vscode/launch.json for configuration details.

Continuous Integration

The template also comes with basic continuous integration set up. See .github/workflows/ros.yaml.

To remove a linter just delete it's name from this line:

      matrix:
          linter: [cppcheck, cpplint, uncrustify, lint_cmake, xmllint, flake8, pep257]

How to use this template

Prerequisites

You should already have Docker and VSCode with the remote containers plugin installed on your system.

Get the template

Click on "use this template"

template_use

Create your repository

On the next dialog, name the repository you would like to start and decide if you want all of the branches, or just the latest LTS: humble.

template_new

Github will then create a new repository with the contents of this one in your account. It grabs the latest changes as "initial commit".

Clone your repo

Now you can clone your repo as normal

template_download

Open it in vscode

Now that you've cloned your repo onto your computer, you can open it in VSCode (File->Open Folder).

When you open it for the first time, you should see a little popup that asks you if you would like to open it in a container. Say yes!

template_vscode

If you don't see the pop-up, click on the little green square in the bottom left corner, which should bring up the container dialog

template_vscode_bottom

In the dialog, select "Remote Containers: Reopen in container"

VSCode will build the dockerfile inside of .devcontainer for you. If you open a terminal inside VSCode (Terminal->New Terminal), you should see that your username has been changed to ros, and the bottom left green corner should say "Dev Container"

template_container

Update the template with your code

  1. Specify the repositories you want to include in your workspace in src/ros2.repos or delete src/ros2.repos and develop directly within the workspace.
  2. If you are using a ros2.repos file, import the contents Terminal->Run Task..->import from workspace file
  3. Install dependencies Terminal->Run Task..->install dependencies
  4. (optional) Adjust scripts to your liking. These scripts are used both within tasks and CI.
    • setup.sh The setup commands for your code. Default to import workspace and install dependencies.
    • build.sh The build commands for your code. Default to --merge-install and --symlink-install
    • test.sh The test commands for your code.
  5. Develop!

FAQ

WSL2

The gui doesn't show up

This is likely because the DISPLAY environment variable is not getting set properly.

  1. Find out what your DISPLAY variable should be

    In your WSL2 Ubuntu instance

    echo $DISPLAY
    
  2. Copy that value into the .devcontainer/devcontainer.json file

    	"containerEnv": {
            "DISPLAY": ":0",
       }

I want to use vGPU

If you want to access the vGPU through WSL2, you'll need to add additional components to the .devcontainer/devcontainer.json file in accordance to these directions

	"runArgs": [
		"--network=host",
		"--cap-add=SYS_PTRACE",
		"--security-opt=seccomp:unconfined",
		"--security-opt=apparmor:unconfined",
		"--volume=/tmp/.X11-unix:/tmp/.X11-unix",
		"--volume=/mnt/wslg:/mnt/wslg",
		"--volume=/usr/lib/wsl:/usr/lib/wsl",
		"--device=/dev/dxg",
      		"--gpus=all"
	],
	"containerEnv": {
		"DISPLAY": "${localEnv:DISPLAY}", // Needed for GUI try ":0" for windows
		"WAYLAND_DISPLAY": "${localEnv:WAYLAND_DISPLAY}",
		"XDG_RUNTIME_DIR": "${localEnv:XDG_RUNTIME_DIR}",
		"PULSE_SERVER": "${localEnv:PULSE_SERVER}",
		"LD_LIBRARY_PATH": "/usr/lib/wsl/lib",
		"LIBGL_ALWAYS_SOFTWARE": "1" // Needed for software rendering of opengl
	},
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].