Skip to content

Chapter 6: External Control and Trajectory Planning

After completing the development of the low-level filtering and control system, the unmanned system needs to receive commands from the upper-level decision-making layer to achieve higher-level motion control. External control and trajectory planning serve as the critical bridge connecting low-level control with upper-level intelligent decision-making. This chapter introduces the design and usage of external control interfaces, as well as the development and validation of trajectory planning algorithms.


6.1 Background and Theory

As an autonomous flying vehicle, the external control capability of an unmanned aerial vehicle (UAV) is essential for achieving precise flight missions and safe flight operations. Common control methods include: remote controller control, ground station control, semi-autonomous control, and computer interface-based control. Among these, external control theory primarily concerns flight stability in the air, generally understood as position and attitude control of the UAV.

alt text

6.1.1 External Control Modes

External control (Offboard Control) refers to a mode where control commands are sent to the flight controller from a ground station or onboard computer. In this mode, the flight controller acts as an actuator, receiving position, velocity, or attitude commands generated by external systems and converting them into low-level motor control signals. The MAVLink protocol is the mainstream communication protocol for external control, supporting multiple control modes and message types. Common external control modes supported by remote controllers include:

  • Position Mode: Send target positions to the flight controller; the UAV autonomously plans a path to reach the target point.
  • Velocity Mode: Send velocity commands to control the UAV’s movement at a specified speed.
  • Attitude Mode: Send desired attitude angles to control the UAV to achieve a specified orientation.

6.1.2 Fundamentals of Trajectory Planning

Trajectory planning is a critical issue at the decision-making level for multi-rotor UAVs, referring to the process of finding an optimal flight trajectory from a starting point to a target point under specific constraints, while satisfying the UAV’s maneuverability and environmental limitations. It is a key technology for multi-rotor mission planning systems and a technical guarantee for autonomous flight.

alt text

The main functions of trajectory planning include: during pre-flight, assisting mission planners in selecting an optimal path for the multi-rotor UAV to execute its mission; and during flight, enabling online path replanning to some extent based on real-time situational data. The planned path serves as a reference trajectory for UAV flight, guiding the multi-rotor to complete its mission under the action of the control law.

alt text


6.2 Framework and Interfaces

The RflySim toolchain provides rich external control and trajectory planning interfaces, supporting multiple development environments such as Python and MATLAB/Simulink.

alt text

RflySim supports external control via the MAVLink protocol. MAVLink (Micro Air Vehicle Link) is a lightweight UAV communication protocol that has become an industry standard. Through MAVLink, developers can send various types of control commands—including position, velocity, and attitude—to the flight controller, enabling precise UAV control. alt text The toolchain provides a Python-based MAVLink control interface (RflySimSDK) and a Simulink block library. Users can select the appropriate development tools based on project requirements. Using these interfaces, users can:

  • Implement automatic takeoff and landing commands
  • Send waypoint mission queues
  • Dynamically adjust flight speed and altitude in real time
  • Retrieve real-time UAV status information

alt text

6.2.2 Trajectory Planning Algorithm Interface

For trajectory planning, RflySim provides interfaces to integrate mainstream planning algorithms. Users can implement various planning algorithms in Python or MATLAB environments, including:

  • Global Path Planning: Optimal path search based on environmental maps
  • Local Obstacle Avoidance Planning: Real-time obstacle avoidance based on sensor data
  • Time-Optimal Trajectory Generation: Shortest-time trajectory considering dynamic constraints
  • Smooth Trajectory Optimization: Smooth trajectory generation based on differential flatness

alt text

6.2.3 External Control Development Workflow

A complete external control program includes core steps: communication connection, mode setting and arming, publishing desired commands, state monitoring, and ending with return-to-home.

alt text

