⌖ SEXTANTE // IMU DRIVER SYS ONLINE · v0.2

// ATTITUDE & HEADING SYSTEM

SEXTANTE

A Python driver for the InvenSense MPU-9250 — accelerometer, gyroscope and AK8963 magnetometer over I2C on the Raspberry Pi. Tested without hardware. Documented down to the silicon.

SELF-CHECK
TELEMETRY LIVE
GYRO°/s
ACCELg
MAGµT
TEMP°C
WHO_AM_I 0x71 · WIA 0x48 · 50 Hz

DRAG THE CUBE — BODY-FRAME AXES, AS THE DRIVER REPORTS THEM

// NINE AXES, DONE RIGHT

REAL MAGNETOMETER DATA

The AK8963 runs in continuous 16-bit mode (0.15 µT/LSB); every sample is validity-gated by the ST1/ST2 status registers. Actual microteslas, not noise.

HARDWARE SELF-CHECK

WHO_AM_I and the magnetometer id are verified before configuring anything — relabeled MPU-6500 boards get diagnosed, not silently tolerated.

ONE FRAME FOR EVERYTHING

Magnetometer readings are remapped into the accel/gyro body frame, so heading and fusion math get consistent axes out of the box.

BACKGROUND SAMPLING

A drift-free ticker samples at your rate; get_avg() synchronously returns the average of everything since the previous call.

TEST WITHOUT HARDWARE

The I2C bus is injectable — the whole test suite runs against an in-memory fake, on any machine, in under a second.

DOCUMENTED INTERNALS

Two dies, two byte orders, two access modes — thehardware doc explains the chip the datasheets assume you already understand.

// QUICK START

# On the Raspberry Pi (I2C enabled)
git clone https://github.com/olagopirez/sextante.git
cd sextante
pip install -e .
import time
from mpu9250 import MPU9250

mpu = MPU9250(rate=50)
mpu.initialize()   # self-checks the chip, calibrates, starts sampling

while True:
    time.sleep(1)
    print(mpu.get_avg().get_json())   # °/s, g, µT, °C

At rest you should see A3 ≈ 1.0 (gravity), gyros ≈ 0 and a realistic temperature — a five-second wiring sanity check.

// IS YOUR CHIP REAL?

The MPU-9250 is discontinued and heavily counterfeited. self_check()reads WHO_AM_I and tells you what you actually own:

WHO_AM_ICHIPVERDICT
0x71MPU-9250GENUINE ✓
0x73MPU-9255WORKS FINE ✓
0x70MPU-6500RELABEL — NO MAGNETOMETER
0x68MPU-6050DIFFERENT PART

THE FULL STORY OF THE TWO DIES →