Skip to content

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).

alt text


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.

alt text

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.

  1. Infrastructure Configuration: First, run UbuntuWSL/EnableWSL.bat to enable Linux subsystem permissions on Windows.
  2. Core Package Installation: Depending on whether low-level flight controller development is required, decide whether to install MATLAB (by running OnekeyScript.p) or directly execute OnekeyScript.exe for standalone green-mode installation.
  3. Closed-Loop Environment Verification: After the dual-end compilation toolchain, Cygwin, and Python configurations are ready (the desktop shortcut RflyTools is automatically generated), execute the SITLRun command set to launch a drone for one-click testing. If the interface successfully enters the 3DFixed takeoff phase, the installation is deemed complete.

alt text

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).

alt text

alt text


2.3 Showcase of Representative Cases


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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

    📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

    📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

📝 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

    📝 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

📝 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.

2.5.2 Basic Usage Experiments

Stored in the 2.RflySimUsage\1.BasicExps folder, these experiments provide a complete set of supplementary instructional materials for beginners.

Experiment 1: CopterSim Model Design and Hardware-in-the-Loop Simulation

📝 Experiment Overview: Familiarize yourself with the model configuration area of the CopterSim main interface. Configure parameters such as total mass (1.5 kg), wheelbase (450 mm), and altitude (0 m), then calculate hover duration and throttle percentage for various configurations (tricopter to octocopter). Master the hardware-in-the-loop (HITL) simulation setup process for hexacopters.

Experiment 2: DLL Model Import into CopterSim Simulation

📝 Experiment Overview: Learn to import custom vehicle kinematics DLL models into CopterSim for software-in-the-loop (SIL) or hardware-in-the-loop (HITL) simulation. Master both manual and automatic DLL loading methods, including configuration experiments for multirotor and fixed-wing models.

Experiment 3: RflySim 3D Keyboard Shortcuts

📝 Experiment Overview: Learn keyboard shortcuts and external command switching functionality in RflySim 3D software. Master control of 3D scene viewpoints, object movement, and scene transitions via keyboard shortcuts and CopterSim software to improve simulation operation efficiency.

Experiment 4: Python 3.8 Environment for Reading Flight Controller Logs

📝 Experiment Overview: Use a Python 3.8 environment to read flight controller .ulg log files. Learn to convert logs to CSV format using the ulog2csv tool for subsequent data analysis.

Experiment 5: Manual Software-in-the-Loop Simulation

📝 Experiment Overview: Familiarize yourself with the software-in-the-loop (SIL) simulation workflow. Learn to configure CopterSim for PX4_SITL mode, compile PX4 firmware via WSL, and perform basic operations such as drone takeoff control using QGroundControl.

Experiment 6: BAT Script for One-Click Simulation Software Launch

📝 Experiment Overview: Use a BAT batch script to launch QGroundControl, RflySim 3D, and CopterSim with one click. Learn to configure simulation environment parameters via SITLRun.bat.

Experiment 7: MATLAB Code Generation for Flight Controller Firmware

📝 Experiment Overview: Based on the RflySim platform, use MATLAB/Simulink’s automatic code generation technology to generate PX4 flight controller firmware from a built control model in one click, and download it to the flight controller for execution.

Experiment 8: Simulink Cluster Control Interface Experiment
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: Conduct a swarm control interface experiment using Simulink S-Function blocks, enabling quadcopters to start up and enter hover mode, while mastering the construction of communication structures and quadcopter control models.

Experiment 9: PX4 Firmware Compilation

📝 Experiment Overview: Compile the PX4 firmware using the WinWSL subsystem, learning how to generate firmware files for different flight controller hardware platforms using the make command.

Experiment 10: Firmware Flashing

📝 Experiment Overview: Introduce firmware flashing methods for RflySim-generated flight controller firmware, covering both Simulink and QGC approaches, and learn firmware compilation commands and environment configuration for various flight controller models.

