Skip to content

Simulation Stack

The simulation stack is responsible for simulating the physical behavior of the aircraft, arm, and environment in Gazebo.

Simulation Architecture

Gazebo Plugins

Core Plugins

PluginPathFunction
GammaArmControlwindshape_dev/plugins/gamma_arm_control/Arm joint control
PX4GzSimBridgewindshape_dev/plugins/px4_gzsim_bridge/MAVLink-Gazebo bridge
JointPositionControllerwindshape_dev/plugins/joint_position_controller/Joint position control

Simulation Plugins

PluginDescription
generic_motorGeneric motor model, supports ESC simulation
gstreamerReal-time video stream output
motor_failureMotor failure injection for fault-tolerant control testing
moving_platformMoving platform simulation
buoyancyHydrodynamic buoyancy simulation
airspeedAirspeed sensor simulation

Sensor Simulation

SensorModuleDescription
GPSsensor_gps_simSimulates GPS positioning, supports multi-constellation
Magnetometersensor_mag_simSimulates geomagnetic field, supports interference
Barometersensor_baro_simSimulates altitude measurement
Airspeedsensor_airspeed_simSimulates pitot-tube airspeed
AGPsensor_agpsimSimulates angular position sensor

Lockstep Scheduler

To ensure precise temporal synchronization in simulation, all simulation configurations enable the lockstep scheduler:

bash
EXTRA_CMAKE_ARGS="-DENABLE_LOCKSTEP_SCHEDULER=ON"

The lockstep scheduler ensures:

  • PX4 control loops are strictly aligned with Gazebo simulation steps
  • Sensor data is published at the correct simulation time
  • Actuator commands are applied to the physics engine at the correct time