GithubHelp home page GithubHelp logo

ilmapp / ardupilot_gazebo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ardupilot/ardupilot_gazebo

0.0 0.0 0.0 40.04 MB

Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers

License: GNU General Public License v3.0

Shell 0.22% C++ 96.38% CMake 3.41%

ardupilot_gazebo's Introduction

ArduPilot Gazebo Plugin

ubuntu-build ccplint cppcheck

This is the official ArduPilot plugin for Gazebo. It replaces the previous ardupilot_gazebo plugin and provides support for the recent releases of the Gazebo simulator (Gazebo Garden) and (Gazebo Harmonic).

It also adds the following features:

  • More flexible data exchange between SITL and Gazebo using JSON.
  • Additional sensors supported.
  • True simulation lockstepping. It is now possible to use GDB to stop the Gazebo time for debugging.
  • Improved 3D rendering using the ogre2 rendering engine.

The project comprises a Gazebo plugin to connect to ArduPilot SITL (Software In The Loop) and some example models and worlds.

Prerequisites

Gazebo Garden or Harmonic is supported on Ubuntu 22.04 (Jammy). If you are running Ubuntu as a virtual machine you will need at least Ubuntu 20.04 in order to have the OpenGL support required for the ogre2 render engine. Gazebo and ArduPilot SITL will also run on macOS (Big Sur, Monterey and Venturua; Intel and M1 devices).

Follow the instructions for a binary install of Gazebo Garden or Gazebo Harmonic and verify that Gazebo is running correctly.

Set up an ArduPilot development environment. In the following it is assumed that you are able to run ArduPilot SITL using the MAVProxy GCS.

Installation

Install additional dependencies:

Ubuntu

Gazebo Garden:

sudo apt update
sudo apt install libgz-sim7-dev rapidjson-dev

Or Gazebo Harmonic:

sudo apt update
sudo apt install libgz-sim8-dev rapidjson-dev

macOS

brew update
brew install rapidjson

Ensure the GZ_VERSION environment variable is set to either garden or harmonic.

Clone the repo and build:

git clone https://github.com/ArduPilot/ardupilot_gazebo
cd ardupilot_gazebo
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4

Configure

Set the Gazebo environment variables in your .bashrc or .zshrc or in the terminal used to run Gazebo.

Terminal

Assuming that you have cloned the repository to $HOME/ardupilot_gazebo:

export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH
export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH

.bashrc or .zshrc

Assuming that you have cloned the repository to $HOME/ardupilot_gazebo:

echo 'export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}' >> ~/.bashrc
echo 'export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}' >> ~/.bashrc

Reload your terminal with source ~/.bashrc (or source ~/.zshrc on macOS).

Usage

1. Iris quad-copter

Run Gazebo

gz sim -v4 -r iris_runway.sdf

The -v4 parameter is not mandatory, it shows additional information and is useful for troubleshooting.

Run ArduPilot SITL

To run an ArduPilot simulation with Gazebo, the frame should have gazebo- in it and have JSON as model. Other commandline parameters are the same as usual on SITL.

sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --map --console

Arm and takeoff

STABILIZE> mode guided
GUIDED> arm throttle
GUIDED> takeoff 5

2. Zephyr delta wing

The Zephyr delta wing is positioned on the runway for vertical take-off.

Run Gazebo

gz sim -v4 -r zephyr_runway.sdf

Run ArduPilot SITL

sim_vehicle.py -v ArduPlane -f gazebo-zephyr --model JSON --map --console

Arm, takeoff and circle

MANUAL> mode fbwa
FBWA> arm throttle
FBWA> rc 3 1800
FBWA> mode circle

Increase the simulation speed

The zephyr_runway.sdf world has a <physics> element configured to run faster than real time:

<physics name="1ms" type="ignore">
  <max_step_size>0.001</max_step_size>
  <real_time_factor>-1.0</real_time_factor>
</physics>

To see the effect of the speed-up set the param SIM_SPEEDUP to a value greater than one:

MANUAL> param set SIM_SPEEDUP 10

Models

In addition to the Iris and Zephyr models included here, a selection of models configured use the ArduPilot Gazebo plugin is available in ArduPilot/SITL_Models. Click on the images to see further details.

Troubleshooting

For issues concerning installing and running Gazebo on your platform please consult the Gazebo documentation for troubleshooting frequent issues.

ardupilot_gazebo's People

Contributors

srmainwaring avatar khancyr avatar ryanf55 avatar acxz avatar swiftgust avatar 41mo avatar tridge avatar kant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.