{"id":22376791,"url":"https://github.com/saiccoumar/px4_docker_config","last_synced_at":"2026-03-12T06:01:43.371Z","repository":{"id":177156901,"uuid":"660002392","full_name":"saiccoumar/PX4_Docker_Config","owner":"saiccoumar","description":"A custom dockerfile designed to containerize PX4 on Ubuntu 22.04 with ROS2 and Gazebo Garden","archived":false,"fork":false,"pushed_at":"2024-01-21T18:17:47.000Z","size":91,"stargazers_count":6,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-15T19:45:10.625Z","etag":null,"topics":["docker","linux","px4"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saiccoumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2023-06-29T03:10:50.000Z","updated_at":"2025-10-02T05:27:33.000Z","dependencies_parsed_at":"2024-12-04T22:11:25.548Z","dependency_job_id":"2a163162-ba81-41e3-b23b-1eab0628cffb","html_url":"https://github.com/saiccoumar/PX4_Docker_Config","commit_stats":null,"previous_names":["saiccoumar/px4_docker_config"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saiccoumar/PX4_Docker_Config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiccoumar%2FPX4_Docker_Config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiccoumar%2FPX4_Docker_Config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiccoumar%2FPX4_Docker_Config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiccoumar%2FPX4_Docker_Config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saiccoumar","download_url":"https://codeload.github.com/saiccoumar/PX4_Docker_Config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiccoumar%2FPX4_Docker_Config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30416733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","linux","px4"],"created_at":"2024-12-04T22:11:23.008Z","updated_at":"2026-03-12T06:01:43.347Z","avatar_url":"https://github.com/saiccoumar.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PX4_Docker_Config\nA custom dockerfile designed to containerize PX4 on Ubuntu 22.04 with ROS2 and Gazebo Garden\n\n## Features:\n* Preinstalls ROS2, PX4, and Gazebo Garden\n* Creates an organized workspace ready for PX4 Development with dependency management\n* Can be directly developed on via VSCode\n\n\n## Build Instructions:\n### Step 1: Install Docker Desktop and run Docker Desktop. \nDocker Desktop comes with all components of Docker that are necessary to make our docker containers, as well as a nice UI to help us manage our containers and images. \nhttps://www.docker.com/products/docker-desktop/\n### Step 2: Download the docker file and the install scripts from this repository. \nThey should both be within the same folder so that the Dockerfile can access the installation scripts\n### Step 3: Open terminal and run 'docker build'\nThis should take quite some time to retrieve all the dependencies from their sources; the expected size is 10.84 gb due to all the dependencies.. When finished, you should be able to see the new image under the images tab of docker desktop. The -t uav sets tags the docker image with the name 'uav' so it's more recognizable. The period denotes the build context which is the directory where the docker file is located.\n``` bash\ndocker build -t uav .\n```\n### Step 4: Run 'docker run'.\nThis makes a docker container based off of the custom docker image. -it prevents the container from shutting down as soon as it is started up. -name allows us to set the name of the container, which I set to hummingbird. If you're using Linux, run the following command.\n``` bash\ndocker run -it --env=\"DISPLAY=:0\" --name=hummingbird uav\n```\nIf you're using Windows run this command. You can find your ip by typing 'ipconfig' in the terminal:\n``` bash\ndocker run -it --env=\"DISPLAY=\u003cyour ip\u003e:0\" --name=hummingbird uav\n```\n\nIf you're using MacOS run this command. \n``` bash\ndocker run -it --net=host --privileged --env=\"DISPLAY=host.docker.internal:0\" --name=hummingbird uav\n```\n\nIf the script repeatedly fails on px4.sh or ros2wkspc.sh you can comment these sections out, build the docker image, and then download PX4 and the PX4 ROS2 workspace manually. This should help with debugging any unexplained errors and you can do hot fix commands intermittently to get the same final output setup.\n\n## Container Management. \n### If you exit out of the docker container in terminal you can re-enter with 'docker exec'\n``` bash\ndocker exec -it hummingbird /bin/bash\n```\n### To start or stop the docker container you can use 'docker start' and 'docker stop'\n``` bash\ndocker start hummingbird\ndocker stop hummingbird\n```\n### Docker container status can be managed from the terminal with 'docker ps'\n``` bash\ndocker ps -a\n```\n### If you see Vmmem wsl consuming a lot of memory after the docker container has been shut down but get a permission denied error when trying to shut it down, you can run the following command to kill wsl processes in Windows:\n``` bash\nwsl --shutdown\n```\n\n## X11 Forwarding:\nX11 forwarding is a feature that allows the graphical user interface of an application running on a remote machine to be displayed on a local machine's display. It is required to use GUI applications on remote machines or containerized GUI applications. While using linux as your host OS, the X11 server is shared between the docker container and the host machine so no external configuration is required. On windows and MacOS this X11 server must be configured manually with third party software. \n\n### Windows X11 Server setup:\n### Step 1:\nDownload a X11 server implementation. Many sites recommended Xming but this did NOT work for me and the distribution hasn't been updated since 2013. Instead I used VcXSrv. It can be downloaded here: https://sourceforge.net/projects/vcxsrv/\n### Step 2: \nLaunch XLaunch. This window should come up. Click next.\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"60%\" height=\"auto\" src=\"https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/8957d2fe-c769-44f0-901e-d9cc29eb110d\"\u003e\n\u003c/p\u003e\n\n### Step 3: \nContinue with Start no client and click next. \n\u003cp align=\"center\"\u003e\n\u003cimg width=\"60%\" height=\"auto\" src=\"https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/6db95545-e2c5-4529-b831-189630cbf527\"\u003e\n\u003c/p\u003e\n\n### Step 4: \nIn Extra settings click Disable access control as well as clipboard and Native opengl. \n\u003cp align=\"center\"\u003e\n\u003cimg width=\"60%\" height=\"auto\" src=\"https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/47d82115-4d4f-4c04-b761-2466e229ccd5\"\u003e\n\u003c/p\u003e\n\n### Step 5:\nClick Save Configuration and save it to your desktop. This way you won't need to redo the launch process and can start a server with the config shortcut. \n\u003cp align=\"center\"\u003e\n\u003cimg width=\"60%\" height=\"auto\" src=\"https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/c0ced88b-b942-4b99-ae66-06234227f37b\"\u003e\n\u003c/p\u003e\n\n### Closing the Xserver: \nWhile there might be another built in way to do this, I keep task manager open and close the VcXsrv server through task manager. Watching task manager can help keep track of the high RAM usage that comes with Xservers. The Xserver will also shut down when the computer running it shuts down and does not automatically start up. \n\u003cp align=\"center\"\u003e\n\u003cimg width=\"60%\" height=\"auto\" src=\"[https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/c0ced88b-b942-4b99-ae66-06234227f37b](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/3b5074ad-54ff-4862-b11b-84dfa6c8e01d))\"\u003e\n\u003c/p\u003e\n\n### MacOS X11 Server setup:\nIn progress. The recommended Xserver software is Xquartz.\n### Step 1: Download a X11 server implementation. \nThe download can be found here: https://www.xquartz.org/.\n### Step 2: Go to Settings \u003e  Security and check Allow connections from network clients. Then restart Xquartz.\n![image](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/73964c94-1dff-44fe-9036-fd748d5a725f)\n### Step 3: run xhost in terminal.\nThis opens up the host machine to recieve display data from the docker container via the localhost network. \n``` bash\nxhost +local\n```\n### Step 4: Run docker run\n``` bash\ndocker run -it --net=host --privileged --env=\"DISPLAY=host.docker.internal:0\" --name=hummingbird uav\n```\n### Closing the Xserver:\nMacOS should automatically close the Xserver when Xquartz is shut down. You can run 'xhost -local' to undo the hosting access you gave to your network from your computer to be safe. \n\n## Connecting Visual Studio Code to the Docker container:\nIf you have visual studio code on the host machine, you can directly develop on the docker container. I found it to be objectively the best experience for development on the container and it doesn't consume container resources heavily as using an IDE on the container.\n\n### Step 1: Download VSC\nFollow these instructions to download Visual Studio Code: https://code.visualstudio.com/download \n### Step 2: Download Dev Containers extension\n![Screenshot 2023-06-27 193614](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/d101f5c0-2c9d-4abf-9b12-0c022f8fbe97)\n\n### Step 3: Press Ctrl+Shift+P or Cmd+Shift+P to open your command pallete in VSC \n![Screenshot 2023-06-27 193814](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/6f5c0600-12ee-46f2-a8a7-7a1108b73f10)\n\n### Step 4: Search for \"Attach to Running Container...\" \n![Screenshot 2023-06-27 193932](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/f6939b4c-3d39-44ad-bbc4-020662f4ccef)\n\n### Step 5: VSC will display a list of running Docker containers. Choose the container you're developing on \n\n![Screenshot 2023-06-27 194108](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/7762016b-1a15-48cc-8fbc-9a06d9b947a2)\n\n### Ex: \nOnce you select your container VSC should open a window so you can develop on this container like it's your machine. The output should look like the example below, and you can open a terminal to test it by right clicking on the file explorer. You can see I used the cat command on my file test.txt and it outputted the result to the terminal. You can also see the profile in the terminal is that of the docker container user (it won't be root in our project workspace). This makes it easier to run multiple processes as well for our project!  \n\n![GetImage](https://github.com/saiccoumar/PX4_Docker_Config/assets/55699636/d0f1116d-d131-4911-85a0-cbdd963bc35d)\n\n## Starting Your First Project:\n### Run the Microagent:\n``` bash\nMicroXRCEAgent udp4 -p 8888\n```\n### Start Gazebo:\nRun default:\n``` bash\nmake px4_sitl gz_x500 \n```\nCopying a custom environment into PX4:\n``` bash\ndocker cp \u003csource_file\u003e \u003cdocker_container_id\u003e:/home/user/work/PX4-Autopilot/Tools/simulation/gz/worlds/\u003csource_file\u003e\n```\nRun Advanced Settings:\n``` bash\nPX4_SYS_AUTOSTART=4001 PX4_GZ_MODEL=x500 PX4_GZ_WORLD=model ./build/px4_sitl_default/bin/px4 \n```\n### Start ROS2:\n```bash\nsource /opt/ros/humble/setup.bash  \nsource install/local_setup.bash  \nros2 launch px4_ros_com sensor_combined_listener.launch.py\n```\n\n\n#### Original Work: https://github.com/zp-yang/visnet-docker. \n#### I modified it and updated the scripts generalize the use and to match the PX4 ROS2 user guide found here: https://docs.px4.io/main/en/ros/ros2_comm.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaiccoumar%2Fpx4_docker_config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaiccoumar%2Fpx4_docker_config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaiccoumar%2Fpx4_docker_config/lists"}