coloradocube / flight-executive-in-python

A lightweight flight executive for balloonsats and cubesats which do not require the full capabilities and complexity of NASA cFS. Written in Python.
0 stars 1 forks source link

Consuming streaming GPS data for telemetry #3

Open ivogeorg opened 2 years ago

ivogeorg commented 2 years ago

Description

The requirements for the GPS receiver are in the following issues:

  1. coloradocube/balloonsat#4
  2. coloradocube/balloonsat#12 (also see #8)
  3. coloradocube/balloonsat#50
  4. coloradocube/balloonsat#62

The work is in the coloradocube/balloonsat/gps directory.

Notes on GPS stream

  1. The GPS receiver (at least the MAX-M8Q GNSS HAT based on u-blox M8Q) outputs a stream and cannot be polled like the other sensors.
  2. The stream should not be left unprocessed because it stalls and has to restart.
  3. The stream contains various data packets and the right one has to be selected for the (lon, lat, alt) data.
ccason1 commented 2 years ago

The code that I wrote using Python's gpsd library takes approximately between 0.1 and 1 seconds to collect a data packet. I am working on a fix so that we can collect data from the stream much faster.

ivogeorg commented 2 years ago

That does appear a bit slow, indeed.

On Mon, Mar 21, 2022, 20:11 Conlan Cason @.***> wrote:

The code that I wrote using Python's gpsd library takes approximately between 0.1 and 1 seconds to collect a data packet. I am working on a fix so that we can collect data from the stream much faster.

— Reply to this email directly, view it on GitHub https://github.com/coloradocube/flight-executive-in-python/issues/3#issuecomment-1074633733, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABODNUE6EM7LVVJZRFAQAMTVBET6HANCNFSM5NKJQ64Q . You are receiving this because you authored the thread.Message ID: @.***>

ccason1 commented 2 years ago

Instead of gpsd, the Python libraries pynmea2 and serial seem to work for our purposes with very few lines of code.

ivogeorg commented 2 years ago

I felt gpsd was a massive overkill for.our purposes, so this is cool. I'll take a look tomorrow.

On Mon, Mar 21, 2022, 21:25 Conlan Cason @.***> wrote:

Instead of gpsd, the Python libraries pynmea2 and serial seem to work for our purposes with very few lines of code.

— Reply to this email directly, view it on GitHub https://github.com/coloradocube/flight-executive-in-python/issues/3#issuecomment-1074686267, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABODNUGIBZE5U7EEDVNM5CTVBE4UNANCNFSM5NKJQ64Q . You are receiving this because you authored the thread.Message ID: @.***>

ccason1 commented 2 years ago

Although the GNSS receiver receives a bunch of data, not much of that data is useful for us. According to my tests it only receives a timestamp 3 times per second, and it only receives location data 1 time per second. This is consistent with various online sources.