Skip to content

RflySimSDK Developer Reference Manual

Welcome to the RflySim low-level developer interface center. This section fully corresponds to the original RflySimAPIs development package documentation, providing a series of highly open APIs that allow you to deeply interact with hardware, the environment, and the aircraft algorithm layer programmatically during simulation.


🚀 Overview of Usage

Python SDK Workflow

  1. Install Environment: Install the Python environment and core dependency packages (i.e., the various RflySim tool platforms you have installed).
  2. Configure Editor: Set up your code editor environment (e.g., VS Code and related interpreter settings).
  3. Call Interfaces: Call various interface functions in RflySimAPIs according to this document (for image acquisition, state polling, and sending control commands).
  1. Install Environment: Install the compatible version of MATLAB and Simulink toolbox.
  2. Configure Generation: Set up the automatic code generation pipeline environment based on PSP configuration.
  3. Build Model: Drag and drop corresponding modules and bridge interfaces into your model for joint verification.

📚 Quick Reference for Common Functions and Protocols


🐍 Python SDK Core Module Summary

To meet the full architecture verification requirements of Sim-to-Real, we provide the following segmented interface libraries for different technology stacks:

  • 📡 Network Communication


    comm Module Interface: Includes NetSimAPIV4, NetUavAPI, and LAN data forwarding with Redis synchronization mechanisms.

  • 🚁 Vehicle Model and Control


    ctrl Module Interface: Includes basic offline control APIs, DllSimCtrlAPI (for interaction with DLL comprehensive models), and PX4MavCtrl.

  • 🛡️ Prognostics and Health Management (PHM)


    phm Module Interface: Includes automated test configuration protocols, automatic command injection (AutoMavCmd), and cloud data logging (MavDataRec).

  • 🐝 UAV Swarm Multi-agent Cooperation


    swarm Module Interface: Includes crazyflie, VehicleApi, and distributed swarm interfaces compatible with DistSim.

  • 🎮 3D Simulation Engine Interaction


    ue Module Interface: Includes scene resource control tables, UE4CtrlAPI (for controlling weather, time, and camera view), and UEMapServe.

  • 👁️ Computer Vision Processing


    vision Module Interface: Includes VisionConfig, as well as CameraCtrlApi and VisionCaptureApi for acquiring 3D images from the scene.


RflySim natively supports exposing all bus functionalities to Simulink, enabling developers to achieve low-level co-simulation by dragging and dropping graphical modules:

Sub-toolbox Name Core Component Description
ADC and Serial External ADC channel and serial port read/write communication support
Miscellaneous Utility Blocks General-purpose modules for logging, debugging printouts, and parameter updates
Sensors and Actuators Low-level logic models for sensor and actuator interaction
uORB Read and Write Bridge for direct subscription and publishing of low-level flight controller uORB messages
RflySim APIs Essential C/C++ interface library for low-level control algorithm verification
RflySim Model Core joint model for dynamics and 3D scene simulation
RflySim PHM Automated safe flight envelope and extreme environment fault injection channel
RflySim Swarm Support for high-level data generation and swarm state extraction

💡 Advanced Development Tip: If you need to directly modify the low-level flight controller architecture or implement higher-level topic communication, please refer to ROS / ROS2 Node Low-level Interface Library.