Skip to main content


SITL in Gazebo

SITL (software in the loop) simulator allows you to run Betaflight without any hardware.

Install Gazebo

Official Installation

Please also check Vehicle Gateway

Build Betaflight



To avoid the simulation speed slowing down, it is suggested to set some settings, shown below:

In configuration page:

  1. ESC/Motor: PWM, disable Motor PWM speed Sparted from PID speed
  2. PID loop frequency as high as it can.

Start and Run

  1. Start Betaflight: ./obj/main/betaflight_SITL.elf
  2. Start Gazebo: gazebo --verbose ./
  3. Connect your transmitter and fly/test, used app to send MSP_SET_RAW_RC, see code.

Betaflight -> Gazebo udp:// Gazebo -> Betaflight udp://

UARTx will bind on tcp:// when the port has been opened.

eeprom.bin, size 8192 Byte, is for config saving. Size can be changed in src/main/target/SITL/pg.ld >> __FLASH_CONFIG_Size

SITL in RealFlight 9

RealFlight is one of the best commercial RC simulators with accurate airplane, helicopter, and multirotor simulations. ArduPilot also offers RealFlight SITL. To use it you may need to purchase it on Steam or offical website.


To let Betaflight SITL work with RealFlight, you need Windows 10 or Windows 11 with WSL. Ubuntu 20.04 in WSL2 on Windows 11 x64 is tested. RealFlightBridge is also required.

On WSL2, you need to configure the Betaflight following document here.

Build Betaflight with


On Windows, download RealFlightBridge by

$ git clone

Import the quadcopter for RealFlight and Betaflight at models/Quadcopter X Betaflight - flightaxis_AV.RFX in RealFlightBridge. A detailed guide for improtanting can be found here. Moreover, update the setting of RealFlight to allow API.

You also need to prepare a controller for running SITL. We recommend to use transmitter with OpenTX/EdgeTX as a game controller. In addition, mixers of channel 5 and 6 should be mapped to two switches for arming and changing mode.


To running SITL, you may need to:

  1. Open and select the newly improted model Quadcopter X Betaflight - flightaxis in RealFlight.

    You need to restart RealFlight after you edit the model in RealFlight!

  2. Starting the RealFlightBridge in Windows by

    $ python

    You must start RealFlightBridge in Windows before start the Betaflight SITL.

  3. Start the Betaflight SITL. First you need to get the Windows' IP in WSL. In WSL enter

    $ (ipconfig.exe | grep 'vEthernet (WSL)' -A4 | cut -d":" -f 2 | tail -n1 | sed -e 's/\s*//g')
    $ ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet netmask broadcast
    inet6 fe80::215:5dff:fea4:215d prefixlen 64 scopeid 0x20<link>
    ether 00:15:5d:a4:21:5d txqueuelen 1000 (Ethernet)
    RX packets 219079 bytes 32440158 (32.4 MB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 145744 bytes 10533796 (10.5 MB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 is the example output of your Windows IP and is your WSL IP. These IPs change everytime you reboot the computer.

    Then go to the Betaflight root and start the SITL with this IP.

    $ cd ~/develop/betaflight/
    $ ./obj/main/betaflight_SITL.elf
    The SITL will output to IP (Gazebo) and (RealFlightBridge)
    init PwmOut UDP link to gazebo
    init PwmOut UDP link to RF9
    start UDP server @9003...0
    start UDP server for RC input @9004...0
    [FLASH_Unlock] loaded 'eeprom.bin', size = 32768 / 32768
    [data]new fdm 136 t:182.834571 from
    [data]new rc 40: t:182.834571 AETR: 1498 1501 1105 1501 AUX1-4: 1100 1899 1899 1100
    bind port 5761 for UART1

    Then you can open the Betaflight Configurator on Windows to connect to RealFlight via WSL IP.

    After connect to Betaflight you need to apply this DIFF file and set the arming switch with your controller.

  4. Finally, you can arm and take-off the Quadcopter with Betaflight SITL in RealFlight with your controller.


If you want to create your own model and extend the SITL, please refer to this guide and this document.