As illustrated in the flowchart above, when conducting physical hardware-in-the-loop (HITL) or software-in-the-loop (SITL) simulations, the program first establishes a stable communication connection with the flight controller. After confirming successful connection (e.g., by receiving heartbeat packets), it begins continuously sending desired target values—such as position, velocity, angular velocity, or attitude—to the flight controller at a certain frequency (recommended ≥10 Hz). It is crucial to note that only after ensuring stable transmission of target commands can the program, through loop-based judgment, request and successfully switch the flight controller to Offboard control mode. Once the mode switch succeeds, the program issues an arm command to activate the motors and initiate closed-loop control tasks with state monitoring. Finally, after mission completion, it issues landing, return-to-home, and disarm commands to safely recover the vehicle.


6.3 Showcase of Representative Cases

Air-Ground Cooperative External Trajectory Planning and Control:

Multi-rotor Virtual Pipe Flight:


Public Lecture Replay for This Chapter (Session 5: External Control and Trajectory Planning):

6.5 Chapter Experiment Cases

The verification experiments and guided case studies related to this chapter are located in the [Installation Directory]\RflySimAPIs\6.RflySimExtCtrl folder.

6.5.1 Interface Learning Experiments

These are stored in the 6.RflySimExtCtrl\0.ApiExps folder, covering foundational platform interface tutorials and general introductions to various tools.

Experiment 1: External Control Development Serial Communication Experiment

📝 Experiment Overview: Taking the USB-TTL module wired connection between the flight controller and computer as an example, this experiment introduces serial communication methods, including serial port configuration and baud rate settings, to achieve hardware-in-the-loop external control.

Experiment 2: PX4MavCtrl External Control Validation

📝 Experiment Overview: This experiment helps users become familiar with offboard-mode control of UAVs, state data acquisition, and RflySim3D control interfaces, while understanding the SITL communication framework. It uses the Python external control library to implement UAV takeoff/landing and generate dynamic targets in the 3D scene, along with camera view control.

Experiment 3: Hardware-in-the-Loop Simulation with Pixhawk Flight Controller via Serial Communication

📝 Experiment Overview: This experiment teaches how to connect a real Pixhawk 6C flight controller via MicroUSB and TTL serial cables, and configure and control hardware-in-the-loop simulations using the MAVLink serial communication protocol.

Experiment 4: GPS Position Control – SendPosGlobal Validation

📝 Experiment Overview: This experiment uses the SendPosGlobal function interface of the RflySim platform to achieve GPS-based global position control of UAVs, learning how to send and execute Mavlink position control commands in offboard mode.

Experiment 5: SendRCPwms – Motor PWM Control

📝 Experiment Overview: This experiment uses the SendRCPwms function interface of the RflySim platform to control UAV motor PWM values, enabling motor speed regulation and flight control, and mastering methods for disarming the flight controller and sending commands in RCOverride mode.

Experiment 6: Multi-UAV PX4MavCtrl SITL Control
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: Learn to use the PX4MavCtrl interface to simultaneously control four drones in Offboard mode for position and velocity control in SITL (Software-In-The-Loop) simulation.

Experiment 7: PX4 Acceleration Control Interface Validation

📝 Experiment Overview: Send acceleration commands to drones via the SendAccPX4 interface, and learn MAVLink monitoring, ground truth observation, Offboard mode switching, and the process of position and acceleration control.

Experiment 8: SendAttPX4 Attitude-Throttle Control Validation

📝 Experiment Overview: Send desired attitude and throttle data to the aircraft via the SendAttPX4 interface of the RflySim platform to validate attitude and throttle control functionality.

Experiment 9: Coordinate System Transformation between UE Map and Drone

📝 Experiment Overview: Familiarize with coordinate system transformation between the drone control origin and the UE map origin. Use the setGPSOriLLA and lla2ned APIs to unify coordinate systems for multi-drone control, enabling four drones to fly to the same location.

Experiment 10: Vision-Based Drone Collision with Ball Experiment

📝 Experiment Overview: Capture RflySim 3D images using VisionCaptureApi, identify the ball’s centroid via OpenCV, compute control commands, and autonomously guide the drone to collide with a red ball. Learn vision-based navigation and flight controller command issuance.

