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 CRSF GPS heading precision #3177

Merged
merged 1 commit into from
Feb 18, 2023
Merged

Fix CRSF GPS heading precision #3177

merged 1 commit into from
Feb 18, 2023

Conversation

3djc
Copy link
Collaborator

@3djc 3djc commented Feb 11, 2023

Looking at the code there seems something wrong with CRSF GPS heading. I do not think it has been reported, nor do I have the necessary equipment to confirm, but looking at

image

or betaflight code

/*
0x02 GPS
Payload:
int32_t Latitude ( degree / 10000000 )
int32_t Longitude (degree / 10000000 )
uint16_t Groundspeed ( km/h / 10 )
uint16_t GPS heading ( degree / 100 )
uint16 Altitude ( meter ­1000m offset )
uint8_t Satellites in use ( counter )
*/

the current code cannot be right (and in addition, a 16bits uint cannot store 360 * 1000, so a 3 digits precision cannot work)

I would really appreciate if someone with a craft with GPS using CRSF could report

@pfeerick
Copy link
Member

pfeerick commented Feb 16, 2023

I'll be able to test this for you soon... I have two quads with GPS running CRSF telemetry.

This was reported, but only in passing on discord: https://discord.com/channels/839849772864503828/839856795781431317/1058208096704549044

@pfeerick pfeerick added telemetry 📶 bug 🪲 Something isn't working labels Feb 16, 2023
@pfeerick
Copy link
Member

I ended up doing a walk test so I could eyeball the telemetry... latest nightly was heading was buggy, with this PR heading was perfect.

@pfeerick pfeerick merged commit 1562b80 into main Feb 18, 2023
@pfeerick pfeerick deleted the 3djc-crsf-hdg branch February 18, 2023 08:28
@pfeerick pfeerick added this to the 2.9 milestone Feb 18, 2023
@pfeerick pfeerick modified the milestones: 2.9, 2.8.3 Apr 13, 2023
ajjjjjjjj added a commit to OpenI6X/opentx that referenced this pull request Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working telemetry 📶
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants