M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
m5::imu::AxisOrder Struct Reference

Chip-frame-to-body-frame axis remap: a permutation plus a per-output-axis sign flip. More...

#include <axis_order.hpp>

Public Member Functions

void apply (float(&v)[3]) const
 Apply this permutation and sign flip to a physical-unit XYZ triplet, in place.
 

Public Attributes

AxisPermutation permutation {AxisPermutation::XYZ}
 Axis permutation.
 
bool invert_x {false}
 Negate output X after permutation.
 
bool invert_y {false}
 Negate output Y after permutation.
 
bool invert_z {false}
 Negate output Z after permutation.
 

Detailed Description

Chip-frame-to-body-frame axis remap: a permutation plus a per-output-axis sign flip.

Applied by AhrsController::update() to every accel/gyro/mag sample from a given IMUDataSource, right after raw-to-physical conversion and before auto-calibration offsets are subtracted (see AhrsController::writeAxisOrder()/readAxisOrder()). Mirrors M5Unified's internal_axisorder_t, operating directly on physical-unit float triplets.

The default (AxisPermutation::XYZ, no inversion) is the identity transform, i.e. exactly what a source already reports in its own chip frame.

Member Function Documentation

◆ apply()

void m5::imu::AxisOrder::apply ( float(&) v[3]) const
inline

Apply this permutation and sign flip to a physical-unit XYZ triplet, in place.

Parameters
v[in,out]3-element array (accel, gyro, or mag), overwritten with the remapped values