Experiment 11: UDP_Full Communication Control Experiment

📝 Experiment Overview: Send control commands to CopterSim via UDP_Full communication mode to control drone takeoff, flight, and landing. Learn Offboard mode switching and position/velocity command transmission, suitable for small-to-medium scale swarm simulations.

Experiment 12: UDP_Simple Communication Control Experiment

📝 Experiment Overview: Send control commands to drones via UDP_Simple communication mode. Learn PX4 flight controller Offboard mode switching and position/velocity control, achieving takeoff, forward flight, and landing.

Experiment 13: MAVLink_Full Mode Drone Control

📝 Experiment Overview: Use the MAVLink_Full default communication mode and Python interface functions to send control commands to drones, achieving takeoff, forward flight, and landing in Offboard mode.

Experiment 14: MAVLink_Simple Communication Control Experiment

📝 Experiment Overview: Control drones via MAVLink_Simple communication, achieving Offboard mode switching, position/velocity command transmission, and flight control. Suitable for small-scale swarm simulations with fewer than 8 drones.

Experiment 15: MAVLink_NoSend Mode Flight Controller Control

📝 Experiment Overview: Send commands to CopterSim via MAVLink_NoSend mode to control drones in Offboard mode, enabling Hardware-In-The-Loop (HITL) simulation.

Experiment 16: Object-Drone-Camera Information Acquisition Interface Validation
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview:
    Acquire information about aircraft, objects, and cameras via Python interfaces; learn how to use visual interfaces and UE (Unreal Engine) control.

Experiment 17: Validation of the Timestamp Retrieval Interface getTimeStmp

📝 Experiment Overview:
Call the getTimeStmp function via Python interface to retrieve timestamp data for a specified aircraft; learn about information contained in the RflyTimeStmp structure, including aircraft ID, simulation start timestamp, current timestamp, and heartbeat counter.

Experiment 18: MAVSDK Flight Controller Algorithm Design Experiment

📝 Experiment Overview:
Design custom MAVLink control algorithms using the MAVSDK library; adapt official examples to the RflySim platform to perform SITL/HITL simulations including drone takeoff, landing, and offboard waypoint navigation.

Experiment 19: Mavros Control of SIL (Software-in-the-Loop) Drone

📝 Experiment Overview:
Control a Windows-based software-in-the-loop (SIL) drone from Ubuntu using Mavros; achieve offboard mode arming and pose control; learn MAVLink communication and ROS-based drone control.

Experiment 20: MAVSDK Official Examples Adaptation Experiment

📝 Experiment Overview:
A comprehensive experiment adapting MAVSDK official examples to the RflySim platform, covering parameter retrieval, calibration, camera control, waypoint missions, external control, telemetry monitoring, RTK positioning, and more; supports both SITL and HITL simulations.

Experiment 21: C++ ROS Forwarding Node for Integrated Model Communication

📝 Experiment Overview:
Use a C++ ROS forwarding node (udp_ros_bridge) to convert RflySim integrated model UDP data into ROS topics, replacing basic Mavros functionality; enable rapid migration of PX4 software/hardware-in-the-loop algorithms to the RflySim integrated model; demonstrate multi-drone state subscription and control in ROS 1/ROS 2 environments.

Experiment 22: Cloud API Invocation of Large Language Models

📝 Experiment Overview:
Learn to invoke cloud APIs of large language models (e.g., DeepSeek) via Python; master environment variable configuration and usage of OpenAI-compatible SDKs.

Experiment 23: PX4 + ROS2 uXRCE-DDS Ethernet Communication Control

📝 Experiment Overview:
Learn to integrate PX4 flight controller with ROS2 via the uXRCE-DDS protocol; master Ethernet configuration and offboard drone control.

Experiment 24: ROS Environment Single-UAV Flight Control

