Full_data_decoder Module Documentation¶
Toolbox: RflySim Swarm

Introduction¶
One-sentence Description: Decodes multi-vehicle swarm data transmitted in full-data mode via RflyUdpFast and outputs various state information of multiple UAVs via a bus interface.
This module serves as the data decoding component within the RflySim Swarm cluster simulation toolchain, specifically designed to work in conjunction with the RflyUdpFast module. It receives and parses cluster UAV data transmitted in full-data mode. The module outputs each UAV’s global position, attitude Euler angles, local position and velocity, full GPS information (including position, velocity, home point, altitude, and accuracy metrics), flight controller power-on time, UAV ID, and other auxiliary flight data. The decoded data is output in Simulink bus format, and MATLAB automatically prompts the available data fields contained in the bus, facilitating direct extraction and use by users.
This module is typically applied in RflySim multi-UAV cluster cooperative simulation scenarios. It interfaces with the full-state UAV data output from the CopterSim cluster simulation engine, providing a unified state data interface for cluster task algorithm development in Simulink. Users can develop cluster cooperative control, mission planning, and other algorithms based on the decoded UAV states, and simulation results can be synchronized to RflySim3D for visualized cluster flight display.
Port Descriptions¶
Input Ports (Inputs)¶
| Port Name | Data Type | Dimension | Description |
|---|---|---|---|
UdpRxData |
uint8 |
N×1 |
Raw received data output by RflyUdpFast in full-data mode; N is the data frame length [to be confirmed] |
Output Ports (Outputs)¶
| Port Name | Data Type | Dimension | Description |
|---|---|---|---|
VehicleBus |
Bus |
1 | Simulink bus integrating all UAV state data. The bus includes global position, attitude Euler angles, local position and velocity, GPS information (position, velocity, home point, altitude, accuracy metrics), flight controller power-on time, aircraft ID, and other auxiliary information |
Parameter Configuration¶
The Mask dialog box, opened by double-clicking the module, allows configuration of the following parameters:
No configurable parameters for this module.
Parameter Setting Instructions¶
None.
Module Characteristics (Block Characteristics)¶
| Characteristic | Value |
|---|---|
| Supported Data Types | double, single |
| Direct Feedthrough | Yes |
| Sample Time | Inherited |
| Code Generation Support | No |
Data Communication Protocol¶
This module only decodes data output by RflyUdpFast in full-data mode and does not handle network communication directly; it has no independent network communication protocol.
Related Modules¶
| Module Name | Description |
|---|---|
RflyUdpFast |
High-speed UDP communication module for RflySim cluster simulation, supporting full-data mode output and directly compatible with this module |
UAV_Bus_Creator |
Generates UAV state bus; can be used in conjunction with decoded bus data |
Notes and Frequently Asked Questions¶
- Initialization Sequence: This module must be used together with the
RflyUdpFastmodule. Prior to simulation startup, ensure theRflyUdpFastmodule has been correctly initialized and port-configured; otherwise, the output may be all zeros or data decoding may fail. - Mode Matching Requirement: This module only supports decoding data packets output by
RflyUdpFastin full-data mode. IfRflyUdpFastis configured to another transmission mode, connecting this module directly will result in decoding errors and abnormal output data. - Bus Usage Tip: The module outputs data in Simulink bus format. When extracting fields from the bus, use the Simulink Bus Selector module. After connection, MATLAB automatically enumerates all available data fields within the bus, eliminating the need to manually define the bus structure.
- Cluster Data Correspondence: In multi-UAV cluster simulations, a single instance of this module decodes full-state data for only one UAV. For cluster scenarios, configure a separate
Full_data_decoderinstance for each UAV, matched with the corresponding aircraft ID’sRflyUdpFastinput, to avoid cross-contamination of data from different UAVs. - Sample Time Matching: Configure the sample time of this module to match that of the upstream
RflyUdpFastmodule to prevent issues such as data packet loss, decoding misalignment, or delayed state updates due to sample rate mismatch. - Data Compatibility: The coordinate and attitude definitions in the data output by this module conform to the standard definitions used by the RflySim platform flight controller. If interfacing with a custom coordinate system model, perform coordinate transformation in advance to avoid logical errors due to coordinate system mismatch.
Changelog¶
v4.0.0(2023-06-15): Initial release. Supports decoding ofRflyUdpFastfull-data mode data and outputs various UAV state information, including position, attitude, velocity, GPS, aircraft ID, etc.