## 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 |
---|---|---|

UAV vehicle dynamics in Simulink | The UAV Toolbox interface to the Unreal Engine simulation environment uses the
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 (*X _{E}*,

*Y*,

_{E}*Z*) 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.

_{E}Axis | Description |
---|---|

X_{E} | The The
Y axes are
parallel to the ground plane. The ground plane is a horizontal plane
normal to the gravitational vector._{E} |

Y_{E} | |

Z_{E} | In the In the |

### 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

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

The

-axis points to the left of the`y`

-axis (facing in the pilot's direction of view), perpendicular to the`x`

-axis.`x`

The

-axis points up, perpendicular to the`z`

-`x`

plane and satisfying the RH rule.`y`

#### Translational Degrees of Freedom

Translations are defined by moving along these axes by distances
* x*,

*, and*

`y`

*from the origin.*

`z`

#### Rotational Degrees of Freedom

Rotations are defined by the Euler angles * P*,

*,*

`Q`

*or Φ, Θ, Ψ. They are*

`R`

or Φ: Roll about the`P`

-axis`x`

or Θ: Pitch about the`Q`

-axis`y`

or Ψ: Yaw about the`R`

-axis`z`

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.

## See Also

Quadrotor | Fixed Wing Aircraft