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¶
- Install Environment: Install the Python environment and core dependency packages (i.e., the various RflySim tool platforms you have installed).
- Configure Editor: Set up your code editor environment (e.g., VS Code and related interpreter settings).
- Call Interfaces: Call various interface functions in
RflySimAPIsaccording to this document (for image acquisition, state polling, and sending control commands).
Simulink Toolbox Workflow¶
- Install Environment: Install the compatible version of MATLAB and Simulink toolbox.
- Configure Generation: Set up the automatic code generation pipeline environment based on
PSPconfiguration. - Build Model: Drag and drop corresponding modules and bridge interfaces into your model for joint verification.
📚 Quick Reference for Common Functions and Protocols¶
- BAT Script Parameter Quick Reference: Console and BAT batch parameters for controlling
CopterSimand environment startup. - Platform Communication Protocol Summary: Covers UDP/TCP/serial protocol definitions for data communication between various modules.
🐍 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), andPX4MavCtrl. -
🛡️ 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 withDistSim. -
🎮 3D Simulation Engine Interaction
ue Module Interface: Includes scene resource control tables,
UE4CtrlAPI(for controlling weather, time, and camera view), andUEMapServe. -
👁️ Computer Vision Processing
vision Module Interface: Includes
VisionConfig, as well asCameraCtrlApiandVisionCaptureApifor acquiring 3D images from the scene.
🟩 MATLAB / Simulink Toolbox List¶
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 |
|---|---|
| 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 & Vision | 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.