brilliantlabsAR / frame-codebase

The complete codebase for Frame
https://www.brilliant.xyz
Other
207 stars 41 forks source link

IMU heading #262

Open tremblin opened 3 weeks ago

tremblin commented 3 weeks ago

IMU code for heading is missing (see TODO).

https://github.com/brilliantlabsAR/frame-codebase/blob/2e2a01ef91b7bc854987e0e7c35d117830ac3371/source/application/lua_libraries/imu.c#L170

Please complete the code for heading.

tremblin commented 1 week ago

i've tried to calculate this on my own in LUA based on the frame.imu.raw() data. however the reading from the magnetometer seems to be wrong. it should read -|B| µT or +|B| µT if an axis is aligned to magnetic north (see https://eu.mouser.com/datasheet/2/821/MC6470_Datasheet_APS_048_0033v1_7_1-3003085.pdf, page 6), but i never get negative values from the readings!?

further your frame's coordinate system is a bit odd: i would envision the x-axis is pointing from the nose forward (direction of sight), y-axis to the right and z-axis down. in your case it seems the x-axis points left, y-axis backwards and z-axis downwards.

a good readup on axis + pcb placement and pitch/roll/yaw calculation can be found at https://www.mikrocontroller.net/attachment/292888/AN4248.pdf.