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

Fix heading offset #600

Merged
merged 2 commits into from
Sep 27, 2022
Merged

Conversation

ctzsnooze
Copy link
Member

The heading value shown in Explorer's IMU calculation did not match that shown in the GPS Heading or IMU Debug values.

I noted that the blackbox IMU heading calculation is derived from other parameters, and differs from the IMU heading value in debugs. However it may be useful in some cases, and should at least have the same values and display the same when graphed. This PR fixes that problem so that all heading values match up numerically and in graphs.

Other minor changes:

  • changed 'deg' to the degree symbol, consistently
  • put a space before units, consistently, for clarity
  • removed unnecessary whitespace
  • added Altitude graph configuration
  • added a small change to RTH to graph display values, which can be reversed once debugging of maxAlt is complete.

@ctzsnooze ctzsnooze requested review from McGiverGim, daleckystepan and haslinghuis and removed request for McGiverGim and daleckystepan September 27, 2022 02:45
@ctzsnooze ctzsnooze self-assigned this Sep 27, 2022
@github-actions

This comment has been minimized.

@blckmn
Copy link
Member

blckmn commented Sep 27, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> FAIL
  • cooling off period lapsed -> FAIL
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> FAIL
  • Tested label found -> FAIL
  • assigned to an approver -> PASS
  • approver count at least three -> FAIL

@github-actions

This comment has been minimized.

case 'ALTITUDE':
switch (fieldName) {
case 'debug[0]': // GPS Trust * 100
value.toFixed(0);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
value.toFixed(0);
return value.toFixed(0);

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, that was a silly mistake.

Comment on lines 924 to 925
var sysConfig = flightLog.getSysConfig();
var debugModeName = DEBUG_MODE[sysConfig.debug_mode];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var sysConfig = flightLog.getSysConfig();
var debugModeName = DEBUG_MODE[sysConfig.debug_mode];
const sysConfig = flightLog.getSysConfig();
const debugModeName = DEBUG_MODE[sysConfig.debug_mode];

Copy link
Member Author

Choose a reason for hiding this comment

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

This change was from a commit that was accidentally added in this PR by mistake.

It was intended to add the debug name into the text that appears to the right of the graph, but it didn't work, so I've removed that commit.

That removes the need to make this change, but I'll put it into the code I was testing.

Thank you again.

js/imu.js Outdated
Comment on lines 128 to 131
if (heading > 2* Math.PI)
heading -= 2* Math.PI;

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (heading > 2* Math.PI)
heading -= 2* Math.PI;
if (heading > 2 * Math.PI) {
heading -= 2 * Math.PI;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, wasn't sure of the need for the braces

@ctzsnooze
Copy link
Member Author

Thanks very much @haslinghuis for your advice and comments.

@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
2.7% 2.7% Duplication

@github-actions
Copy link

Do you want to test this code? Here you have an automated build:
Betaflight-Blackbox-Explorer-Linux
Betaflight-Blackbox-Explorer-macOS
Betaflight-Blackbox-Explorer-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@haslinghuis haslinghuis merged commit 3820714 into betaflight:master Sep 27, 2022
@haslinghuis haslinghuis added this to the 3.7.0 milestone Sep 28, 2022
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