Main Content

Animate Multiple UAVs Using Dynamic Mesh

R2026b

This example shows how to animate multiple UAVs using the UAV Animation Block, and how to conditionalize the meshes in the simulation.

Model Overview

Open the multipleUAVAnimationModel.slx Simulink® model.

open_system("multipleUAVAnimationModel.slx")

This Simulink model simulates two fixed-wing UAVs flying in straight flight paths that are perpendicular to one another. Each UAV flies at a constant altitude, one at 50 meters and the other at 60 meters.

Simulink model that simulates two fixed-wing UAVs with dynamic mesh color changes based on separation distance

This section of the Simulink model conditionalized the UAV mesh configuration input of the UAV Animation block based on the separation distance of the two UAVs.

Close-up of the Separation Calculator and UAV Mesh Switch subsystem that selects green or red mesh based on a 20-meter distance threshold

The Separation Calculator block outputs the separation distance of the UAVs. The UAV Mesh Switch block uses this separation distance to choose whether to input Green UAV mesh or Red UAV mesh configuration to the UAV Mesh Configuration input port of the UAV Animation Block.

The threshold value of the UAV Mesh Switch block specifies the separation distance at which the UAV mesh changes color. In this example, the threshold value is 20 meters.

Simulate Model

Run the Simulink model. Observe that the UAVs begin the simulation more than 20 meters apart, with green meshes. As they close within 20 meters of one another, their meshes become red, then become green when they return to more than 20 meters of separation.

UAV animation showing two green UAVs flying on perpendicular paths with more than 20 meters of separation

UAV animation showing two red UAVs after closing within 20 meters of each other

UAV animation showing two UAVs returning to green meshes after separating beyond 20 meters

See Also

|

Topics