📝 Experiment Overview:
This experiment demonstrates hardware-in-the-loop single-UAV flight control using the PX4MavCtrlV4ROS library in ROS1 and ROS2 environments, observing information exchange effects within the ROS environment.

Experiment 25: MAVSDK Takeoff and Landing Experiment
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: Adapted from the official MAVSDK examples for the RflySim platform, this experiment enables automatic drone takeoff and landing, helping learners master MAVSDK communication protocols and drone control commands.

Experiment 26: Drone Control Code Generation via Large Language Models

📝 Experiment Overview: This experiment explores leveraging large language models (e.g., DeepSeek) to assist in developing drone control programs. By combining natural language descriptions with template code, it generates drone control logic to achieve functions such as takeoff, hovering, and trajectory tracking, while verifying the accuracy of LLM-based code generation in drone control applications.

Experiment 27: MAVSDK Offboard Waypoint Flight Experiment

📝 Experiment Overview: Based on MAVSDK, this experiment implements waypoint flight in Offboard mode using the world coordinate system (North-East-Down). Learners will practice fundamental MAVSDK operations and drone control commands.

Experiment 28: Python-Based ROS Bridge Program

📝 Experiment Overview: Replaces mavros with a Python-based ROS bridge program to enable bidirectional communication between the RflySim comprehensive model and ROS topics. Supports multi-drone control under ROS 1/ROS 2, facilitating the migration of PX4 software/hardware-in-the-loop algorithms to the comprehensive model.

Experiment 29: ROS Multi-Drone Flight Control

📝 Experiment Overview: Conducts multi-drone SITL simulation experiments in ROS 1 and ROS 2 environments using the PX4MavCtrlV4ROS library, teaching users how to configure and run multi-drone control algorithms.

Experiment 30: uXRCE-DDS Serial Communication and ROS2 Control Experiment

📝 Experiment Overview: Implements serial communication between the PX4 flight controller and ROS2 system based on uXRCE-DDS, covering sensor data subscription and Offboard control. Learners will gain hands-on experience in configuring serial communication and performing hardware-in-the-loop simulation debugging.

Experiment 31: Direct Drone Control via LLM

📝 Experiment Overview: Learns and implements natural language drone control based on large language models (e.g., DeepSeek), mastering methods to parse natural language instructions into standardized machine control commands, and experiencing the integration of AI with drone control.

Experiment 32: MAVSDK Offboard Waypoint Flight Experiment

📝 Experiment Overview: Adapted from official MAVSDK examples for the RflySim platform, this experiment enables drone flight in Offboard mode using CSV-formatted waypoint data, demonstrating the complete process of a heart-shaped trajectory flight after takeoff.

Experiment 33: Local LLM-Based Drone Control

📝 Experiment Overview: Deploys a lightweight local LLM (Ollama + qwen) to drive natural language drone control, while invoking a deep LLM (Volcengine Doubao) online for trajectory inference. Validates the correctness and stability of the entire pipeline, including command parsing, UDP control link, route planning, and visualization.

6.5.2 Basic Usage Experiments

Stored in the 6.RflySimExtCtrl\1.BasicExps folder, these experiments provide a complete set of supplementary teaching materials for beginners.

Experiment 1: Development of MAVLink External Control Interface

📝 Experiment Overview: A Simulink-based MAVLink protocol communication experiment focusing on the development of data transmission and reception modules for the MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS message, enabling external control communication between the flight controller and MATLAB.

Experiment 2: System Identification Experiment

📝 Experiment Overview: By comparing transfer function models with nonlinear quadcopter models, this experiment uses sweep-sine excitation signals to observe output differences, thereby enhancing understanding of system modeling and identification processes.

Experiment 3: Quadcopter System Identification Experiment

📝 Experiment Overview: Utilizing the CIFER software, this experiment performs system identification on a quadcopter nonlinear model to obtain transfer function models for four channels (altitude, yaw, horizontal forward, and horizontal lateral). The identification must satisfy the cost function criterion \( J \leq 50 \), and an integrator is added to form a complete body model.

