# Coordinate System Conventions
( [[See also our mathematical notation page|MathSymbols]])
----
## Body Reference Frame Naming Conventions
Fig. 1 shows the coordinate convention used for our rocket.
[[Body-Coordinates.png]]
We tried, but nobody would use anything but theta(θ) to indicate roll, so we went with that. The <xyz> axes form a right handed coordinate system where roll is measured on the z axis parallel to the body axis. We arbitrarily assign the x axis to be pitch with angle phi(φ), and the y axis to be yaw with angle psi(ψ). The intention is to assign the axis of the horizon camera as the x axis, though we don't expect perfect alignment so probably whichever IMU axis is nearly parallel to the horizon camera will be the "real" x axis.
A somewhat old document referring to this is available here: [[Body_Reference_Frame.pdf]]
The only modification to this document (so far) is that we've switched the names of the angular variables, as indicated before, the system is now:
- phi(φ) = pitch (x)
- psi(ψ) = yaw (y)
- theta(θ) = roll (z)
----
## Ground Reference Frame
Since for now we're doing only relatively low altitude sounding rocket flights, we like to define our local coordinate system assuming a flat Earth. That is, we define a rectangular coordinate system centered on our launch site with "up" defined by the gravity-plumb line. To keep this system easy to use we align the (x) axis with true East and the (y) axis to true North. The resulting East-North-Up <enu> system is a right handed rectangular coordinate system as shown in the next figure.
[[enu.png]]
For more information including the formula for transforming from ECEF-g (Earth Centered Earth Fixed Geodetic) to <enu> please see the attached document: [[Latitude_to_LocalTangent.pdf]]
----
## Position Reference Frame Summary
[[!table class="data" data="""
Frame | Symbol | coordinates | Notes
[[Sensor|CoordinateSystem/#Sensor]] | *s* | <f, u, t> | Unique to each sensor
[[Platform|CoordinateSystem/#Platform]] | *p* | <x, y, z> | IMU reference frame
[[Body|CoordinateSystem/#Body]] | *b* | <x, y, z> | Same frame as mechanical design
[[Tangent|CoordinateSystem/#Tangent]] | *t* | <e, n, u> | INS output frame
[[ECEF-r|CoordinateSystem/#ECEF-r]] | *r* | <x, y, z> | GPS Cartesian frame
[[Geodetic|CoordinateSystem/#Geodetic]] | *g* | <λ, φ, h> | GPS lat., lon., height
"""]]
Each position reference frame defines a right-handed coordinate system.
A _sensor_ frame is defined for every direction sensitive axis, this includes each accelerometer, gyro, and magnetometer axis. The sensor frames allow for formal accounting of sensor misalignment. The _sensor_ axis names are <(f)orward, (u)p, (t)ransverse>
The _platform_ frame is the natural output frame of the IMU. It defines three orthogonal <xyz> axes with a fixed orientation relative to the _body_ frame. The _platform_ frame is transformed to the _navigation_ frame when aggregating navigation information for vehicle control.
The _body_ frame is the tied to the physical airframe. It is the natural frame for control surface and vehicle attitude control. The _body_ to _platform_ transformation is important for calculating control outputs during active guidance.
The _tangent plane_ is the locally aligned Cartesian coordinate frame. In the _tangent_ frame ground level is at (u=0). A closely related frame defines _height_ as geodetic height relative to the WGS84 ellipsoid, so some caution should be used in keeping the zero-altitude reference consistent. The _tangent_ axis names are <(e)ast, (n)orth, (u)p>
The _ECEF-r_ coordinates are Earth-Centered, Earth-Fixed, rectangular coordinates. Earth-Centered meaning the origin is at the center of the Earth, Earth-Fixed meaning the x axis passes through the equator at the prime meridian (longitude = latitude = zero). _ECEF-r_ rotates with the Earth and is therefore not an inertial frame. _ECEF-r_ coordinates are available from most off the shelf GPS units.
_Geodetic_ coordinates (also known as _ECEF-g_) are the primary coordinates of the GPS. They are based on the WGS84 ellipsoid. In particular _Geodetic_ height is measured relative to the ellipsoid. (Note that some references reverse the symbols for latitude(λ) and longitude(φ). We prefer the definition given here.)
The _navigation_ frame is the frame used for path planning and other tracking and control purposes. No specific _navigation_ frame is defined here. The frame appropriate for navigation is application dependent, and may even vary within a single application. When defined, the _navigation_ frame is symbolized by the letter (_n_).
----
## Aerodynamic parameters in body frame coordinates
Lift and drag are not typically aligned with the body frame axes. The next figure indicates the relationship and suggests some conventions for labeling lift, drag, and some other body forces.
[[Lift-etc.png]]

Lift and Drag in body coordinates