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

Add OSD item to show heading correction to go home #3411

Merged
merged 1 commit into from Jun 22, 2018

Conversation

shellixyz
Copy link
Collaborator

Closes #3091

{
buff[0] = SYM_HOME;
buff[1] = SYM_HEADING;
int16_t h = wrap_18000(DEGREES_TO_CENTIDEGREES((int32_t)GPS_directionToHome) - DECIDEGREES_TO_CENTIDEGREES((int32_t)osdGetHeading()));
Copy link
Member

Choose a reason for hiding this comment

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

Why is this in 0.1deg? Isn't 1deg precise enough? MWOSD seems to be displayed full degrees https://github.com/ShikOfTheRa/scarab-osd/blob/2f2311363a95ad797dbb92621330b6c2ffab8e79/MW_OSD/Screen.ino#L1191

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made this very quickly without checking I will update it soon. I'm converting to centidegrees to be able to use wrap_18000 but it needs to be converted back to degrees. Would be so much better if everything was in degrees inside floats...

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't osdGetHeadingAngle() work for the wrapping?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, scratch that. I got it, you want CCW to be negative. Makes sense that way.

@shellixyz shellixyz force-pushed the osd_home_heading_error branch 2 times, most recently from 576cd86 to 8993283 Compare June 21, 2018 22:05
@fiam fiam merged commit e62c438 into iNavFlight:development Jun 22, 2018
@fiam fiam added this to the 2.0 milestone Jun 22, 2018
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.

None yet

2 participants