{"id":19195406,"url":"https://github.com/ardupilot/ardupilot_gz","last_synced_at":"2025-04-09T07:08:04.793Z","repository":{"id":164963736,"uuid":"613660701","full_name":"ArduPilot/ardupilot_gz","owner":"ArduPilot","description":"Tools for ArduPilot ROS2 integration and testing on ROS 2 humble","archived":false,"fork":false,"pushed_at":"2025-01-31T16:42:23.000Z","size":64,"stargazers_count":45,"open_issues_count":18,"forks_count":38,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-02T04:09:22.549Z","etag":null,"topics":["gazebo","gazebo-simulator","ros2","ros2-humble","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-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":null,"funding":null,"license":"LICENSE","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-03-14T02:29:15.000Z","updated_at":"2025-03-22T08:27:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a1cd38a-079d-4074-8cbb-8f94360150f8","html_url":"https://github.com/ArduPilot/ardupilot_gz","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_gz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2Fardupilot_gz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArduPilot","download_url":"https://codeload.github.com/ArduPilot/ardupilot_gz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"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":["gazebo","gazebo-simulator","ros2","ros2-humble","simulation"],"created_at":"2024-11-09T12:09:50.021Z","updated_at":"2025-04-09T07:08:04.774Z","avatar_url":"https://github.com/ArduPilot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ardupilot_gz\n\nThis project contains ROS 2 packages for simulating models controlled\nby ArduPilot SITL with DDS support in Gazebo.\n\nThe project is adapted from the [`ros_gz_project_template`](https://github.com/gazebosim/ros_gz_project_template) project.\n\n## Included packages\n\n* `ardupilot_gz_description` - Contains the SDFormat description of the simulated\n  system.\n\n* `ardupilot_gz_gazebo` - Contains Gazebo specific code such as system plugins.\n\n* `ardupilot_gz_application` - Contains ROS 2 specific code and configuration.\n\n* `ardupilot_gz_bringup` - Contains launch files and high level utilities.\n\n\n## Prerequisites\n\n- Install [ROS 2 Humble](https://docs.ros.org/en/humble/index.html)\n- Install [Gazebo Harmonic (recommended)](https://gazebosim.org/docs/harmonic) or [Gazebo Garden](https://gazebosim.org/docs/garden)\n- Follow the [`Installing Build Dependencies`](https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_DDS#installing-build-dependencies) section of `AP_DDS`'s README\n\n## Install\n\n#### 1. Create a workspace folder\n\n```bash\nmkdir -p ~/ros2_ws/src\n```\n\n#### 2. Get the project source\n\n```bash\ncd ~/ros2_ws\nvcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/ros2_gz.repos --recursive src\n```\n\n#### 3. Set the Gazebo version to Harmonic or Garden:\n\nIt is recommended to put this in your `~/.bashrc` or equivalent file.\n\n```bash\nexport GZ_VERSION=harmonic\n```\n\n#### 4. Update ROS dependencies\n\n```bash\ncd ~/ros2_ws\nsource /opt/ros/humble/setup.bash\nsudo apt update\nrosdep update\nrosdep install --from-paths src --ignore-src -y\n```\n\n#### 5. Build\n\n```bash\ncd ~/ros2_ws\ncolcon build\n```\n\n#### 6. Test\n\n```bash\nsource ./install/setup.bash\ncolcon test --packages-select ardupilot_sitl ardupilot_dds_tests ardupilot_gazebo ardupilot_gz_applications ardupilot_gz_description ardupilot_gz_gazebo ardupilot_gz_bringup\ncolcon test-result --all --verbose\n```\n\n## Usage\n\n#### 1. Source the workspace\n\n```bash\nsource ~/ros2_ws/install/setup.sh\n```\n\n#### 2. Launch the simulation\n\n```bash\nros2 launch ardupilot_gz_bringup iris_runway.launch.py rviz:=true use_gz_tf:=true\n```\n\n#### 3. Launch a GCS (MAVPorxy)\n\n```bash\nmavproxy.py --master udp:127.0.0.1:14550  --console --map\n```\n\n#### 4. Inspect topics\n\n```bash\n$ ros2 topic list\n/ap/battery/battery0\n/ap/clock\n/ap/navsat/navsat0\n/ap/tf_static\n/clicked_point\n/clock\n/goal_pose\n/initialpose\n/iris/odometry\n/joint_states\n/parameter_events\n/robot_description\n/rosout\n/tf\n/tf_static\n```\n\n## Advanced variations\n\nHere's a list of all the additional use cases from this repository:\n\n### 1. Iris Maze\n\nThis simulation has an iris copter equipped with a 360 degrees 2d lidar in a maze world.\n\n```bash\nros2 launch ardupilot_gz_bringup iris_maze.launch.py rviz:=true use_gz_tf:=true\n```\n\n### 2. Wild Thumper playpen\n\nThis simulation includes a skid-steer rover equipped with a 2d lidar in a playpen world.\n\n\n```bash\nros2 launch ardupilot_gz_bringup wildthumper_playpen.launch.py rviz:=true use_gz_tf:=true\n```\n\n\n## Notes\n\n### 1. Additional dependencies\n\n`ros_gz` has a dependency on `gps_msgs` included in\n\n```bash\ngit clone https://github.com/swri-robotics/gps_umd.git -b ros2-devel\n```\n\nWhen building from source add `COLCON_IGNORE` to `gpsd_client` as\nthis package is not required and will not build on macOS.\n\n### 2. `sdformat_urdf`\n\n#### 2.1. Library extension\n\nOn macOS the `robot_state_publisher` node cannot load the\n`sdformat_urdf_plugin` plugin unless the extension is changed:\n\n```bash\ncd ./install/sdformat_urdf/lib\nln -s libsdformat_urdf_plugin.so libsdformat_urdf_plugin.dylib\n```\n\n#### 2.3. Model URIs\n\nThe `sdformat_urdf` plugin requires the `\u003curi\u003e` element to use\nthe `package://` prefix for a resource to be located by RViz. At present\nthis requires the models to be edited.\n\nAll occurrences of\n\n    `model://{model_name}`\nmust be replaced with\n\n    `package://{package_name}/models/{model_name}`\n\n\n#### 2.4. SDFormat environment variables\n\nThe `sdformat_urdf` plugin uses the `sdformat13` libraries to parse the\nmodel description which relies on the environment variable\n`SDF_PATH` to resolve model resources. This is usually set in `gz-sim7`,\nhowever when using the plugins standalone, for instance in the bring-up\nlaunch files, `SDF_PATH` must be set otherwise the plugin will not resolve\nthe models and their dependencies.\n\n```bash\nsource ~/ros2_ws/install/setup.sh\nexport SDF_PATH=$GZ_SIM_RESOURCE_PATH\n```\n\nThis is assigned in the `iris.launch.py` file as `SDF_PATH` is not usually set\nby the `ament` environment hooks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardupilot%2Fardupilot_gz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardupilot%2Fardupilot_gz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardupilot%2Fardupilot_gz/lists"}