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.
Experiment 1: Introduction to RflySim Platform Components
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/Readme.pdf
📝 Experiment Overview: Introduces the functions and usage methods of various component software in the RflySim simulation platform, including basic functionality descriptions of modules such as 3DDisplay, CopterSim, drivers, PSP Toolbox, firmware, Python API, and QGroundControl.
Experiment 2: Fixed-Wing UAV Trajectory Flight Simulation
- 📦 Version Requirement:
Free Edition - 📁 File Path: e2_FWConfig/Readme.pdf
📝 Experiment Overview: Plans a fixed-wing UAV trajectory using the QGC ground station, enabling takeoff and flight along a predefined route. Learns Pixhawk frame configuration for fixed-wing UAVs, collaborative operation with the RflySim simulation platform, and QGC mission planning operations.
Experiment 3: Using the ReqCopterSim Interface Library
- 📦 Version Requirement:
Free Edition - 📁 File Path: e3_ReqCopterSim/Readme.pdf
📝 Experiment Overview:
Learn to use the Python-based ReqCopterSim.py interface library to configure initialization parameters for CopterSim simulation, including connection mode, position and attitude, simulation mode, DLL model, and 3D scene settings.
Experiment 4: VM_Ware Virtual Machine Installation and Basic Usage
- 📦 Version Requirement:
Free Edition - 📁 File Path: e4_VMware/Readme.pdf
📝 Experiment Overview: Explains the installation method of VM_Ware virtual machine software, virtual machine image loading, network configuration, and RflySimSDK environment setup, enabling correct installation and basic usage of virtual machines.
Experiment 5: Ubuntu System Installation and Configuration
- 📦 Version Requirement:
Free Edition - 📁 File Path: e5_Ubuntu/Readme.pdf
📝 Experiment Overview: This experiment introduces the installation and configuration methods of the Ubuntu system, including virtual machine installation, dual-boot deployment, software source replacement, and development environment setup, helping users master basic Ubuntu system usage.
Experiment 6: PX4 Environment Deployment and Firmware Compilation
- 📦 Version Requirement:
Free Edition - 📁 File Path: e6_PX4Build/Readme.pdf
📝 Experiment Overview: Explains the deployment of the PX4 development environment, cloning of official source code, firmware compilation, and uploading to the flight controller. Learn how to verify whether the environment installation is correct.
Experiment 7: APM Flight Controller Environment Deployment and Firmware Compilation
- 📦 Version Requirement:
Free Edition - 📁 File Path: e7_ApmBuild/Readme.pdf
📝 Experiment Overview: Explains how to deploy the APM flight controller environment, configure compiler dependencies, clone source code, and use the WAF tool to download and compile firmware. Learn the core architecture of APM and the principle of flight mode switching.
Experiment 8: ROS 1 Environment Deployment, Installation, and Testing
- 📦 Version Requirement:
Free Edition - 📁 File Path: e8_RosInstall/Readme.pdf
📝 Experiment Overview:
Mainly explains the installation and configuration methods of the ROS 1 environment, including installing ROS 1 on Ubuntu, configuring environment variables, and testing the installation correctness using the roscore command and the classic turtle control demo.
Experiment 9: ROS 2 Environment Deployment and Installation Testing
- 📦 Version Requirement:
Free Edition - 📁 File Path: e9_Ros2Install/Readme.pdf
📝 Experiment Overview: Explains the installation and configuration methods of the ROS 2 environment, learns how to verify whether the ROS 2 environment is correctly installed, and masters basic ROS 2 environment testing operations.
Experiment 10: MAVROS UAV Control
- 📦 Version Requirement:
Free Edition - 📁 File Path: e10_Mavros/Readme.pdf
📝 Experiment Overview: Learn MAVROS environment installation and configuration, ROS/ROS 2 communication mechanisms with PX4 flight controllers, and implement offboard control mode setup and autonomous flight for UAVs.
Experiment 11: Docker Installation and GPU Support Configuration
-
📦 Version Requirement:
Free Edition- 📁 File Path: e11_docker/Readme.pdf
📝 Experiment Overview: A hands-on tutorial for quickly setting up Docker, configuring GPU container support, enabling domestic image acceleration, and building a multi-architecture environment with buildx on Windows (WSL 2 + Docker Desktop) and Ubuntu.
Experiment 12: PX4 and ROS2 Communication Configuration
- 📦 Version Requirement:
Free Edition - 📁 File Path: e12_PX4ROS2/Readme.pdf
📝 Experiment Overview: Learn the fundamental communication configuration between PX4 and ROS2, master UDP communication using MicroXRCEAgent, and practice publishing and subscribing to ROS2 topics.
Experiment 13: Gazebo and PX4 Co-simulation
- 📦 Version Requirement:
Free Edition - 📁 File Path: e14_GazeboSim/Readme.pdf
📝 Experiment Overview: Master the general workflow for directly connecting Gazebo with PX4 for simulation on the RflySim platform, and understand the corresponding Gazebo environment configuration and operational mechanisms for different PX4 firmware versions.
Experiment 14: MAVROS Installation and Deployment
- 📦 Version Requirement:
Free Edition - 📁 File Path: e10_Mavros/1.MavrosInstall/Readme.pdf
📝 Experiment Overview: This experiment aims to install and deploy MAVROS 1 and MAVROS 2 packages in an Ubuntu virtual machine environment, enabling mastery of the complete installation process for MAVROS in ROS 1 (Noetic) and ROS 2 (Foxy) environments. It also introduces the role and principles of MAVROS as a MAVLink message communication middleware, and configures support for multi-UAV system connections.
Experiment 15: Cross-Platform Distributed Sensor Data Acquisition and ROS Publishing
- 📦 Version Requirement:
Free Edition - 📁 File Path: e13_VisAPIPyCpp/1.rosCppExps/Readme.pdf
📝 Experiment Overview: Build a distributed machine simulation sensor data processing system: request multi-modal sensor data (RGB, depth, LiDAR) from RflySim 3D via Python interface, and implement high-performance cross-ROS1/ROS2 reception, processing, and real-time visualization using C++.
Experiment 16: MAVROS Offboard Control Experiment
- 📦 Version Requirement:
Free Edition - 📁 File Path: e10_Mavros/2.Mavros1Offboard/Readme.pdf
📝 Experiment Overview: Achieve offboard control of PX4 drones via the MAVROS interface, learn ROS node communication with PX4 flight controllers, and master offboard mode setup, autonomous drone takeoff procedures, and the role of MAVROS in automated control.
Experiment 17: Python-Based Cross-ROS-Version Sensor Data Subscription
- 📦 Version Requirement:
Free Edition - 📁 File Path: e13_VisAPIPyCpp/2.rosPythonExps/Readme.pdf
📝 Experiment Overview: Build a Python-based sensor data subscription and processing system to retrieve multiple sensor data types from RflySim 3D and publish them to ROS topics. Supports unified interfaces for both ROS 1 and ROS 2, handling multi-modal data such as RGB images, depth images, and LiDAR point clouds, enabling real-time visualization and data format conversion.
Experiment 18: MAVROS2 Offboard Control
- 📦 Version Requirement:
Free Edition - 📁 File Path: e10_Mavros/3.Mavros2Offboard/Readme.pdf
📝 Experiment Overview: Implement offboard control of drones using the MAVROS 2 framework, verify communication mechanisms between ROS 2 and PX4 flight controllers, and learn basic MAVROS 2 usage along with drone attitude control and flight operations.
Experiment 19: 3DDisplay for Drone 3D Visualization
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/3DDisplay/Readme.pdf
📝 Experiment Overview: 3DDisplay is a lightweight version of the RflySim 3D visualization tool, displaying multi-rotor flight status in 3D graphics, including a mini-map and trajectory display features, designed to reduce hardware performance requirements for drone simulation visualization.
Experiment 20: CopterSim Hardware-in-the-Loop Simulation Software Usage
-
📦 Version Requirement:
Free Edition- 📁 File Path: e1_RflySimSoftwareReadme/CopterSim/Readme.pdf
📝 Experiment Overview: CopterSim is the core hardware-in-the-loop simulation software of the RflySim platform, supporting Pixhawk/PX4 flight controllers connected via serial port or network for simulation. It enables configuration of multirotor model parameters and data communication.
Experiment 21: PX4 Software System Architecture
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/Firmware/Readme.pdf
📝 Experiment Overview: Introduces the software architecture, middleware, flight control stack, inter-module communication mechanisms of the PX4 flight control system, and firmware deployment methods on the RflySim platform.
Experiment 22: FlightGear 2016.1.2 Flight Simulator Manual
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/FlightGear 2016.1.2/Readme.pdf
📝 Experiment Overview: Official manual for FlightGear open-source flight simulator version 2016.1.2, covering software installation, system configuration, flight operation, and advanced feature usage instructions.
Experiment 23: Python 3.8 Virtual Environment Configuration and Usage
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/Python38/Readme.pdf
📝 Experiment Overview: Introduces the Python 3.8 virtual environment (Python38Env) integrated into the RflySim platform, including configuration and basic usage of commonly used libraries for unmanned system algorithm development such as pymavlink, OpenCV, and numpy.
Experiment 24: QGroundControl Ground Station Tutorial
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/QGroundControl/Readme.pdf
📝 Experiment Overview: Introduces the interface layout, icon functions, and hardware/software environment configuration of the QGroundControl drone ground station, as well as core operational methods including takeoff/landing and route planning.
Experiment 25: RflySim3D Visualization Software
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/RflySim3D/Readme.pdf
📝 Experiment Overview: A 3D visualization software developed based on UE4.27, used for real-time display of drone status, supporting UDP communication and various shortcut operations.
Experiment 26: RflySimUE5 Visualization Simulation Software User Guide
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/RflySimUE5/Readme.pdf
📝 Experiment Overview: A drone visualization simulation software based on UE5.3, introducing its hardware configuration requirements, installation steps, and operation interface shortcut key usage.
Experiment 27: WinWSL Development Environment Configuration
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/WinWSL/Readme.pdf
📝 Experiment Overview: Introduces the configuration of a WSL2 Linux development environment on Windows, including ROS, Gazebo simulation, MAVLink support for drones, and AI toolchains.
Experiment 28: RflySim Drone Driver Installation
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/drivers/Readme.pdf
📝 Experiment Overview: Introduces the drone driver files automatically installed by the RflySim platform, including driver installation and configuration methods for flight controller hardware such as Arduino, ChibiOS, Cube, Holybro, MindPX, NXP, and PX4.
Experiment 29: Pixhawk Hardware Configuration and Simulink Development Environment Setup
-
📦 Version Requirement:
Free Edition- 📁 File Path: e1_RflySimSoftwareReadme/examples/Readme.pdf
📝 Experiment Overview: Learn to configure the Pixhawk flight controller hardware environment, master the MATLAB/Simulink development toolchain on Windows/Linux systems, and complete firmware compilation and application deployment.
Experiment 30: VisCreate Visual Sensor Parameter Configuration Tool
- 📦 Version Requirement:
Free Edition - 📁 File Path: e1_RflySimSoftwareReadme/viscreate/Readme.pdf
📝 Experiment Overview: Learn to use the VisCreate tool to configure drone visual sensor payloads, mastering parameter settings for various sensors—including RGB cameras, depth cameras, and LiDAR—and their real-time 3D联动 (synchronized interaction) functionality with RflySim 3D.