pos_ned_full Module Documentation¶
Toolbox: RflySim Swarm

Introduction¶
One-sentence description: This module is an NED coordinate system position control command encoding module, built upon the Offboard__full module within the RflySim Swarm interface library.
This module is a specialized encoding module in the RflySim UAV swarm development toolchain, enabling developers to directly input position control commands in the NED coordinate system. It provides a convenient encapsulation for position control scenarios involving multiple UAVs in a swarm. The standardized Offboard control commands generated by this module can be sent to the PX4 flight controller via the配套 communication interface, while also interfacing with the CopterSim simulation engine and RflySim3D visualization environment. This allows for direct validation and testing of swarm position control algorithms within the full RflySim simulation chain. Typical use cases include multi-UAV swarm formation keeping, collective route tracking, and other position-control-based swarm missions.
Port Descriptions¶
Input Ports (Inputs)¶
| Port Name | Data Type | Dimension | Description |
|---|---|---|---|
NED Position Setpoint |
double |
1×3 |
Target position command in the NED coordinate system, in order: North direction position, East direction position, Down direction position |
Yaw Setpoint |
double |
1×1 |
Target yaw angle command, unit: rad |
Output Ports (Outputs)¶
| Port Name | Data Type | Dimension | Description |
|---|---|---|---|
Encoded Offboard Command |
double |
1×N |
Encoded full offline control command, directly connectable to the command input port of the Offboard__full module [to be confirmed] |
Parameter Configuration (Parameters)¶
The following parameters can be configured in the Mask dialog box opened by double-clicking the module:
| Parameter Name | Type | Default Value | Optional Values/Range | Description |
|---|---|---|---|---|
CopterID |
int |
1 |
1~255 |
ID of the target UAV, used to specify the control target in swarm scenarios |
Parameter Setting Description¶
CopterID¶
This parameter specifies the UAV number corresponding to the current position control command. In multi-UAV swarm simulations, each UAV’s command encoding module must be configured with a unique and matching CopterID to ensure commands are correctly sent to the corresponding UAV.
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 is a swarm Offboard command encoding module. The encoded command data it outputs is transmitted to the RflySim simulation side via the UDP protocol, adhering to the RflySwarm swarm communication protocol format, and uses the default swarm control communication port.
Related Modules¶
| Module Name | Description |
|---|---|
Offboard__full |
RflySim Swarm foundational Offboard control encapsulation module |
vel_ned_full |
NED coordinate system swarm velocity control command encoding module |
att_sp_full |
Attitude setpoint swarm encoding module |
thrust_sp_full |
Thrust setpoint swarm encoding module |
RflyUdpSendSwarm |
Swarm control command UDP transmission module |
Notes and Common Issues¶
- Coordinate System Consistency: The control commands output by this module are based on the NED coordinate system. When inputting position commands, ensure the input coordinates are consistent with the NED coordinate system definition; do not directly input ENU coordinate system coordinates, as this will cause incorrect position control direction (e.g., reversed axes).
- Dependency on Offboard__full Module: This module is a derivative encapsulation of the Offboard__full module. Before use, ensure the communication parameters of the Offboard__full module (e.g., UAV ID, UDP communication port) are correctly configured in the model; otherwise, the module will fail to send position commands properly.
- Initialization Sequence: This module must output position commands only after the RflySim Swarm environment and the Offboard__full communication module have completed initialization. Do not output non-zero desired positions at the very beginning of simulation, as this may cause UAV loss of control and trigger lockout protection.
- Sample Time Matching: The sample time of this module must match that of the Offboard__full communication module in the model. It is not recommended to use sample rates differing by more than a factor of 10, as this may lead to command packet loss or control lag.
- Swarm Networking Usage Limitations: When using multiple
pos_ned_fullmodules in multi-UAV swarm simulations, each UAV must be assigned a unique UAV ID to prevent command conflicts and abnormal position control.
Changelog¶
v4.1.0(2023-06-15): Initial release, added thepos_ned_fullencapsulation module supporting position control command input in the NED coordinate system.