Experiment 11: PX4 Onboard Application Development

📝 Experiment Overview: Learn the complete development workflow for creating applications (APPs) within the PX4 source code, including template programming, CMake configuration, SITL (Software-In-The-Loop) simulation debugging, and setting up auto-startup on boot.

Experiment 12: Log Data Acquisition

📝 Experiment Overview: Learn to record vehicle motion data—including position, velocity, and motor RPM—during simulation using CopterSim, and generate CSV files for subsequent data analysis.

Experiment 13: RflySim 3D Scene Loading

📝 Experiment Overview: Learn scene switching and control methods in RflySim 3D, and master the workflow for developing 3D scenes using Unreal Engine 4 and importing them into the RflySim 3D platform.

Experiment 14: Flight Controller Hardware Compilation Command Recognition

📝 Experiment Overview: Connect to flight controller hardware via QGroundControl to identify compilation commands for different Pixhawk-series flight controllers, learn QGC’s firmware recognition functionality and PX4 firmware version compatibility—suitable for developers working on low-level flight controller algorithms.

Experiment 15: Route Planning and HITL Simulation

📝 Experiment Overview: Learn to use QGroundControl’s route planning functionality, setting parameters such as waypoint altitude, hover duration, and heading angle to achieve autonomous flight of Pixhawk flight controllers in Hardware-In-The-Loop (HITL) simulation.

Experiment 16: USB Remote Controller SITL Simulation

📝 Experiment Overview: Learn to connect the Tiandihui ET10 remote controller via USB, configure gamepad mode and CH5–CH8 channel override in QGC, and achieve software-in-the-loop (SITL) flight control simulation for drones.

Experiment 17: PX4 Version and Compilation Command Switching

📝 Experiment Overview: Learn to switch PX4 firmware versions and compilation commands within the RflySim toolchain, mastering environment configuration for compiling firmware across different versions.

Experiment 18: VisCreate Sensor Configuration Tool Usage
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: Learn to configure RGB cameras, depth cameras, LiDAR, and other sensors using the VisCreate graphical tool; master parameter configuration such as field of view (FOV), resolution, and refresh rate; and integrate with the RflySim 3D simulation environment while configuring data transmission protocols.

Experiment 19: CopterSim JSON External Communication Configuration

📝 Experiment Overview: Configure multi-host UDP/TCP network communication between CopterSim and PX4/QGC/UE via Config.json; master multi-end communication topologies and IP binding strategies.

2.5.3 Advanced Development Experiments

Located in the 2.RflySimUsage\2.AdvExps folder, these experiments further familiarize users with certain low-level firmware ecosystem configurations.

Experiment 1: QGC Shared-Memory Image Display

📝 Experiment Overview: Implement image display of RflySim 3D simulation sensor data in QGC via shared memory, with configurable camera parameters (pixel count, aircraft ID binding, sensor type, FOV, position, orientation, etc.); master data transmission methods using shared memory and UDP protocols.

Experiment 2: RflySimSDK Interface Usage

📝 Experiment Overview: Learn standard interface invocation methods for Python and Simulink within the RflySim toolchain; become familiar with SDK documentation retrieval and secondary development practices.

Experiment 3: QGC Ground Station Secondary Development Environment Setup

📝 Experiment Overview: Configure the QGroundControl development environment (Visual Studio + Qt); master source code cloning, compilation, and customization (e.g., name and logo modifications); and implement the full secondary development deployment workflow for the QGC ground station.

Experiment 4: Mission Planner Ground Station Secondary Development Environment Setup

📝 Experiment Overview: This experiment introduces the setup of the Mission Planner ground station secondary development environment, including steps such as source code cloning, installation of Visual Studio 2022, source code compilation, and custom logo modifications, enabling users to quickly establish a Mission Planner secondary development environment.

2.5.4 Advanced-Level Development Experiments

No experiment cases available at this time.