Introduction to the Core Components of the RflySim Toolchain

The RflySim Toolchain includes a wide range of software for unmanned system modeling, simulation, and algorithm verification. The core components include CopterSim, QGroundControl, RflySim3D/RflySimUE5, Python38Env, Win10WSL subsystem, SITL/HITL one-click batch scripts, MATLAB automatic code generation toolbox, Simulink swarm control interface, PX4 Firmware source code, RflySim supplementary resources, and the supporting hardware system. By learning these core components, users can quickly get started with unmanned system development and testing.

WINWORD_gLWaeCDvTk

1. CopterSim

CopterSim is one of the core applications of the RflySim Toolchain. It is a hardware-in-the-loop (HIL) simulation software designed for the Pixhawk/PX4 autopilot platform. Users can configure multirotor models within the software and connect to a Pixhawk autopilot via USB serial to perform HIL simulation, effectively replicating outdoor flight tests indoors. CopterSim consists of two major components — model and communication. The model component allows direct simulation based on user-configured parameters and supports running dynamic models (DLLs) to form SIL/HIL simulation systems together with other software. CopterSim serves as the central hub for all data communication: the autopilot connects to CopterSim via serial port (HIL) or TCP/UDP network (SIL), using MAVLink for data exchange to achieve closed-loop control and simulate outdoor flight scenarios. CopterSim sends aircraft pose and motor data to the 3D engine for visualization, forwards MAVLink messages to Python-based vision programs or the QGC ground station for real-time status monitoring and high-level planning control, and more. Additionally, CopterSim compresses MAVLink data and sends it to the swarm control software in UDP struct format for communication streamlining (required for large-scale swarm operations).

image-20230923181042669

2. RflySim3D/RflySimUE5

Unreal Engine features a powerful graphics engine supporting high-quality 3D graphics and visual effects, a built-in Blueprint visual scripting system that enables developers to create complex logic and interactions graphically without writing code, and a vast community with an extensive resource library of models, textures, sound effects, and plugins to accelerate development and improve quality. It supports multiple platforms including PC, consoles, mobile devices, and VR headsets. Developers can customize and extend the engine's features and tools to suit various types of applications.

RflySim3D/RflySimUE5 is a high-fidelity unmanned system simulation application built on Unreal Engine. It inherits all the advantages of UE and communicates with other toolchain components via UDP to achieve highly realistic unmanned system simulation. Visual image data can be transmitted to QGroundControl, MATLAB, Python, and other software through screen capture or shared memory for vision algorithm verification and simulation.

image-20230923181123625

For users with lower computer specifications, the RflySim Toolchain provides two alternative 3D simulation applications: FlightGear and 3DDisplay. FlightGear is developed by a worldwide team of programmers, pilots, physicists, and aircraft manufacturers, and offers a variety of aircraft models and scenarios including civil and military aircraft with diverse environmental simulations. As a popular open-source flight simulator, it can receive flight state data from Simulink via UDP for convenient observation of aircraft behavior during simulation. 3DDisplay is a virtual flight simulator developed by the Reliable Flight Control Research Group at Beihang University, offering 3D models, virtual environments, and support for multiple aircraft types and scenarios. Users can freely switch among RflySim3D/RflySimUE5, FlightGear, and 3DDisplay based on their computer configuration.

3. QGroundControl — Ground Station

The UAV ground station is a key component of the UAV control system. Operators can control the UAV through mouse, touchscreen, or remote controller connected to the ground station. By setting waypoint information and planning routes on the ground station, the UAV can fly along preset paths and execute waypoint tasks during flight, including photography, aircraft maneuvers, and video recording.

The mainstream open-source ground stations currently available are QGroundControl and MissionPlanner. QGroundControl is an open-source ground station designed specifically for the latest PX4 software architecture. Its core code is written in C++ using the Qt framework, and it supports source code modification and secondary development, making it suitable for both ground station research and customized deployment. The key advantages of QGroundControl include:

1) Open source: QGroundControl is fully open-source software, meaning users can freely modify and customize it as needed. 2) Ease of use: The user interface is clean, modern, and intuitive, allowing users to quickly plan missions and flight paths. 3) Multi-platform support: QGroundControl runs on multiple operating systems, including Windows, Linux, and macOS. 4) Modular architecture: QGroundControl's modular architecture allows developers to easily add and extend new features without affecting existing functionality or performance.

Overall, QGroundControl is a modern, user-friendly, open-source, and highly customizable ground station software with clear advantages in multi-platform support, multi-language support, and modular architecture.

4. Python38Env

Python is a high-level, object-oriented, interpreted programming language. Originally created by Guido van Rossum in 1989, it has become a popular language for web application development, data analysis, artificial intelligence, scientific computing, network programming, and more. Python's simplicity and readability make it widely used in education and entry-level programming.

Python38Env is a virtual environment based on Python 3.12.10, pre-installed with libraries such as NumPy, pymavlink, OpenCV, and pyulog. It enables rapid algorithm development for unmanned systems without requiring users to set up a Python runtime environment or install individual libraries.

5. MATLAB Automatic Code Generation Toolbox

The MATLAB automatic code generation toolbox is an extension that generates C code, executables, static libraries, and dynamic libraries from Simulink models. These executables can run directly on embedded platforms without manual coding or debugging. It supports a variety of embedded platforms, including ARM Cortex-M and A-series processors, NXP MPC55xx and MPC56xx series, Pixhawk series, and more.

