{"id":19195437,"url":"https://github.com/ardupilot/ardupilot_gazebo","last_synced_at":"2025-04-12T21:29:22.902Z","repository":{"id":38822624,"uuid":"413090827","full_name":"ArduPilot/ardupilot_gazebo","owner":"ArduPilot","description":"Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers","archived":false,"fork":false,"pushed_at":"2024-11-04T18:18:18.000Z","size":41034,"stargazers_count":119,"open_issues_count":15,"forks_count":128,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-04T03:03:01.128Z","etag":null,"topics":["ardupilot","gazebo","simulation","sitl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArduPilot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-10-03T13:49:16.000Z","updated_at":"2025-04-04T03:01:10.000Z","dependencies_parsed_at":"2024-02-12T09:52:33.829Z","dependency_job_id":null,"html_url":"https://github.com/ArduPilot/ardupilot_gazebo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gazebo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gazebo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gazebo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gazebo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArduPilot","download_url":"https://codeload.github.com/ArduPilot/ardupilot_gazebo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248634310,"owners_count":21137023,"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","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":["ardupilot","gazebo","simulation","sitl"],"created_at":"2024-11-09T12:09:55.997Z","updated_at":"2025-04-12T21:29:22.884Z","avatar_url":"https://github.com/ArduPilot.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArduPilot Gazebo Plugin\n\n[![ubuntu-build](https://github.com/ArduPilot/ardupilot_gazebo/actions/workflows/ubuntu-build.yml/badge.svg)](https://github.com/ArduPilot/ardupilot_gazebo/actions/workflows/ubuntu-build.yml)\n[![ccplint](https://github.com/ArduPilot/ardupilot_gazebo/actions/workflows/ccplint.yml/badge.svg)](https://github.com/ArduPilot/ardupilot_gazebo/actions/workflows/ccplint.yml)\n[![cppcheck](https://github.com/ArduPilot/ardupilot_gazebo/actions/workflows/ccpcheck.yml/badge.svg)](https://github.com/ArduPilot/ardupilot_gazebo/actions/workflows/ccpcheck.yml)\n\nThis is the official ArduPilot plugin for [Gazebo](https://gazebosim.org/home).\nIt replaces the previous\n[`ardupilot_gazebo`](https://github.com/khancyr/ardupilot_gazebo)\nplugin and provides support for the recent releases of the Gazebo simulator\n[(Gazebo Garden)](https://gazebosim.org/docs/garden/install) and [(Gazebo Harmonic)](https://gazebosim.org/docs/harmonic/install).\n\nIt also adds the following features:\n\n- More flexible data exchange between SITL and Gazebo using JSON.\n- Additional sensors supported.\n- True simulation lockstepping. It is now possible to use GDB to stop\n  the Gazebo time for debugging.\n- Improved 3D rendering using the `ogre2` rendering engine.\n\nThe project comprises a Gazebo plugin to connect to ArduPilot SITL\n(Software In The Loop) and some example models and worlds.\n\n## Prerequisites\n\nGazebo Garden or Harmonic is supported on Ubuntu 22.04 (Jammy).\nHarmonic is recommended.\nIf you are running Ubuntu as a virtual machine you will need at least\nUbuntu 20.04 in order to have the OpenGL support required for the\n`ogre2` render engine. Gazebo and ArduPilot SITL will also run on macOS\n(Big Sur, Monterey and Venturua; Intel and M1 devices).\n\nFollow the instructions for a binary install of\n[Gazebo Garden](https://gazebosim.org/docs/garden/install) or [Gazebo Harmonic](https://gazebosim.org/docs/harmonic/install)\nand verify that Gazebo is running correctly.\n\nSet up an [ArduPilot development environment](https://ardupilot.org/dev/index.html).\nIn the following it is assumed that you are able to run ArduPilot SITL using\nthe [MAVProxy GCS](https://ardupilot.org/mavproxy/index.html).\n\n## Installation\n\nInstall additional dependencies:\n\n### Ubuntu\n\n#### Garden (apt)\n\nManual - Gazebo Garden Dependencies:\n\n```bash\nsudo apt update\nsudo apt install libgz-sim7-dev rapidjson-dev\nsudo apt install libopencv-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl\n```\n\n#### Harmonic (apt)\n\nManual - Gazebo Harmonic Dependencies:\n\n```bash\nsudo apt update\nsudo apt install libgz-sim8-dev rapidjson-dev\nsudo apt install libopencv-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl\n```\n\n#### Rosdep\n\nUse rosdep with\n[osrf's rosdep rules](https://github.com/osrf/osrf-rosdep?tab=readme-ov-file#1-use-rosdep-to-resolve-gazebo-libraries)\nto manage all dependencies. This is driven off of the environment variable `GZ_VERSION`.\n\n```bash\nexport GZ_VERSION=harmonic # or garden\nsudo bash -c 'wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list'\nrosdep update\nrosdep resolve gz-harmonic # or gz-garden\n# Navigate to your ROS workspace before the next command.\nrosdep install --from-paths src --ignore-src -y\n```\n\n### macOS\n\n```bash\nbrew update\nbrew install rapidjson\nbrew install opencv gstreamer\n```\n\nEnsure the `GZ_VERSION` environment variable is set to either\n`garden` or `harmonic`.\n\nClone the repo and build:\n\n```bash\ngit clone https://github.com/ArduPilot/ardupilot_gazebo\ncd ardupilot_gazebo\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo\nmake -j4\n```\n\n## Configure\n\nSet the Gazebo environment variables in your `.bashrc` or `.zshrc` or in \nthe terminal used to run Gazebo.\n\n#### Terminal\n\nAssuming that you have cloned the repository to `$HOME/ardupilot_gazebo`:\n\n```bash\nexport GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH\nexport GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH\n```\n\n#### .bashrc or .zshrc\n\nAssuming that you have cloned the repository to `$HOME/ardupilot_gazebo`:\n\n```bash\necho 'export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}' \u003e\u003e ~/.bashrc\necho 'export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}' \u003e\u003e ~/.bashrc\n```\n\nReload your terminal with `source ~/.bashrc` (or `source ~/.zshrc` on macOS).\n\n## Usage\n\n### 1. Iris quad-copter\n\n#### Run Gazebo\n\n```bash\ngz sim -v4 -r iris_runway.sdf\n```\n\nThe `-v4` parameter is not mandatory, it shows additional information and is\nuseful for troubleshooting.\n\n#### Run ArduPilot SITL\n\nTo run an ArduPilot simulation with Gazebo, the frame should have `gazebo-`\nin it and have `JSON` as model. Other commandline parameters are the same\nas usual on SITL.\n\n```bash\nsim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --map --console\n```\n\n#### Arm and takeoff\n\n```bash\nSTABILIZE\u003e mode guided\nGUIDED\u003e arm throttle\nGUIDED\u003e takeoff 5\n```\n\n### 2. Zephyr delta wing  \n\nThe Zephyr delta wing is positioned on the runway for vertical take-off. \n\n#### Run Gazebo\n\n```bash\ngz sim -v4 -r zephyr_runway.sdf\n```\n\n#### Run ArduPilot SITL\n\n```bash\nsim_vehicle.py -v ArduPlane -f gazebo-zephyr --model JSON --map --console\n```\n\n#### Arm, takeoff and circle\n\n```bash\nMANUAL\u003e mode fbwa\nFBWA\u003e arm throttle\nFBWA\u003e rc 3 1800\nFBWA\u003e mode circle\n```\n\n#### Increase the simulation speed\n\nThe `zephyr_runway.sdf` world has a `\u003cphysics\u003e` element configured to run\nfaster than real time: \n\n```xml\n\u003cphysics name=\"1ms\" type=\"ignore\"\u003e\n  \u003cmax_step_size\u003e0.001\u003c/max_step_size\u003e\n  \u003creal_time_factor\u003e-1.0\u003c/real_time_factor\u003e\n\u003c/physics\u003e\n```\n\nTo see the effect of the speed-up set the param `SIM_SPEEDUP` to a value\ngreater than one:\n\n```bash\nMANUAL\u003e param set SIM_SPEEDUP 10\n```\n\n### 3. Streaming camera video\n\nImages from camera sensors may be streamed with GStreamer using\nthe `GstCameraPlugin` sensor plugin. The example gimbal models include the\nplugin element:\n\n```xml\n\u003cplugin name=\"GstCameraPlugin\"\n    filename=\"GstCameraPlugin\"\u003e\n  \u003cudp_host\u003e127.0.0.1\u003c/udp_host\u003e\n  \u003cudp_port\u003e5600\u003c/udp_port\u003e\n  \u003cuse_basic_pipeline\u003etrue\u003c/use_basic_pipeline\u003e\n  \u003cuse_cuda\u003efalse\u003c/use_cuda\u003e\n\u003c/plugin\u003e\n```\n\nThe `\u003cimage_topic\u003e` and `\u003cenable_topic\u003e` parameters are deduced from the\ntopic name for the camera sensor, but may be overriden if required.\n\nThe `gimbal.sdf` world includes a 3 degrees of freedom gimbal with a\nzoomable camera. To start streaming:\n\n```bash\ngz topic -t /world/gimbal/model/mount/model/gimbal/link/pitch_link/sensor/camera/image/enable_streaming -m gz.msgs.Boolean -p \"data: 1\"\n```\n\nDisplay the streamed video:\n\n```bash\ngst-launch-1.0 -v udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false\n```\n\nView the streamed camera frames in [QGC](http://qgroundcontrol.com/):\n\n`Open QGC \u003e Application Settings \u003e Video Settings \u003e Select UDP h.264 Video Stream \u0026 use port 5600`\n\n![qgc_video_settings](https://github.com/user-attachments/assets/61fa4c2a-37e2-47cf-abcf-9f110d9c2015)\n\n\n### 4. Using 3d Gimbal\n\nThe Iris model is equipped with a 3d gimbal and camera that can be controlled directly in MAVProxy using the RC overrides.\n\n#### Run Gazebo\n\n```bash\ngz sim -v4 -r iris_runway.sdf\n```\n\n#### Run ArduPilot SITL with a specified parameter file\n\n```bash\ncd ardupilot\n\nsim_vehicle.py -D -v ArduCopter -f JSON --add-param-file=$HOME/ardupilot_gazebo/config/gazebo-iris-gimbal.parm --console --map\n```\n\nControl action for gimbal over RC channel:\n\n| Action | Channel | RC Low | RC High |\n| ------------- | ------------- | ------------- | ------------- |\n| Roll | RC6 | Roll Left | Roll Right |\n| Pitch | RC7 | Pitch Down | Pitch Up |\n| Yaw | RC8 | Yaw Left | Yaw Right |\n\nExample usage:\n\n`rc 6 1100` - Gimbal rolls left\n\n`rc 7 1900` - Gimbal pitch upwards\n\n`rc 8 1500` - Gimbal yaw neutral\n\n## Models\n\nIn addition to the Iris and Zephyr models included here, a selection\nof models configured use the ArduPilot Gazebo plugin is available in\n[ArduPilot/SITL_Models](https://github.com/ArduPilot/SITL_Models). \nClick on the images to see further details.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd title=\"Alti Transition\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/AltiTransition.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/150612555-958a64d4-c434-4f90-94bd-678e6b6011ec.png\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd title=\"SkyCat TVBS\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/SkyCatTVBS.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/145025150-4e7e48e1-3e83-4c83-be7b-b944db1d9152.png\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd title=\"Skywalker X8\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/SkywalkerX8.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/142733947-1a39e963-0aea-4b1b-a57b-85455b2278fe.png\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd title=\"Quadruped\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/Quadruped.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/144449710-5bab34b4-dabf-410f-b276-d290ddbb54b2.gif\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd title=\"WildThumper\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/WildThumper.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/144286154-231ac9b3-e54b-489f-b35e-bc2adb4b1aa0.png\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd title=\"Rover Playpen\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/RoverPlayPen.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/144513412-1b0661f1-fdf8-4aed-a745-e8bb73ffca91.jpg\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd title=\"Swan-K1\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/Swan-K1.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/210408630-01e5f56d-57ba-430e-b04d-62cb8d232527.png\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd title=\"Sawppy Rover\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/Sawppy.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/210653579-e635ffc2-2962-4221-83a8-9622915a4121.png\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd title=\"Hexapod Copter\"\u003e\n\u003ca href=\"https://github.com/ArduPilot/SITL_Models/blob/master/Gazebo/docs/HexapodCopter.md\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24916364/225340320-9aa31fe2-4602-4036-ba6b-491f72097c01.jpg\" width=\"100%\" style=\"display: block;\"\u003e\n\u003c/a\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n## Troubleshooting\n\nFor issues concerning installing and running Gazebo on your platform please\nconsult the Gazebo documentation for [troubleshooting frequent issues](https://gazebosim.org/docs/harmonic/troubleshooting#ubuntu).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardupilot%2Fardupilot_gazebo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardupilot%2Fardupilot_gazebo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardupilot%2Fardupilot_gazebo/lists"}