Coordinate Systems
Overview
Maverick AI LOS uses three coordinate systems. Understanding when and how to convert between them is essential for placing AR content accurately.
ENU (East-North-Up) - World Space
The primary coordinate system for all AR positioning. All setWorldPosition() calls use ENU:
| Axis | Direction |
|---|---|
| East | Positive = right when facing north |
| North | Positive = geographic north |
| Up | Positive = away from earth |
The origin (0, 0, 0) is the user's position at the time sensors were enabled.
Eye Space - User-Relative
Eye-relative coordinates are defined relative to the user's current head orientation:
| Axis | Direction |
|---|---|
| Right | Positive = user's right |
| Up | Positive = user's up |
| Back | Positive = behind the user (negative = forward) |
Use eye-relative positioning when you want content to appear "in front of" the user regardless of which direction they face:
// Place at the user's current look direction
arPanel.setEyePosition(quaternion)
// Place at a custom eye-relative offset
arPanel.setEyePosition(
qtrn = quaternion,
eyeRight = 0.5f,
eyeUp = 0f,
eyeBack = -2f
)
Display Space - Screen Pixels
The glasses display coordinate system used by all HUD drawables:
| Property | Value |
|---|---|
| Origin | Top-left corner |
| Width | 640 pixels |
| Height | 400 pixels |
| X axis | Positive = right |
| Y axis | Positive = down |
Coordinate Conversions
The SDK provides conversion utilities through the internal math layer:
| Conversion | Method | Description |
|---|---|---|
| Eye → World | M2ArPanel.setEyePosition(quaternion, ...) |
Converts eye-relative vector to world ENU using the quaternion |
| Geographic → World | M2ArPanel(targetPosition, userPosition) |
Converts lat/lon/alt to ENU relative to user position |
| World → Display | Handled by firmware | The glasses project world positions onto the 640x400 display in real-time |
Geographic Positioning
For geo-anchored AR content (navigation waypoints, POIs), use geographic coordinates. The SDK does not access GPS - your application is responsible for obtaining and updating the user's location as they move.
val target = GeoLocation(lat = 32.0853, lon = 34.7818, alt = 0.0)
val user = GeoLocation(lat = 32.0850, lon = 34.7815, alt = 0.0)
val arPanel = M2ArPanel(targetPosition = target, userPosition = user)
To keep geo-anchored content accurate during movement, update the user position whenever a new GPS fix is available.
M2Quaternion
The M2Quaternion class represents 3D orientation as a unit quaternion (w, x, y, z):
// Access components
val w = quaternion.w
val x = quaternion.x
val y = quaternion.y
val z = quaternion.z
// Convert to Euler angles (yaw, pitch, roll)
val euler = quaternion.toEuler() // FloatArray [yaw, pitch, roll]
// Interpolate between two orientations
val blended = M2Quaternion.Slerp(q1, q2, alpha = 0.5f)
// Rotate a 3D vector
val rotated = FloatArray(3)
quaternion.rotateVector(inputVec, rotated)
See Also
- AR Panels - HUD-style content in world space
- LOS Overview - Introduction to Line of Sight AR