Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added computing of heading[] fields from new flight attitude quatrernion log data #790

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

demvlad
Copy link
Contributor

@demvlad demvlad commented Nov 13, 2024

The improvement for "Added flight IMU pitch, roll, yaw attitudes to blackbox log" BF PR.
The heading[roll, pitch, heading] computed fields are calculated from new flight BF imu quaternion data.
For older logs the older internal BBExplorer IMU are used.

Copy link

netlify bot commented Nov 13, 2024

Deploy Preview for origin-blackbox-logviewer ready!

Name Link
🔨 Latest commit 9708ed8
🔍 Latest deploy log https://app.netlify.com/sites/origin-blackbox-logviewer/deploys/673515b338e6ae0008c649d6
😎 Deploy Preview https://deploy-preview-790.dev.blackbox.betaflight.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@demvlad demvlad marked this pull request as draft November 13, 2024 14:30
x: srcFrame[imuQuaternion[0]] / scaleFromFixedInt16,
y: srcFrame[imuQuaternion[1]] / scaleFromFixedInt16,
z: srcFrame[imuQuaternion[2]] / scaleFromFixedInt16,
w: 1.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$w = sqrt(1 - (x^2 + y^2 + z^2))$

src/flightlog.js Outdated
@@ -735,7 +735,7 @@ export function FlightLog(logData) {
x: srcFrame[imuQuaternion[0]] / scaleFromFixedInt16,
y: srcFrame[imuQuaternion[1]] / scaleFromFixedInt16,
z: srcFrame[imuQuaternion[2]] / scaleFromFixedInt16,
w: 1.0,
w: 0.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also wrong. $w$ must be recomputed so that size of quaternion is 1

@demvlad
Copy link
Contributor Author

demvlad commented Nov 13, 2024

Tested on my tiny whoop.
Compare new attitude curves with ATTITUDE_DEBUG.
Looks good.
Log file:
btfl_all_attitude.txt
Attitude

@demvlad demvlad marked this pull request as ready for review November 13, 2024 18:26
@demvlad
Copy link
Contributor Author

demvlad commented Nov 13, 2024

The olde logs work by BBE internal IMU as before:
Attitude_old

src/flightlog.js Outdated Show resolved Hide resolved
src/flightlog.js Outdated Show resolved Hide resolved
Comment on lines +613 to +615
let gyroADC = [fieldNameToIndex["gyroADC[0]"], fieldNameToIndex["gyroADC[1]"], fieldNameToIndex["gyroADC[2]"]];
let accSmooth = [fieldNameToIndex["accSmooth[0]"], fieldNameToIndex["accSmooth[1]"], fieldNameToIndex["accSmooth[2]"]];
let magADC = [fieldNameToIndex["magADC[0]"], fieldNameToIndex["magADC[1]"], fieldNameToIndex["magADC[2]"]];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to refactor seeing next line :)

demvlad and others added 2 commits November 14, 2024 00:09
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Copy link

sonarcloud bot commented Nov 13, 2024

@demvlad
Copy link
Contributor Author

demvlad commented Nov 14, 2024

The test result of BF, Configurator and explorer work are showed this

@demvlad
Copy link
Contributor Author

demvlad commented Nov 15, 2024

The new testing:
betaflight/betaflight#14020 (comment)
The all work fine.
The log file:
btfl_attitude.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants