Skip to content

Configurable orientation and ground station reference frames #117

@1-Bart-1

Description

@1-Bart-1

Problem

All orientation functions in KiteUtils are hardcoded to NED (Xsens IMU convention), and the ground station frame is hardcoded to NWU (called "EG" in the code). This makes the code confusing — there are four similar frames (ENU, NED, NWU, EX/EG) with subtle axis swaps, and conversions between them are scattered throughout the transformation pipeline.

Proposal

All internal calculations should use ENU (East, North, Up) — the same frame already used for positions and velocities. This makes the code easier to understand since there is one canonical internal frame.

Two new settings control how external data enters and leaves the pipeline:

  • orientation_frame (ENU | NED | NWU, default NED): The frame the IMU reports orientation in. Euler angles and quaternions from the IMU are converted to ENU at the boundary, and all internal orientation math stays in ENU.

  • ground_station_frame (ENU | NED | NWU, default NWU): The convention used by the ground station. Vectors are converted from ENU to this frame only when interfacing with ground station–specific code (heading/course via the wind frame).

Implementation

  • Add @enum InertialFrame NED ENU NWU
  • Add frame_transform(from, to) returning the 3×3 transformation matrix between any two frames
  • Add euler_convert(r, p, y, from, to) for converting Euler angles between conventions (with convenience aliases euler_enu2ned, euler_ned2enu)
  • Add orientation_frame and ground_station_frame fields to Settings
  • Update fromKS2EX, calc_orient_rot, quat2euler, euler2rot, quat2viewer, calc_heading_w, calc_heading, calc_course to use the settings
  • Keep backward compatibility: existing calls without kwargs produce identical results
  • Keep legacy ENU::Bool kwarg on calc_orient_rot as a forwarding dispatch

Frames reference

Name Axes Usage
ENU East, North, Up Internal calculations, positions, velocities
NED North, East, Down Xsens IMU orientation (default orientation_frame)
NWU North, West, Up Ground station (default ground_station_frame, historically called EG)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions