Skip to content

initial GNSS probe - #28

Open
sempervent wants to merge 5 commits into
release/1.3.0from
feature/GPS
Open

initial GNSS probe#28
sempervent wants to merge 5 commits into
release/1.3.0from
feature/GPS

Conversation

@sempervent

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
self.process_metadata()
if frame.empty:
return
self.send_data(frame[["time", "value"]], metric=METRICS.SYNC_HEALTH, reference_type=REF_TYPES.GNSS)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we just get the sync health between the current device and the GNSS? nothing further?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what other further would you be looking for? I couldn't think of anything else of value from gpspipe - maybe we should engage with some of the timing experts on this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll look over the link to gpspipe, I just wasn't sure what was provided haha

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://gpsd.io/gpsd_json.html#:~:text=second.%20Certainty%20unknown.-,ept,Estimated%20time%20stamp%20error%20in%20seconds.%20Certainty%20unknown.,-epx

From the looks of it, the json could contain a lot of useful metrics, in particular EPT (estimated timestamp error) and the jamming field seem interesting to us

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I was uncertain of what would be useful for the initial pass. Maybe we could get this in and then determine which metrics we want to collect or have a larger discussion. Additionally, I'm not sure how much gpsd|gpspipe is used in the industry and we may want to consult with the time folks.

Comment thread opensampl/vendors/gnss.py Outdated
Comment thread docs/guides/collection.md Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Co-authored-by: Midgie MacFarland <160664522+midgemacf@users.noreply.github.com>
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/vendors/gnss.py Outdated
self.process_metadata()
if frame.empty:
return
self.send_data(frame[["time", "value"]], metric=METRICS.SYNC_HEALTH, reference_type=REF_TYPES.GNSS)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://gpsd.io/gpsd_json.html#:~:text=second.%20Certainty%20unknown.-,ept,Estimated%20time%20stamp%20error%20in%20seconds.%20Certainty%20unknown.,-epx

From the looks of it, the json could contain a lot of useful metrics, in particular EPT (estimated timestamp error) and the jamming field seem interesting to us

Comment thread opensampl/vendors/gnss.py Outdated
Comment thread opensampl/metrics.py
Comment on lines +131 to +132
name="Altitude HAE",
description="Altitude above the reference ellipsoid",

@midgemacf midgemacf Aug 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I got confused by description since no clear definition for HAE acronym

Comment thread opensampl/metrics.py
Comment on lines +137 to +138
name="Altitude MSL",
description="Altitude above mean sea level",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think mean sea level is the measurement, so it's not above mean sea level

maybe worth giving the altMSL = altHAE - geoidSEP

Comment thread opensampl/vendors/gpsd.py

vendor = VENDORS.GPSD
TPV_METRICS: ClassVar[dict[str, MetricType]] = {
"mode": METRICS.SYNC_HEALTH,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

gpsd_json mode as defined in the gpsd_json file is one of: 0, 1, 2, 3
distinct from the metrics.sync_health definition of 0 vs 1

I see 3 options:

  1. cast the mode returned by gpsd_json to be 0 v 1
  2. add new metric to match the GPSD TPV mode
  3. Change the definition of the current sync_health metric to be more general

Personally, i prefer 2

Comment thread opensampl/metrics.py
Comment thread opensampl/metrics.py
)
CLOCK_BIAS = MetricType(
name="Clock Bias",
description="Offset of the local GNSS clock relative to UTC",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should evaluate which of these keep GNSS in descriptions, and which should be made more general

Comment thread opensampl/vendors/gpsd.py
Comment on lines +90 to +91
class CollectConfig(CollectMixin.CollectConfig):
"""Options passed to ``gpspipe`` for a single GPSD device."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we lost the docstring

Comment thread opensampl/vendors/gpsd.py
Comment thread opensampl/vendors/gpsd.py
Comment thread opensampl/vendors/gpsd.py
Comment on lines +126 to +131
device = self.metadata.get("device")
if not device:
raise ValueError("GPSD artifact metadata is missing a device")
self.probe_key = ProbeKey(
ip_address=str(self.metadata.get("gpsd_host", "127.0.0.1")),
probe_id=str(device),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should port + device be included in probe_id?

Comment thread opensampl/vendors/gpsd.py
metric = self.TPV_METRICS.get(str(field))
if metric is None:
continue
self.send_data(values[["time", "value"]], metric=metric, reference_type=REF_TYPES.GNSS)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So for these metrics, it doesn't actually seem to be giving us referential information...

only some of the status stuff is the status of the relationship between the daemon and the device

the rest is objective data about the device

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

edit: the clock bias is "Offset of local GNSS clock relative to UTC, in ns. AKA Clock Offset."

but.... idk how we get that UTC value

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.

2 participants