Experiment 4: Quadcopter System Identification Experiment

📝 Experiment Overview: This experiment conducts system identification on a quadcopter nonlinear model by adding an external controller. Using CIFER software, it identifies transfer functions for four channels (horizontal forward, horizontal lateral, altitude, and yaw), with the identification criterion being \( J \leq 50 \). Model differences between the design and analysis experiments are evaluated using Bode plots.

Experiment 5: System Identification Experiment (Real Flight)

📝 Experiment Overview: This experiment performs system identification on the position and yaw channels of a quadcopter using an external controller. CIFER software is used to obtain transfer functions for four channels, with the target cost function criterion \( J \leq 100 \).

Experiment 6: Quadcopter Position Control

📝 Experiment Overview: Implements position control for a quadcopter in Offboard mode using a Simulink model. The position control interface is validated, and flight performance is observed in RflySim 3D and QGroundControl (QGC).

Experiment 7: Kalman Filter Design Experiment

📝 Experiment Overview: In a quadcopter simulation model, this experiment studies the principles of Kalman filter algorithms. Velocity feedback signals are replaced by Kalman filter estimates, and filtering performance under different parameter settings is compared.

Experiment 8: Kalman Filter Parameter Tuning and Noise Analysis

📝 Experiment Overview: By adjusting the measurement noise and process noise covariance parameters of the Kalman filter, this experiment compares filtering performance under varying noise conditions and verifies the filter’s effectiveness in both transfer function and nonlinear models.

Experiment 9: Kalman Filter Design with Time Delay

📝 Experiment Overview: This experiment designs a Kalman filter that accounts for time delays, implements closed-loop control in Simulation 1.0 and 2.0, compares filtering performance, and conducts hardware-in-the-loop (HIL) simulation.

Experiment 10: Real-Flight Kalman Filter Experiment Based on Dimension Expansion Method

📝 Experiment Overview: This experiment designs a Kalman filter based on the dimension expansion method to estimate velocity feedback, addressing sensor signal delays encountered during real flights. The filtered velocity is then applied in closed-loop control, and control performance is compared.

Experiment 11: Verification Experiment of Drone Velocity Control Interface

📝 Experiment Overview: Verify the velocity control interface of the drone in Offboard mode using Simulink. Achieve position changes by dynamically adjusting velocity variables in real time, thereby mastering the upper位机 (host computer) velocity control methodology.

Experiment 12: e3.1

📝 Experiment Overview:

Experiment 13: Multirotor Trajectory Tracking Control Analysis Experiment

📝 Experiment Overview: Design a multirotor trajectory tracking controller based on frequency-domain methods, satisfying performance requirements: velocity loop phase margin > 65° and cutoff frequency > 3 rad/s; position loop phase margin > 60° and cutoff frequency > 2 rad/s. Compare simulation tracking performance between linear and nonlinear models.

Experiment 14: Multirotor Circular Trajectory Tracking Controller Design

📝 Experiment Overview: Design an additive-decomposition controller enabling stable circular trajectory tracking (center at (0,0), radius 1 m) with the drone’s yaw angle rotated, while ensuring the nose always points toward the circle center, horizontal deviation ≤ 20%, and conduct Sim2.0 and HIL simulation verification.

Experiment 15: Single-Drone Remote Controller Mode Control Experiment

📝 Experiment Overview: Replace the remote controller with a Simulink controller, simulating pitch, roll, throttle, and yaw channels via the VeX, VeY, VeZ, and Yaw variables respectively, to achieve drone flight control.

Experiment 16: Multirotor Path Following Control

📝 Experiment Overview: Design a path-following controller based on the multirotor transfer function model to achieve straight-line path following (from start point (5, -3) to end point (5, 10)), master path-following control theory, and complete simulation verification in both Sim1.0 and Sim2.0 environments.

