-
Notifications
You must be signed in to change notification settings - Fork 2
Run ROS2 inside of VSCode's remote development
This tutorial is based on Run ROS2 inside of VSCode's remote development by William Guimont-Martin.
Create a Dockerfile
with the following content in your project:
FROM osrf/ros:iron-desktop-full
Create .devcontainer/devcontainer.json
with the following content in your project:
{
"name": "ros2",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
]
}
},
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind",
"source=/dev/shm,target=/dev/shm,type=bind"
],
"containerEnv": {
"DISPLAY": ":1",
"NVIDIA_VISIBLE_DEVICES": "all",
"NVIDIA_DRIVER_CAPABILITIES": "all"
},
"runArgs": [
"--ipc=host",
"--pid=host",
"--net=host"
],
"postCreateCommand": "echo \"source /opt/ros/$ROS_DISTRO/setup.bash\" >> ~/.bashrc"
}
To allow the container to run GUI applications (e.g., rviz2), you need to run the following command:
# Allow xhost access to local user
xhost +si:localuser:root
In VSCode, install the extension pack Remote Development that allows remote development inside of Docker containers.
Open your project in VSCode, and start remote development by entering Dev Containers: Rebuild and Reopen in Container
into the command palette (CTRL-SHIFT-P
). You can now open a terminal and run your ROS2 nodes:
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build
source install/setup.bash
ros2 launch launch/launch.py
There might me some error in IntelliSense (e.g., some imports not found), run Python: Clear Cache and Reload Window
in the command palette.
- Warthog Teach and Repeat (ROS1)
- Warthog Teach and Repeat (ROS2)
- Time Synchronization (NTP)
- Time Synchronization (PTP)
- Deployment of Robotic Total Stations (RTS)
- Deployment of the backpack GPS
- Warthog Emlid GPS
- Atlans-C INS
- How to use a CB Radio when going in the forest
- IP forwarding
- Emlid Data Postprocessing (PPK)
- Setting up a reliable robot communication with Zenoh
- Zenoh rmw
- Lessons Learned
- Robots' 3D Models
- Order Management
- Fast track Master → PhD
- Intellectual Property
- Repository Guidelines
- TF Cheatsheet
- Montmorency Forest Wintertime Dataset
- RTS-GT Dataset 2023
- Deschenes2021 Dataset
- TIGS Dataset
- DRIVE Datasets
- BorealHDR
- TimberSeg 1.0
- DARPA Subterranean Challenge - Urban Dataset
- How to upload a dataset to VALERIA
- ROS1 Bridge
- Migrating a repository to ROS2 (Humble)
- ROS2 and rosbags
- MCAP rosbags
- DDS Configuration (work in progress)
- Using a USB Microphone with ROS2
- ROS2 in VSCode
- ROS2 Troubleshooting