{"id":24958932,"url":"https://github.com/edouardrolland/vscode_ros2_px4_workspace","last_synced_at":"2025-09-08T06:38:41.312Z","repository":{"id":200929347,"uuid":"706150764","full_name":"edouardrolland/vscode_ros2_px4_workspace","owner":"edouardrolland","description":"A template for generating a docker development environment suited for PX4, Gazebo and ROS2.","archived":false,"fork":false,"pushed_at":"2025-02-28T10:01:51.000Z","size":2732,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"humble","last_synced_at":"2025-04-10T20:21:29.187Z","etag":null,"topics":["docker","gazebo","px4-autopilot","ros2","vscode"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edouardrolland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-17T11:59:01.000Z","updated_at":"2025-04-09T10:27:16.000Z","dependencies_parsed_at":"2024-01-31T08:53:42.095Z","dependency_job_id":"3be00c77-2ef3-40c7-b9ef-ad2185d1a184","html_url":"https://github.com/edouardrolland/vscode_ros2_px4_workspace","commit_stats":null,"previous_names":["edouardrolland/ros2_1","edouardrolland/vscode_ros2_px4_workspace","edouard98/vscode_ros2_px4_workspace"],"tags_count":0,"template":true,"template_full_name":"athackst/vscode_ros2_workspace","purl":"pkg:github/edouardrolland/vscode_ros2_px4_workspace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edouardrolland%2Fvscode_ros2_px4_workspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edouardrolland%2Fvscode_ros2_px4_workspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edouardrolland%2Fvscode_ros2_px4_workspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edouardrolland%2Fvscode_ros2_px4_workspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edouardrolland","download_url":"https://codeload.github.com/edouardrolland/vscode_ros2_px4_workspace/tar.gz/refs/heads/humble","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edouardrolland%2Fvscode_ros2_px4_workspace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274146412,"owners_count":25230115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","gazebo","px4-autopilot","ros2","vscode"],"created_at":"2025-02-03T07:36:03.667Z","updated_at":"2025-09-08T06:38:41.237Z","avatar_url":"https://github.com/edouardrolland.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ROS2 \u0026 PX4 VSCode Dev Environment  \n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Build Status](https://github.com/edouardrolland/vscode_ros2_px4_workspace/actions/workflows/ros.yaml/badge.svg)](https://github.com/edouardrolland/vscode_ros2_px4_workspace/actions/workflows/ros.yaml)\n[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)\n\nWelcome to our development environment template for ROS2, PX4, and Gazebo. This Docker-based setup enables seamless integration of ROS2, PX4, and Gazebo with VSCode, providing a robust environment for developing drone applications.\n\n# Citation\nIf you are using this template in your research, feel free to cite the following paper: \n\n\n```\n@INPROCEEDINGS{10556912,\n  author={Rolland, Edouard G. A. and Grøntved, Kasper A. R. and Christensen, Anders Lyhne and Watson, Matthew and Richardson, Tom},\n  booktitle={2024 International Conference on Unmanned Aircraft Systems (ICUAS)}, \n  title={Autonomous UAV Volcanic Plume Sampling Based on Machine Vision and Path Planning}, \n  year={2024},\n  volume={},\n  number={},\n  pages={1064-1071},\n  keywords={Training;Wildfires;Machine vision;Object detection;Manuals;Feature extraction;Visual servoing},\n  doi={10.1109/ICUAS60882.2024.10556912}}\n```\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Acknowledgment](#acknowledgment)\n- [Features](#features)\n- [How to Use the Template](#how-to-use-the-template)\n  - [Prerequisites](#prerequisites)\n  - [Getting Started](#getting-started)\n- [License](#license)\n\n\n## Acknowledgment\n\nThis template extends the [vscode_ros2_workspace](https://github.com/athackst/vscode_ros2_workspace#readme) template by incorporating the PX4-Autopilot library as well as simulations in Gazebo. For more information about the original template, please visit the [author's website](https://www.allisonthackston.com/articles/vscode-docker-ros2.html).\n\n## Features\n\n- ROS2 Integration\n- PX4 Integration and Micro XRCE-DDS Agent \u0026 Client Setup\n- Gazebo Simulation\n- VSCode Workflow\n\n## How to Use the Template\n\n### Prerequisites\n\nBefore using this template, make sure you have the following prerequisites installed on your system:\n\n- [Docker](https://docs.docker.com/engine/install/)\n- [VSCode](https://code.visualstudio.com/)\n- [VSCode Remote Containers Plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n\n### Getting Started\n\n#### Step 1: Get the Template\n\n![Step 1](https://github.com/edouard98/vscode_ros2_px4_workspace/blob/humble/asset/1.png)\n\n#### Step 2: Create Your Own Project Repository\n\n![Step 2](https://github.com/edouard98/vscode_ros2_px4_workspace/blob/humble/asset/2.png)\n\n#### Step 3: Clone the Project to Your Computer\n\n![Step 3](https://github.com/edouard98/vscode_ros2_px4_workspace/blob/humble/asset/3.png)\n\n#### Step 4: Open the Folder in VSCode\n\nTo interact with the container, you need to install the Docker extension in VSCode. Follow the steps below:\n\n![Step 4](https://github.com/edouard98/vscode_ros2_px4_workspace/blob/humble/asset/4.png)\n\n#### Step 5: Build the Container\n\nYou can build the container for the first time by following the steps presented in the following picture.\n\n![Step 5](https://github.com/edouard98/vscode_ros2_px4_workspace/blob/humble/asset/5.png)\n\nPlease note that if you're on Windows, ensure that Docker Engine is running in the background. The initial build may take some time.\n\n## Test your container\n \nTo test your contrainer and also the Gazebo installation you can run the following commands in the terminal.  \n\n```\ncd\ncd PX4-Autopilot/\nmake px4_sitl gz_x500\n```\n\nThis set of commands should open a Gazebo Tab display a drone as presented in the following figure. If the command is not displaying a tab, you should refer to the FAQ section of this readme to set up a X server. \n\n![Step 6](https://github.com/edouard98/vscode_ros2_px4_workspace/blob/humble/asset/6.png)\n\n## FAQ\n\n### WSL2\n\n#### The gui doesn't show up\n\nThis is likely because the DISPLAY environment variable is not getting set properly.\n\n1. Find out what your DISPLAY variable should be\n\n      In your WSL2 Ubuntu instance\n\n      ```\n      echo $DISPLAY\n      ```\n\n2. Copy that value into the `.devcontainer/devcontainer.json` file\n\n      ```jsonc\n      \t\"containerEnv\": {\n\t\t      \"DISPLAY\": \":0\",\n         }\n      ```\n\n#### I want to use vGPU\n\nIf 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](https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md)\n\n```jsonc\n\t\"runArgs\": [\n\t\t\"--network=host\",\n\t\t\"--cap-add=SYS_PTRACE\",\n\t\t\"--security-opt=seccomp:unconfined\",\n\t\t\"--security-opt=apparmor:unconfined\",\n\t\t\"--volume=/tmp/.X11-unix:/tmp/.X11-unix\",\n\t\t\"--volume=/mnt/wslg:/mnt/wslg\",\n\t\t\"--volume=/usr/lib/wsl:/usr/lib/wsl\",\n\t\t\"--device=/dev/dxg\",\n      \t\t\"--gpus=all\"\n\t],\n\t\"containerEnv\": {\n\t\t\"DISPLAY\": \"${localEnv:DISPLAY}\", // Needed for GUI try \":0\" for windows\n\t\t\"WAYLAND_DISPLAY\": \"${localEnv:WAYLAND_DISPLAY}\",\n\t\t\"XDG_RUNTIME_DIR\": \"${localEnv:XDG_RUNTIME_DIR}\",\n\t\t\"PULSE_SERVER\": \"${localEnv:PULSE_SERVER}\",\n\t\t\"LD_LIBRARY_PATH\": \"/usr/lib/wsl/lib\",\n\t\t\"LIBGL_ALWAYS_SOFTWARE\": \"1\" // Needed for software rendering of opengl\n\t},\n```\n\n### Repos are not showing up in VS Code source control\n\nThis is likely because vscode doesn't necessarily know about other repositories unless you've added them directly. \n\n```\nFile-\u003eAdd Folder To Workspace\n```\n\n![Screenshot-26](https://github.com/athackst/vscode_ros2_workspace/assets/6098197/d8711320-2c16-463b-9d67-5bd9314acc7f)\n\n\nOr you've added them as a git submodule.\n\n![Screenshot-27](https://github.com/athackst/vscode_ros2_workspace/assets/6098197/8ebc9aac-9d70-4b53-aa52-9b5b108dc935)\n\nTo add all of the repos in your *.repos file, run the script\n\n```bash\npython3 .devcontainer/repos_to_submodules.py\n```\n\nor run the task titled `add submodules from .repos`\n\n### Docker Desktop\nIf you have installed docker combined with Docker Desktop (This is, to my knowledge, only for unix based systems), you might encounter errors when binding the container.\nThe error might look like this: \n```\ndocker: Error response from daemon: invalid mount config for type \n\"bind\": bind source path does not exist: /tmp/.X11-unix\n```\n\nFix this by adding the directories in the error message to your **shared files** in your docker desktop settings under **Resources** -\u003e **File sharing** -\u003e **Virtual file shares**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedouardrolland%2Fvscode_ros2_px4_workspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedouardrolland%2Fvscode_ros2_px4_workspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedouardrolland%2Fvscode_ros2_px4_workspace/lists"}