Skip to content

Commit

Permalink
Container image
Browse files Browse the repository at this point in the history
  • Loading branch information
TedSjoblom committed Oct 20, 2022
1 parent 021df4f commit 1ae0bc9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 34 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Generate brefv code
run: |
mkdir brefv
datamodel-codegen --input brefv-spec/envelope.json --input-file-type jsonschema --output brefv/envelope.py
datamodel-codegen --input brefv-spec/messages --input-file-type jsonschema --reuse-model --output brefv/messages
- name: Run black
run: |
black --check main.py
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
file: Dockerfile
push: true
tags: |
ghcr.io/mo-rise/crowsnest-connector-lidar-ouster:latest
ghcr.io/mo-rise/crowsnest-connector-lidar-ouster:${{ github.event.release.tag_name }}
ghcr.io/mo-rise/crowsnest-connector-udp-nmea:latest
ghcr.io/mo-rise/crowsnest-connector-udp-nmea:${{ github.event.release.tag_name }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
25 changes: 11 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


# Setup logger
LOG_LEVEL = env.log_level("LOG_LEVEL", logging.INFO)
LOG_LEVEL = env.log_level("LOG_LEVEL", logging.WARNING)
logging.basicConfig(level=LOG_LEVEL)
logging.captureWarnings(True)
warnings.filterwarnings("once")
Expand Down Expand Up @@ -107,31 +107,28 @@ def pars_nmea(nmea_msg_bytes):

for nmea_str in nmea_list:
nmea_str = "$" + nmea_str.split("$")[-1]
LOGGER.info(nmea_str)

try:
nmea_type_msg = nmea_str.split(",")[0].replace("$", "")
LOGGER.info(nmea_type_msg)

if nmea_type_msg == "PASHR":
PASHR_items = nmea_str.split(",")

for idx, item in enumerate(PASHR_items):
try:
PASHR_items[idx] = float(PASHR_items[idx])
except:
pass
pass

PASHR = {
"heading": PASHR_items[2],
"roll": PASHR_items[4],
"pitch": PASHR_items[5],
"roll_accuracy": PASHR_items[7],
"heading_accuracy": PASHR_items[9],
}
"heading": PASHR_items[2],
"roll": PASHR_items[4],
"pitch": PASHR_items[5],
"roll_accuracy": PASHR_items[7],
"heading_accuracy": PASHR_items[9],
}
nmea_parameters.update(PASHR)


msg = pynmea2.parse(nmea_str)

if msg.sentence_type == "GGA":
Expand Down Expand Up @@ -188,8 +185,8 @@ def pars_nmea(nmea_msg_bytes):
nmea_parameters.update(GST)

except Exception as e:
LOGGER.info(e)
pass
LOGGER.error(e)

LOGGER.info(nmea_parameters)

return nmea_parameters
Expand Down
13 changes: 0 additions & 13 deletions test.py

This file was deleted.

0 comments on commit 1ae0bc9

Please sign in to comment.