The module library includes GPS data modules, battery data modules, uORB modules, among others. Building on the RflySim and Pixhawk Support Package platform, users can: (1) design and simulate control algorithms in Simulink; (2) automatically generate C code and PX4 firmware from Simulink models and flash them directly to the Pixhawk board; (3) configure and calibrate the Pixhawk board and its peripherals using MATLAB scripts and functions; (4) read and write data in real time with the Pixhawk board, and more.

6. SITL/HITL Batch Scripts

Batch processing is a technique where computers automatically execute a collection of grouped tasks without human intervention, also known as Workload Automation (WLA) or job scheduling. It offers advantages in speed, cost savings, accuracy, and operational simplicity.

The RflySim Toolchain includes numerous batch scripts built on batch processing technology, enabling users to quickly launch and deploy multi-vehicle, multi-type combined simulations with a single click, significantly improving development and simulation efficiency. Commonly used batch scripts include: (1) SITLRun.bat — opens multi-vehicle software-in-the-loop simulation by launching and configuring selected RflySim components and options via script; (2) HITLRun.bat — opens multi-vehicle hardware-in-the-loop simulation. After connecting multiple autopilots, double-click the batch file and enter the Pixhawk serial port numbers for vehicles participating in the simulation (aircraft IDs are assigned in the order of serial port input). Additionally, the RflySim Toolchain provides many other batch scripts such as SITLRunPos.bat, SITLRunLowGPU.bat, SITLRunMAVLink.bat, HITLRunPos.bat, HITLPosSysID.bat, HITLPosStr.bat, and more. Users can open these files in a text editor and modify parameters to suit their needs for custom development and rapid simulation or algorithm verification.

7. PX4 Firmware Source Code

PX4 evolved from PIXHAWK, a software and hardware project at the Computer Vision and Geometry Lab of ETH Zurich (Swiss Federal Institute of Technology). This fully open-source flight control system provides a low-cost, high-performance autopilot for flight control enthusiasts and research teams worldwide. After years of development and refinement by world-class developers from both industry and academia, the PX4 flight control system has formed a mature and well-structured software architecture. Together with the Pixhawk series autopilot hardware, it constitutes the Pixhawk/PX4 autopilot platform, capable of controlling multirotors, fixed-wing aircraft, airships, and more. It is currently the most widely-used open-source UAV autopilot platform worldwide.

The RflySim Toolchain supports one-click deployment of the PX4 compilation environment, with the ability to select different PX4 firmware build commands and firmware versions. The toolchain deploys the selected PX4 Firmware source code to the specified installation path. If a previous firmware folder exists, it is deleted and a fresh deployment is performed, greatly improving PX4 environment setup efficiency.

8. WinWSL Subsystem

The WinWSL (Windows Subsystem for Linux) allows users to run Linux applications within the Windows operating system, use the Linux command-line interface (CLI), and install Linux distributions. The RflySim Toolchain installs Ubuntu 18.04.5 via one-click setup, primarily used for compiling PX4 source code.

The toolchain also provides two alternative compilation environments that simulate Linux compilation under Windows: the Msys2Toolchain based on MSYS2 and the CygwinToolchain based on Cygwin. Users can select different compilation environments based on their PX4 version, and switch between them through the one-click deployment interface.

The RflySim Toolchain provides a swarm control interface built on Simulink S-functions. This interface is implemented through C++ mixed programming via Simulink S-functions and, combined with Simulink's built-in UDP modules, offers advantages including high efficiency, low computational overhead, low latency, high reliability, and strong extensibility. Users can load this module into their own control systems via simple copy-and-paste to quickly enable swarm control development for unmanned systems.

image-20230923181357799

10. RflySim Supplementary Resources

The RflySim Toolchain provides comprehensive learning materials and example files. Through PPT courseware and RflySimAPIs example files, users can progressively learn and develop — from low-level control algorithms to mid-level decision algorithms to high-level learning algorithms — building and developing their own unmanned systems in an all-in-one workflow.

11. Supporting Hardware System

The RflySim Toolchain provides a complete set of supporting hardware, including quadrotor UAVs, autopilots, remote controllers, and other components. These components are fully compatible with the toolchain, enabling software and hardware-in-the-loop simulation experiments within the RflySim platform and real-world UAV flight based on auto-generated firmware.

Currently supported aircraft include the FeiSi J150, FeiSi J310, and other quadrotor UAVs. The FeiSi J150 is a micro quadrotor newly designed for indoor swarm control research. Since the RflySim Toolchain is built on the PX4 software system, any autopilot supporting PX4 can generally be used with the toolchain. Long-term supported autopilots include Pixhawk 2.4.8 (a.k.a. Pixhawk 1), Pixhawk 6C, and Pixhawk 6X. The recommended remote controller mode is "Mode 2" (American hand), where the left stick controls throttle and yaw, and the right stick controls roll and pitch. The roll, pitch, throttle, and yaw channels correspond to receiver channels CH1–CH4, while the upper-side switches correspond to CH5/CH6 for flight mode switching. Supported remote controller models include RadioLink AT9S Pro, WFLY ET10, FlySky i6S, Futaba T14SG, and more.

results matching ""

    No results matching ""