Experiment 17: Path-Following Control Parameter Tuning Experiment

📝 Experiment Overview: Modify path-following controller parameters k1 and a0 to compare changes in straight-line path-following trajectories, analyze the influence of parameters on the multirotor’s speed of adhering to the desired trajectory, and summarize the impact of parameter tuning on path-following performance.

Experiment 18: Circular Trajectory Path-Following Controller Design

📝 Experiment Overview: Design a circular trajectory path-following algorithm with center at (0,0), radius 3 m, yaw angle fixed at 0°, and altitude fixed at 2 m. Includes three experimental approaches: Simulation 1.0, Simulation 2.0, and Hardware-in-the-Loop (HIL) simulation.

Experiment 19: Circular Trajectory Path-Following Control

📝 Experiment Overview: Design a circular trajectory path-following controller based on an identified transfer function model, and conduct both simulation and real-drone validation.

Experiment 20: Offboard API Verification Experiment

📝 Experiment Overview: Learn to control the drone using PX4’s Offboard API via Simulink, achieving velocity, position, and attitude control modes, and master the communication principles for external computers controlling the drone via serial port or network connection.

Experiment 21: Basic Obstacle Avoidance Control Experiment
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: Utilize the artificial potential field method to guide a multi-rotor drone to avoid obstacles and reach the target destination. Gain proficiency in constructing Simulink simulation platforms, controller design, and validating the effectiveness of obstacle avoidance algorithms under varying target positions.

Experiment 22: Basic Multi-Rotor Obstacle Avoidance Control

📝 Experiment Overview: Implement single multi-rotor obstacle avoidance control based on the artificial potential field method. Compare simulation results between the Sim1.0 linear model and Sim2.0 nonlinear model, and analyze the influence of parameters such as a0, k1, and k2 on obstacle avoidance trajectories.

Experiment 23: Multi-Robot Obstacle Avoidance Controller Design

📝 Experiment Overview: Design a cooperative obstacle avoidance algorithm for multiple robots, using the artificial potential field method to enable two multi-rotors to avoid both each other and static obstacles. Gain understanding of multi-rotor obstacle avoidance control principles, including simulations (Sim1.0, Sim2.0) and hardware-in-the-loop experiments.

Experiment 24: Multi-Rotor Obstacle Avoidance Controller Design

📝 Experiment Overview: Design a multi-robot obstacle avoidance controller for multi-rotors using the artificial potential field method, incorporating both Simulink simulations and real flights with Tello drones. Master the practical application of obstacle avoidance algorithms in actual flight scenarios.

Experiment 25: Turntable Quadrotor Attitude Control Experiment

📝 Experiment Overview: Build a multi-rotor flight controller using MATLAB/Simulink and send MAVLINK commands to control the attitude of a quadrotor mounted on a turntable. Master MAVLINK communication, quadrotor attitude control, and parameter tuning.

Experiment 26: External Position Control Design and Validation

📝 Experiment Overview: Learn the linearized third-channel transfer function simulation model of multi-rotors, design a point-position controller for position control, and validate control performance in both Simulink and RflySim3D.

Experiment 27: Kalman Filter Design Experiment

📝 Experiment Overview: In the multi-rotor simulation model, replace the velocity feedback signal in the controller with estimates from a Kalman filter, and verify the effectiveness of the Kalman filter in state estimation.

Experiment 28: Trajectory Tracking Controller Design

📝 Experiment Overview: Conduct experiments on multi-rotor trajectory tracking controller design, covering learning of the third-channel linearized transfer function model, step response analysis, frequency-domain controller design, and additive decomposition controller design for yaw angle tracking.

Experiment 29: Path Following Controller Design Experiment

📝 Experiment Overview: Study the theoretical principles of path following, and implement straight-line and circular trajectory following control for multi-rotors. The experiment comprises four stages: basic, analytical, design, and real-flight experiments.

Experiment 30: Obstacle Avoidance Controller Design Experiment

