Comparison between Gazebo and AirSim for HITL

Hi community,

I am currently working on control algorithms of a convertible VTOL aircraft which is a combination of a hexacopter and an fixed-wing (not tilt-rotor). I am trying to find a good way to simulate my control law using HITL simulation. It looks like there are basically two choices: Gazebo and AirSim. However I am feeling really indecisive on which one should I use.

More specifically, things I want to simulate are:

  1. Disturbances(torques and forces) in multi-copter flights which are generated by the airfoils because of winds(uniform or possibly non-uniform with stochastic params).
  2. Fixed-wing aerodynamics.
  3. Complicated dynamics during transition.

Based on my researches, neither Gazebo nor AirSim is satisfactory. AirSim does not have a fixed-wing mode right now. Gazebo has a fixed-wing mode but it uses experimental data and look up tables for its aerodynamics engine which I think can also be implemented in AirSim using the same strategy. AirSim has implemented a model for angular drag but its approximation of the aircraft by a box makes it far away from real, while I do not see angular drag in Gazebo. Their sensor and world models look similar to each other(maybe AirSim is slightly better?) but this is not my main concern.

I am more like a Matlab guy with limited C++ experience. I have used gazebo to simulated an adaptive PID VTOL controller with PX4 in SITL but what I did is just modify some .cpp files such as mc_att_control. So I will really appreciate it if someone could tell me which simulator is more suitable for what I am trying to do.

@NathanNingyuanZhang The advantage of using Airsim is the photo realistic scene that is useful when using visual sensors.

If you are just developing a control algorithm, I recommend you use Gazebo with the PX4 SITL plugin. Using airsim is more involved as the unreal engine is not well supported on linux.

From my experience, the fixed wing aerodynamics are accurate enough to evaluate the controller unless you stall and enter the nonlinear region of dynamics.

Thank you very much for your reply!

Yeah many people told me Gazebo is a better choice for developing control algorithm. But after research I found that Gazebo has no obvious advantage over AirSim in terms of simulating aircraft. The problems are, first, our fixed-wing has a canard configuration with flaps and ailerons. So I really don’t know if Gazebo’s aerodynamic model is accurate enough. We have some model based on system id and will probably try to implement that for simulation. Second, one thing I want to simulate is how does the airfoil affect aricraft dynamics in multicopter flight under side winds. Neither has this feature.

I feel like I have to implemented a new aerodynamics model, and a new air drag model in multicopter mode. I really don’t know which simulator is more extendable.

@NathanNingyuanZhang Even so, I still recommend you using gazebo.

  1. There is a larger community using gazebo than airsim. After you are done with your implementation, there will be more people that benefit from your work if you use gazebo

  2. Gazebo is not supposed to represent accurate dynamics. This is also true with AirSim. It is a simulation tool that is good enough to evaluate your ideas, which I believe both gazebo and AirSim is good enough. The trade off made on gazebo is a design choice to have a good enough approximation of physics while having more efficient computation and room for additional extensions. It would still be cool if you do improve the aerodynamics model (or the one in rotors_simulator).

  3. Airsim uses the unreal engine, which is not well supported as gazebo on ROS / Linux environments. Moreover, the unreal engine requires quite demanding computation capabilities which most people might not have access to.

One thing though, you are referring to a aerodynamics model in gazebo, but what exactly are you referring to? Have you looked in to the rotor models in the rotors_simulator?

1 Like