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 support for ATT GPSD message #32

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

Conversation

glencornell
Copy link

Fixes #30

gpsd/__init__.py Outdated
@@ -128,6 +138,10 @@ def from_json(cls, packet):
result.error['c'] = last_tpv['epc'] if 'epc' in last_tpv else 0
result.error['v'] = last_tpv['epv'] if 'epv' in last_tpv else 0

result.heading = last_att['heading'] if 'heading' in last_att else 0.0
Copy link

Choose a reason for hiding this comment

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

What happens if the actual value is 0.0?

Copy link
Author

@glencornell glencornell Nov 25, 2022

Choose a reason for hiding this comment

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

What do you mean by actual value? Do you mean last_att['heading']?

Copy link

Choose a reason for hiding this comment

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

If you take a look at the heading and it is 0.0 you assume north I guess. So i think you can't use 0.0 to tell the user that there is no heading information. I think it should be something like None or so.

Copy link
Author

Choose a reason for hiding this comment

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

Okay. Now I understand. Yes, 0 is a valid heading, so the error condition should return None. I’ll make the change and push.

@booo
Copy link

booo commented Nov 24, 2022

I would love to have this feature merged.

@glencornell
Copy link
Author

It is now reporting None when vehicle attitude is unavailable. IMO, the style is inconsistent with the rest of the system (where one checks for the mode before using variables/methods). Also, keep in mind that many GPS receivers don't report attitude. So this feature is available only when you have the right hardware. I hope this addresses the concern above.

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.

Add support for gpsd ATT command
2 participants