📝 Experiment Overview: Conduct obstacle avoidance control experiments for multi-rotors using the artificial potential field method, comprising four progressive stages: basic, analytical, design, and real-flight experiments. Master the design and implementation of obstacle avoidance algorithms for both single and cooperative multi-rotor systems.

Experiment 31: RflySim Extended API Usage
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: This experiment serves as a foundational introduction to the RflySim external control API. It primarily covers the installation and configuration of the Visual Studio 2017 compiler, as well as the setup of the RflySim toolchain paired with the Pixhawk 6X flight controller, laying the groundwork for subsequent external control API development.

Experiment 32: MAVLink Module Packaging Experiment

📝 Experiment Overview: Based on Simulink, this experiment uses the S-Function Builder to encapsulate MAVLink message transmission and reception modules, enabling data packaging and parsing of the MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS message.

Experiment 33: MAVLink Message Transmission and Reception Experiment

📝 Experiment Overview: Based on the MAVLink communication protocol, this experiment simulates the transmission and reception of the MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS message, achieving MAVLink data encoding and decoding functionality, and helping learners understand the communication principles between unmanned vehicles and ground stations.

6.5.3 Advanced Development Experiments

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

Experiment 1: MAVLink Protocol Control Experiment

📝 Experiment Overview: Using the MAVLink protocol, MATLAB controls drone disarming and flight attitude in hardware-in-the-loop (HIL) simulation. The experiment comprises two parts: HIL disarming and MAVLink attitude control, enabling learners to understand the application of the MAVLink communication protocol in drone control.

Experiment 2: MavlinkUdp Communication Module Single-Drone Control Experiment

📝 Experiment Overview: Receiving drone status information via the RflyUdpFast transmission module, this experiment uses Simulink to model single-drone local position motion control. It sends control commands for both software-in-the-loop (SIL) and hardware-in-the-loop (HIL) simulations, helping learners understand the MAVLink protocol and UDP communication mechanisms.

Experiment 3: RflySerialRaw Serial Communication Single-Drone Control Experiment

📝 Experiment Overview: Using the RflySerialRaw serial communication module, this experiment receives drone status information via Simulink and performs hardware-in-the-loop simulation of single-drone local position motion control (e.g., circular motion).

Experiment 4: IsaacSim Drone Following a Circular Platform Experiment

📝 Experiment Overview: Training a drone to follow a circular platform using IsaacSim. By acquiring RflySim 3D images through a visual interface, image processing is performed to compute control commands, enabling the drone to track the platform in real time. This experiment is suitable for teaching and debugging visual control and simulation validation.

Experiment 5: Straight-Line Trajectory Planning

📝 Experiment Overview: By commanding the drone to execute straight-line trajectory flight missions, this experiment introduces fundamental principles of drone trajectory planning, Python-based control methods, position control, and yaw angle control strategies in Offboard mode.

Experiment 6: MavSfun HIL Disarming Experiment
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: This experiment demonstrates the display of disarming information in CopterSim hardware-in-the-loop (HIL) simulation via MAVLink communication protocol encapsulation modules and UDP transmission, enabling learners to master the fundamental usage of the MAVLink protocol.

Experiment 7: RflySim Toolchain DDPG Position Control Reinforcement Learning Experiment

📝 Experiment Overview: Based on MATLAB/Simulink software-in-the-loop (SIL) workflow, this experiment employs the DDPG reinforcement learning algorithm to achieve position control of a quadrotor. Learners will grasp the control logic and evaluation methodology for generating X-axis acceleration commands via RL Agent, and study the Actor-Critic framework and DDPG algorithm principles.

Experiment 8: MavLink Control HIL Experiment

📝 Experiment Overview: Conducted in CopterSim software-in-the-loop (SIL) environment, this experiment realizes quadrotor attitude control via MAVLink encapsulation modules over UDP, enabling learners to master the application of the MAVLink communication protocol.

