Chapter 2: Experimental Platform Configuration¶
"Craftsmen must first sharpen their tools"—Given the complexity of the unmanned system development workflow, spanning from low-level flight controllers to high-level AI, this chapter comprehensively introduces the core component architecture and cross-platform usage methodology of the RflySim toolchain; it guides users through the complete process from one-click toolchain environment installation, verification testing, to basic case execution, thereby establishing the essential software ecosystem foundation for subsequent advanced usage.
2.1 Background and Theory¶
As a professional, fully open, and comprehensive unmanned system development simulation platform, the RflySim toolchain embodies three essential characteristics: cross-ecosystem compatibility, Model-Based Design (MBD), and closed-loop Sim2Real. Whether it is Software-in-the-Loop (SITL) mode—requiring only a PC to validate control theory and upper-layer path planning logic—or Hardware-in-the-Loop (HITL) mode—capable of verifying embedded real-time responsiveness and highly ensuring seamless migration of real-flight code—RflySim provides fully self-consistent automated build tools. To support such high-fidelity simulation and automatic code generation, its architecture involves cross-dependencies across Windows (serving as the host and host for the 3D simulation engine), Ubuntu (primarily serving as the algorithm development platform and ROS communication layer), WSL, and Docker (used for agile cross-platform system bridging). At the control and protocol layer, it is fundamentally built upon the mainstream PX4 flight controller ecosystem and MAVLink communication protocol, significantly lowering the barrier for cutting-edge research involving multiple languages (C++/Python) and multiple middleware (ROS1/ROS2).
2.2 Framework and Interfaces¶
Building a stable intelligent unmanned system test and development pipeline often demands high hardware specifications and significant time investment. RflySim provides “one-click environment deployment” capability and a rich interface ecosystem at the architectural level.
2.2.1 Core Components Overview¶
The toolchain encompasses three major systems: CopterSim, running the physical engine on the backend to compute vehicle dynamic responses; RflySim3D (based on UE), responsible for high-fidelity rendering and sensor data generation; and the ground station platform QGroundControl, for global monitoring and telemetry data. Additionally, lightweight tools SimCreate and VisCreate—designed for rapid simulation experiment initialization and pre-configured parameter setup—serve as auxiliary framework supports.
2.2.2 Installation and Verification Process¶
To ensure stable operation of the aforementioned multi-module system, a computer with more than 16 GB RAM and a dedicated GPU of at least RTX 2060 is recommended. After obtaining the complete .iso mounted system image, the development environment supports silent, rapid deployment.
- Infrastructure Configuration: First, run
UbuntuWSL/EnableWSL.batto enable Linux subsystem permissions on Windows. - Core Package Installation: Depending on whether low-level flight controller development is required, decide whether to install MATLAB (by running
OnekeyScript.p) or directly executeOnekeyScript.exefor standalone green-mode installation. - Closed-Loop Environment Verification: After the dual-end compilation toolchain, Cygwin, and Python configurations are ready (the desktop shortcut
RflyToolsis automatically generated), execute theSITLRuncommand set to launch a drone for one-click testing. If the interface successfully enters the3DFixedtakeoff phase, the installation is deemed complete.
2.2.3 Typical Development Workflow and Teaching Tools¶
At the interface level, RflySim’s typical development paradigm branches into two pathways. For low-level developers, the Simulink Toolbox (PX4PSP) enables the traditional control closed-loop: model building → automatic code generation → PX4 firmware compilation → in-the-loop testing. For high-level AI researchers, invoking the Python RflySimSDK and ROS interface suite allows high-frequency external Offboard mode operations for machine vision and intelligent multi-agent adversarial scenarios. This pathway is directly compatible with recommended teaching hardware (e.g., Pixhawk-series flight controllers and Jetson Orin NX onboard computers).
2.3 Showcase of Representative Cases¶
2.4 Course-Related Video Lectures¶
Lecture Recordings for This Chapter:
2.5 Chapter Experiment Cases¶
The verification experiments and guided cases related to this chapter are located in the [Installation Directory]\RflySimAPIs\2.RflySimUsage folder.
2.5.1 Interface Learning Experiments¶
Located in the 2.RflySimUsage\0.ApiExps folder, covering foundational platform interface tutorials and general introductions to each tool.