Implement Galileo E1B I/NAV navigation decoding

This commit is contained in:
2026-07-31 00:15:34 +03:00
parent 2a6ccfc23d
commit 814a788b36
104 changed files with 6351 additions and 10 deletions
+19
View File
@@ -0,0 +1,19 @@
from __future__ import annotations
import numpy as np
from galileo_rx.navigation.inav_crc import crc24q, validate_crc24q
def test_crc24q_independent_check_value() -> None:
bits = np.unpackbits(np.frombuffer(b"123456789", dtype=np.uint8), bitorder="big")
assert crc24q(bits) == 0xCDE703
def test_crc_rejects_one_bit_error() -> None:
protected = np.asarray([0, 1, 1, 0, 1] * 39 + [1], dtype=np.int8)
value = crc24q(protected)
crc_bits = np.asarray([(value >> shift) & 1 for shift in range(23, -1, -1)], dtype=np.int8)
assert validate_crc24q(protected, crc_bits)
protected[17] ^= 1
assert not validate_crc24q(protected, crc_bits)