Experiment 9: Multi-Point Trajectory Planning and Velocity Control

📝 Experiment Overview: By commanding the quadrotor to execute multi-point trajectory flight missions, this experiment helps learners master multi-point trajectory planning principles, velocity control strategies, dynamic yaw angle control, and waypoint deceleration mechanisms, achieving smooth tracking of complex trajectories.

Experiment 10: Embodied Intelligence Reinforcement Learning Quadrotor Acceleration-Based Hover Control

📝 Experiment Overview: Based on the Genesis and RflySim software-in-the-loop (SIL) environment, this experiment guides learners through the end-to-end PPO reinforcement learning pipeline, understanding acceleration-level control and PID-level interface integration. Learners will build quadrotor simulation tasks, inject noise to enhance generalization, realize PX4 communication and SIL verification, and complete GPU-to-CPU sample equivalence tuning.

Experiment 11: Circular Trajectory Planning and Control

📝 Experiment Overview: By implementing real-time velocity control for circular trajectory flight, this experiment teaches learners key techniques including parametric representation of circular trajectories, the relationship between angular velocity and tangential velocity, real-time trajectory generation, and control frequency management.

Experiment 12: Spiral Trajectory Planning and Real-Time Velocity Control

📝 Experiment Overview: By commanding the quadrotor to execute spiral trajectory flight missions, this experiment helps learners master spiral trajectory planning principles, real-time velocity control methods, 3D trajectory tracking techniques, and the principle of multi-dimensional velocity component synthesis.

6.5.4 Advanced Development Experiments

Stored in the 6.RflySimExtCtrl\3.CustExps folder, these are custom development experiments designed for advanced users.

Experiment 1: Drone Natural Language Control Based on smolagents

📝 Experiment Overview: Leveraging the CodeAgent intelligent agent framework and large language models, this experiment enables users to describe tasks in natural language, with the system automatically generating Python control code to drive the drone in executing complex, multi-step tasks such as takeoff, navigation, and photography. It explores the paradigm of “language-as-task-code” for intelligent drone control.

Experiment 2: Large Model Instruction-Based Drone Control
  • 📦 Version Requirement: Full Version

    📝 Experiment Overview: Integrates large language models (LLMs) with PX4 flight control software-in-the-loop (SITL) simulation to achieve a closed-loop control workflow: Chinese command parsing, standardized control command generation, and UDP waypoint protocol transmission.

Experiment 3: Ros2CtrlDemoPX4 Integrated Control

📝 Experiment Overview: Learn direct communication between PX4 flight controller and ROS2 via uXRCE-DDS, and master configuration and methodology for offboard control in ROS2 within a software-in-the-loop simulation environment.

Experiment 4: Real-Flight Natural Language Control of UAVs Based on Large Models

📝 Experiment Overview: Validate the integration of the LLM-based natural language parsing module with the flight control system in real-flight scenarios, and learn how to convert Chinese spoken commands into standardized UAV control commands.

Experiment 5: LLM-Based Voice Control of UAVs in Simulation

📝 Experiment Overview: Explore the collaborative workflow of real-time speech recognition (ASR) and LLM-driven control, covering utilization of Volcengine ASR service, UDP/Mavlink communication protocols, PyAudio audio acquisition, LLM command parsing, and UAV control.

Experiment 6: Voice-Controlled UAV Flight Experiment

📝 Experiment Overview: Convert natural language instructions into UAV control commands using speech recognition and OpenAI large models, and verify the feasibility of closed-loop voice-controlled UAV flight in an indoor motion-capture environment.

Experiment 7: LLM-Based Multi-UAV Obstacle Avoidance Test

📝 Experiment Overview: Validate obstacle avoidance planning for multiple indoor rotary-wing UAVs based on LLM-driven natural language or voice commands, covering LLM-based obstacle avoidance path planning, semantic-level task description, spatial constraint integration, and multi-UAV coordination mechanisms.