## Coordinate Systems for Unreal Engine Simulation in UAV Toolbox

UAV Toolbox enables you to simulate your UAV scenario in a virtual environment that uses the Unreal Engine® from Epic Games®.

Note

Simulating models in the 3D visualization environment requires Simulink® 3D Animation™.

UAV Toolbox uses these coordinate systems to calculate the vehicle dynamics and position objects in the Unreal Engine visualization environment.

Environment

Description

Coordinate Systems

The UAV Toolbox interface to the Unreal Engine simulation environment uses the right-handed (RH) Cartesian coordinate systems:

• Earth-fixed (inertial)

• Vehicle

Unreal Engine visualization

To position objects and query the Unreal Engine visualization environment, the UAV Toolbox uses the Unreal Engine world coordinate system.

### Earth-Fixed (Inertial) Coordinate System

The earth-fixed coordinate system (XE, YE, ZE) axes are fixed in an inertial reference frame. The inertial reference frame has zero linear and angular acceleration and zero angular velocity. In Newtonian physics, the earth is an inertial reference.

AxisDescription
XE

The XE axis is in the forward direction of the vehicle.

The XE and YE axes are parallel to the ground plane. The ground plane is a horizontal plane normal to the gravitational vector.

YE
ZE

In the Z-up orientation, the positive ZE axis points upward. This is the orientation that Unreal Engine uses.

In the Z-down orientation, the positive ZE axis points downward.

### Body (Non-Inertial) Coordinate System

Modeling aircraft and spacecraft are simplest if you use a coordinate system fixed in the body itself. In the case of aircraft, the forward direction is modified by the presence of wind, and the craft's motion through the air is not the same as its motion relative to the ground. The non-inertial body coordinate system is fixed in both origin and orientation to the moving craft. The craft is assumed to be rigid. The orientation of the body coordinate axes is fixed in the shape of body.

• The `x`-axis points through the nose of the craft.

• The `y`-axis points to the left of the `x`-axis (facing in the pilot's direction of view), perpendicular to the `x`-axis.

• The `z`-axis points up, perpendicular to the `x`-`y` plane and satisfying the RH rule.

#### Translational Degrees of Freedom

Translations are defined by moving along these axes by distances `x`, `y`, and `z` from the origin.

#### Rotational Degrees of Freedom

Rotations are defined by the Euler angles `P`, `Q`, `R` or Φ, Θ, Ψ. They are

• `P` or Φ: Roll about the `x`-axis

• `Q` or Θ: Pitch about the `y`-axis

• `R` or Ψ: Yaw about the `z`-axis

Unless otherwise specified, by default the software uses ZYX rotation order for Euler angles.

### Unreal Engine World Coordinate System

The simulation environment uses a right-handed Cartesian world coordinate system. The following 2D top-view image of the US City Block scene shows the X- and Y-coordinates of the scene.

In this coordinate system, when looking in the positive direction of the X-axis, the positive Y-axis points left. The positive Z-axis points from the ground up. The yaw, pitch, and roll angles are clockwise-positive, when looking in the positive directions of the Z-, Y-, and X-axes, respectively. If you view a scene from a 2D top-down perspective, then the yaw angle is counterclockwise-positive, because you are viewing the scene in the negative direction of the Z-axis.