Read UAV Trajectory
Libraries:
UAV Toolbox /
Utilities
Description
The Read UAV Trajectory block generates translation and rotation samples
from a UAV trajectory that you create using a multirotorFlightTrajectory
, fixedwingFlightTrajectory
, polynomialTrajectory
,
or waypointTrajectory
object.
Use the output of this block for the Translation and Rotation input ports of the Simulation 3D UAV Vehicle block to simulate a UAV trajectory in a 3D simulation environment.
Examples
Simulate UAV Scenario Trajectory in Unreal Engine Environment
Design a flight trajectory in a UAV scenario, and simulate the trajectory in a 3D environment using Unreal Engine®.
Design Real-World Trajectory in UAV Scenario and Visualize with Cesium
Design real-world trajectory in UAV Scenario and visualize trajectory in 3D environment using Cesium
Simulate Flight Plan in Real-World Location Using Cesium
Simulate a flight plan created with QGroundControl in 3D environment using Cesium
Ports
Input
Time — Time point to sample along trajectory
scalar
Time point to sample along the trajectory, specified as a scalar.
To align your translation and rotation samples with your simulation, use the Clock (Simulink) block as the input for this port
Data Types: double
Output
Translation — Position of UAV
vector
Position of the UAV, returned as a vector of the form [X Y Z]
,
where X
, Y
, and Z
are
positions in the x-, y-, and
z-axes, respectively. Units are in meters.
If you enable the Convert to ENU reference frame and Front-Left-Up body frame parameter, this block outputs position in the ENU reference frame. Otherwise, the block returns position in the same frame as the trajectory source.
Example: [1 1 1]
Data Types: double
Rotation — Euler angle of UAV
vector
Euler angle of UAV, returned as a vector of the form [Rz Ry
Rx]
, where Rz
, Ry
, and
Rx
are rotation angles around the z-,
y-, and x- axes, respectively. Units are in
radians.
If you enable the Convert to ENU reference frame and Front-Left-Up body frame parameter, this block outputs rotation from the ENU frame to the Front-Left-Up body frame. Otherwise, this block returns rotation in the same frame as the trajectory source.
Example: [1 0 0]
Data Types: double
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
Trajectory source — Source for trajectory
From trajectory object in workspace
(default) | From UAV Scenario in workspace
Select the source for the UAV trajectory from these options:
From trajectory object in workspace
—Use a trajectory in your workspace, created using a
multirotorFlightTrajectory
,fixedwingFlightTrajectory
,polynomialTrajectory
, orwaypointTrajectory
object.From UAV Scenario in workspace
—Use a trajectory that you have added to a platform in a UAV scenario.
UAV scenario object — UAV scenario object
singleUAVScenario
(default) | uavScenario
object
UAV scenario object containing the UAV platform that has the trajectory you want to
use, specified as a uavScenario
object.
Dependencies
To enable this parameter, set Trajectory source to
From UAV Scenario in workspace
.
UAV platform name — Name of UAV platform
UAV
(default) | name of UAV platform
Name of the UAV that which has the trajectory you want to use.
Dependencies
To enable this parameter, set Trajectory source to
From UAV Scenario in workspace
.
Trajectory object — Trajectory object
waypointTrajectory()
(default) | multirotorFlightTrajectory
object | fixedwingFlightTrajectory
object | polynomialTrajectory
object | waypointTrajectory
object
Specify the trajectory using one of these objects in the workspace: multirotorFlightTrajectory
, fixedwingFlightTrajectory
, polynomialTrajectory
, or waypointTrajectory
.
Dependencies
To enable this parameter, set Trajectory source to
From trajectory object in workspace
.
Convert to ENU reference frame and Front-Left-Up body frame — Translation and rotation coordinate frame
on
(default) | off
Select this parameter to output translation in the ENU reference frame and rotation from the ENU frame to the Front-Left-Up body frame. Otherwise, the block outputs translation and rotation in the same frame as the trajectory source. Select this parameter if you want to use the outputs of this block as Translation and Rotation inputs for the Simulation 3D UAV Vehicle block.
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)