Servers by jDrones

Quadplane SITL with gazebo

Hi,
I’m trying to run software in the loop with gazebo for quadplane similar to ‘gazebo-iris’ for copter. How do I go about creating quadplane model and simulating with Gazebo?

Any help is appreciated, Thank you

Hi, To create your own quadplane for ardupilot - gazebo
you will need

  1. Model (SDF defintion of model base links, joints, sensors and so on.)
  2. Aerodynamics (liftdrag plugin of gazebo)
  3. ArduPilot-Gazebo Interface (ardupilot plugin for gazebo)
  4. Virtual World (also SDF definition with environment, models and actors…)

Probably it is best to start with trying to understand SDF of current models, refer and look through current models such as iris, zephyr and so on.
Models can be nested.

Once you understand such, It would be much easier converting VTOL models of PX4_sitl to ArduPilot model with your understanding of SDF of ArduPilot models

After that, you will need default param for quadplane (contents are not much important, basic definition of airframe and IMU setup is enough)
and edit sim_vehicle.py file for start simulation with default params(which is SITL launch file of ArduPilot)

1 Like

Thank you for your reply. I will go through and try creating a model (SDF file). I added the quadplane information in Tools/autotest/pysim/vehicleinfo.py. Is there a need to change sim_vehicle.py? I was under the impression that no change to sim_vehicle.py is required.

Thank you.

I don’t know how it is actually working under the ArduPilot SITL
but I got the impression that ArduPilot SITL automatically parsing prefix gazebo
to connect to gazebo interface
same param file without gazebo prefix does not connect to gazebo-SITL
such as
sim_vehicle.py -v ArduCopter -f gazebo-iris
sim_vehicle.py -v ArduPlane -f gazebo-zephyr
these are valid to launch gazebo SITL

you may not need another param file but will need a launch argument
such as gazebo-quadplane
there are bunch of code to add launch arguments in the middle of sim_vehicle.py script.
Add one if you need

So what I did was add this following line in Tools/autotest/pysim/vehicleinfo.py

“gazebo-quadplane”: {
“waf_target”: “bin/arduplane”,
“default_params_filename”: “default_params/quadplane.parm”,
},

And in the terminal when I do “sim_vehicle.py -h” gazebo-quadplane does show up under frames for Arduplane

I am trying the same. I have ArduPlane talking to Gazebo, but now I am stuck without a quadplane model.

@arjun7965, would you mind sharing the model file? Also, which Gazebo Version are you using?
I am currently using Gazebo9 and the SwiftGust plugin with the gazebo9 branch.

@snuffytruffle its still a WIP and I haven’t worked on it for a while. I used the quadplane model made by px4 : https://github.com/PX4/sitl_gazebo/tree/master/models/standard_vtol
You need to make some changes to the model file for it to work with arducopter, for example you need to replace the “mavlink_interface” plugin with the “arducopter_plugin” etc. You can go through iris_with_standoffs_demo to get an idea on how/what to modify.

I made it work.
Its not super stable yet, but it flies both in VTOL and cruise and transitions.
I don’t think you can upload files here so PN me if you want it.

1 Like

Can you share the files maybe on github

Hi, We’re trying to setup a simulation of a quadplane in Gazebo. I’ve added an entry in vehicleInfo.py, I’ve created a .parm file with INS calibration and I have a quadplane model with the ArduPilotPlugin which connects to the ArduPlane SITL.

The problem I’m facing now, is that the moment ArduPlane connects to Gazebo, it starts sending motor commands to the rotors, even though the UAV is disarmed, so the rotors are spinning (albeit slowly). When trying to fly a mission the UAV arms but the rotors do not increase in speed. I am thinking I might have to map the servos correctly, but is there an overview of which output channels are default for a quadplane setup in SITL?

Servers by jDrones