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

AP_MSP: MSP_RAW_GPS cog should be decidegrees not centidegrees #28090

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

catkira
Copy link
Contributor

@catkira catkira commented Sep 12, 2024

@catkira
Copy link
Contributor Author

catkira commented Sep 12, 2024

I think we should also make ground_course_dd uint16_t, because the range is 0 - 3600 deci-degrees.
I agree that having centi-degrees would be smarter, because it could still fit into a 16-bit number, but just doing it differently here causes incompatibility issues.

@peterbarker
Copy link
Contributor

Looks likely.

Commit message should be AP_MSP:, not fix:. Want to fix that or shall I?

@catkira
Copy link
Contributor Author

catkira commented Sep 12, 2024

I can fix. Should I also change it to uint16_t? (-> see my last force push)

@@ -217,7 +217,7 @@ void AP_MSP_Telem_Backend::update_gps_state(gps_state_t &gps_state)
gps_state.lon = loc.lng;
gps_state.alt_m = loc.alt/100; // 1m resolution
gps_state.speed_cms = gps.ground_speed() * 100;
gps_state.ground_course_cd = gps.ground_course_cd();
gps_state.ground_course_dd = gps.ground_course_cd() * 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

To convert from centi-degrees to deci-degrees you need to divide by 10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, good catch :)

@catkira catkira force-pushed the fix_msp_raw_gps_cog branch 2 times, most recently from 94f25fc to 90e5e1a Compare September 12, 2024 16:31
@peterbarker peterbarker merged commit 09286e6 into ArduPilot:master Sep 13, 2024
95 checks passed
@catkira
Copy link
Contributor Author

catkira commented Sep 13, 2024

@rmackay9 can you backport this to plane 4.5.6 ?

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

Successfully merging this pull request may close these issues.

5 participants