-
Notifications
You must be signed in to change notification settings - Fork 125
[J-Turtle] Fix uninitialized values in NavSatFix and add missing NavSatStatus UNKNOWN #220
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,13 @@ | |
# type and the last time differential corrections were received. A | ||
# fix is valid when status >= STATUS_FIX. | ||
|
||
int8 STATUS_UNKNOWN = -2 # status is not yet set | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes sense to me to have an uninitialized state as the default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I view it as a safety problem that the default state is "healthy". Because ROSIDL supports a default constructor in C++, users of NavSatFix are not required to fill this out. Thus, if they take shortcuts, only fit out the lat-long fields, and lose GPS signal,they now report the status as having a fix even though the data is invalid and might not realize it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't defaulting to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also default the latitude and longitude to NAN to avoid accidental visits to Null Island. https://en.wikipedia.org/wiki/Null_Island There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, but adding a new value makes it exactly clear between these two situations:
I'd vote for keeping these as distinct as one means you might have a wiring or baud issue, and the other means that you just need to wait for it to warm up or get a better view of the sky. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am a fan of setting the latitude and longitude to NAN as default (assuming the ROS IDL lets us do that). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is not currently possible. See my docs PR which explains what's currently possible with I am working on adding support for NaN defaults and NaN constants, but it's not clear whether it will make the Jazzy release. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding in the NaN logic is reasonable, but I think that should be a sanity check of the data, more than the canonical way to know what the status is. Checking all field values for NaN can be very expensive versus being able to quickly check an enumeration and stop processing data early. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be more of a NaN fan if tooling supported it better, but there's currently no way to to set a NaN value in DDS IDL, nor is it supported in JSON. See here for implementation notes. I'd prefer not hold up this PR which was intended as a bugfix with other things like NaN support. |
||
int8 STATUS_NO_FIX = -1 # unable to fix position | ||
int8 STATUS_FIX = 0 # unaugmented fix | ||
int8 STATUS_SBAS_FIX = 1 # with satellite-based augmentation | ||
int8 STATUS_GBAS_FIX = 2 # with ground-based augmentation | ||
|
||
int8 status | ||
int8 status = STATUS_UNKNOWN | ||
Ryanf55 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Bits defining which Global Navigation Satellite System signals were | ||
# used by the receiver. | ||
|
Uh oh!
There was an error while loading. Please reload this page.