ArduCopter-Gazebo SITL Sensor Simulations

I have a few questions regarding the sensors used in the Gazebo simulation and Ardupilot, and I would greatly appreciate your assistance:

  • Noise in Sensors: Are the sensors in the Gazebo simulation and Ardupilot configured with added noise? I noticed that the IMU sensor included with the Iris does not contain filled fields for sensor noise(ardupilot_gazebo/models/iris_with_standoffs/model.sdf at gazebo11 · ArduPilot/ardupilot_gazebo · GitHub). How does Ardupilot SITL add noise to the IMU measurements?
  • Adjusting IMU Noise Values: I need to change the noise values of the IMU in SITL, but I am having trouble finding where to make this change. I looked into libArdupilotPlugin.cpp (ardupilot_gazebo/src/ArduPilotPlugin.cc at gazebo11 · ArduPilot/ardupilot_gazebo · GitHub), where the IMU sensor is associated with the Iris model, but I couldn’t find any specified noise values there either. Could you please guide me on where to make these changes?
  • Fake GPS Simulation: I was searching for information on how the fake GPS simulation is handled, but I couldn’t find much. While libArdupilotPlugin.cpp (ardupilot_gazebo/src/ArduPilotPlugin.cc at gazebo11 · ArduPilot/ardupilot_gazebo · GitHub )loads a GPS sensor, it doesn’t seem to be used anywhere, with most related code commented out. Could you clarify how the fake GPS is simulated?
  • Compass Simulation in SITL: I also couldn’t find information on how the compass is simulated in SITL. Could you please provide some details on this?
  • AHRS and External Navigation Sources: If I change the EK3 source for posXY, velXY, and velZ from GPS to an external navigation source, does the AHRS data still fuse compass data and IMU data for yaw computation? I’m trying to understand whether the fusion of compass and IMU data occurs within the EKF or the AHRS. Since sendAttitude (ardupilot/libraries/GCS_MAVLink/GCS_Common.cpp at master · ArduPilot/ardupilot · GitHub) uses AHRS data to provide orientation values, I assumed that the fusion of compass yaw and IMU yaw rate should happen within the AHRS module. Could you please confirm this?

Thank you for answering all my questions!!

Hi @radiant_bee - the gazebo11 branch of ardupilot_gazebo is for history only. It is not being developed and is unlikely to be maintained. Gazebo11 goes EOL in Jan 2025 (Gazebo Classic End-of-Life - General - Gazebo Community). I’d recommend migrating to Gazebo Harmonic which is the supported version on Ubuntu 24.04. The answers below refer to the main branch of ardupilot_gazebo.

The models do not add noise to the IMU sensor.

To add noise edit the IMU sensor SDF element in the iris model following the specifications here: SDFormat Specification

The GPS is simulated within the FC SITL code (not in Gazebo). There is currently no mechanism to pass data from a NatSat sensor simulated in Gazebo back to the flight controller. I’ve looked at using the ArduPilot DDS library to do this, however it requires a more complicated set up using ROS 2 and new messages as the existing ROS NavSat message does not contain many of the fields expected in a simulated GPS.

Same as for GPS simulation. It is handled within the SITL code rather than in Gazebo.