diff --git a/.gitmodules b/.gitmodules index 26f93ef164..4ba149cb2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "opendbc"] path = opendbc url = ../../commaai/opendbc.git -[submodule "laika_repo"] - path = laika_repo - url = ../../commaai/laika.git [submodule "cereal"] path = cereal url = ../../commaai/cereal.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e023229e8..c1c24d1096 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: rev: v2.2.6 hooks: - id: codespell - exclude: '^(third_party/)|(body/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)|(selfdrive/ui/translations/.*.ts)|(poetry.lock)' + exclude: '^(third_party/)|(body/)|(cereal/)|(panda/)|(opendbc/)|(rednose/)|(rednose_repo/)|(selfdrive/ui/translations/.*.ts)|(poetry.lock)' args: # if you've got a short variable name that's getting flagged, add it here - -L bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie,preints @@ -39,12 +39,12 @@ repos: language: system types: [python] args: ['--explicit-package-bases'] - exclude: '^(third_party/)|(cereal/)|(opendbc/)|(panda/)|(laika/)|(laika_repo/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(xx/)' + exclude: '^(third_party/)|(cereal/)|(opendbc/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(xx/)' - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.5 hooks: - id: ruff - exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)' + exclude: '^(third_party/)|(cereal/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)' - repo: local hooks: - id: cppcheck diff --git a/Dockerfile.openpilot b/Dockerfile.openpilot index 3541be92b0..27b1e246bd 100644 --- a/Dockerfile.openpilot +++ b/Dockerfile.openpilot @@ -13,8 +13,6 @@ COPY SConstruct ${OPENPILOT_PATH} COPY ./openpilot ${OPENPILOT_PATH}/openpilot COPY ./third_party ${OPENPILOT_PATH}/third_party COPY ./site_scons ${OPENPILOT_PATH}/site_scons -COPY ./laika ${OPENPILOT_PATH}/laika -COPY ./laika_repo ${OPENPILOT_PATH}/laika_repo COPY ./rednose ${OPENPILOT_PATH}/rednose COPY ./tools ${OPENPILOT_PATH}/tools COPY ./release ${OPENPILOT_PATH}/release diff --git a/SConstruct b/SConstruct index b96347d9b2..e72e344516 100644 --- a/SConstruct +++ b/SConstruct @@ -56,7 +56,7 @@ AddOption('--pc-thneed', AddOption('--minimal', action='store_false', dest='extras', - default=os.path.islink(Dir('#laika/').abspath), + default=os.path.islink(Dir('#rednose/').abspath), # minimal by default on release branch (where rednose is not a link) help='the minimum build to run openpilot. no tests, tools, etc.') ## Architecture name breakdown (arch) diff --git a/docs/Makefile b/docs/Makefile index dee660f770..1eaae656bb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -41,7 +41,7 @@ clean: @echo "Building rst files..." sphinx-apidoc -o "$(DOCSBUILDDIR)" ../ \ - ../xx ../laika_repo ../rednose_repo ../notebooks ../panda_jungle \ + ../xx ../rednose_repo ../notebooks ../panda_jungle \ ../third_party \ ../panda/examples \ ../scripts \ diff --git a/docs/overview.rst b/docs/overview.rst index b9a5700528..8c552077f3 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -18,14 +18,6 @@ cereal cereal/README.md cereal/messaging/msgq.md -laika -========= - -.. toctree:: - :maxdepth: 4 - - laika_repo/README.md - models ========= diff --git a/laika b/laika deleted file mode 120000 index 1c7429f4ac..0000000000 --- a/laika +++ /dev/null @@ -1 +0,0 @@ -laika_repo/laika/ \ No newline at end of file diff --git a/laika_repo b/laika_repo deleted file mode 160000 index 8861844c9b..0000000000 --- a/laika_repo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8861844c9b577ff7de7d03fab9f4d7f560415fc9 diff --git a/poetry.lock b/poetry.lock index 41a445a009..7897a7a7f6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f131dbbf295ce7584d9df3768254a5ea8c486ca008b84c5437bbdfc90261bbc8 -size 451773 +oid sha256:fe928d22a4b219d099d51d732ca7b1d017e0f94295cc0901b31553182cc6bbff +size 439894 diff --git a/pyproject.toml b/pyproject.toml index 8a5769bcc9..38c3337c6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.pytest.ini_options] minversion = "6.0" -addopts = "--ignore=openpilot/ --ignore=cereal/ --ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=laika_repo/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup" +addopts = "--ignore=openpilot/ --ignore=cereal/ --ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup" cpp_files = "test_*" python_files = "test_*.py" #timeout = "30" # you get this long by default @@ -38,8 +38,6 @@ exclude = [ "cereal/", "opendbc/", "panda/", - "laika/", - "laika_repo/", "rednose/", "rednose_repo/", "tinygrad/", @@ -82,7 +80,6 @@ crcmod = "*" cryptography = "*" Cython = "*" future-fstrings = "*" # for acados -hatanaka = "==2.4" hexdump = "*" Jinja2 = "*" json-rpc = "*" @@ -159,7 +156,6 @@ sphinx-sitemap = "*" tabulate = "*" tenacity = "*" types-atomicwrites = "*" -types-certifi = "*" types-pycurl = "*" types-PyYAML = "*" types-requests = "*" @@ -187,7 +183,6 @@ target-version="py311" exclude = [ "panda", "opendbc", - "laika_repo", "rednose_repo", "tinygrad_repo", "third_party", diff --git a/release/files_common b/release/files_common index b2623e0113..a1a164bfbf 100644 --- a/release/files_common +++ b/release/files_common @@ -448,7 +448,6 @@ scripts/stop_updater.sh rednose/.gitignore rednose/** -laika/** body/.gitignore body/board/SConscript diff --git a/selfdrive/locationd/models/gnss_helpers.py b/selfdrive/locationd/models/gnss_helpers.py index b6c1771ec6..f412fafda9 100644 --- a/selfdrive/locationd/models/gnss_helpers.py +++ b/selfdrive/locationd/models/gnss_helpers.py @@ -1,19 +1,35 @@ import numpy as np -from laika.raw_gnss import GNSSMeasurement + + +# source: GNSSMeasurement (https://github.com/commaai/laika/blob/master/laika/raw_gnss.py) +class RawGNSSMeasurementIndices: + PRN = 0 + RECV_TIME_WEEK = 1 + RECV_TIME_SEC = 2 + GLONASS_FREQ = 3 + + PR = 4 + PR_STD = 5 + PRR = 6 + PRR_STD = 7 + + SAT_POS = slice(8, 11) + SAT_VEL = slice(11, 14) + def parse_prr(m): - sat_pos_vel_i = np.concatenate((m[GNSSMeasurement.SAT_POS], - m[GNSSMeasurement.SAT_VEL])) - R_i = np.atleast_2d(m[GNSSMeasurement.PRR_STD]**2) - z_i = m[GNSSMeasurement.PRR] + sat_pos_vel_i = np.concatenate((m[RawGNSSMeasurementIndices.SAT_POS], + m[RawGNSSMeasurementIndices.SAT_VEL])) + R_i = np.atleast_2d(m[RawGNSSMeasurementIndices.PRR_STD]**2) + z_i = m[RawGNSSMeasurementIndices.PRR] return z_i, R_i, sat_pos_vel_i + def parse_pr(m): - pseudorange = m[GNSSMeasurement.PR] - pseudorange_stdev = m[GNSSMeasurement.PR_STD] - sat_pos_freq_i = np.concatenate((m[GNSSMeasurement.SAT_POS], - np.array([m[GNSSMeasurement.GLONASS_FREQ]]))) + pseudorange = m[RawGNSSMeasurementIndices.PR] + pseudorange_stdev = m[RawGNSSMeasurementIndices.PR_STD] + sat_pos_freq_i = np.concatenate((m[RawGNSSMeasurementIndices.SAT_POS], + np.array([m[RawGNSSMeasurementIndices.GLONASS_FREQ]]))) z_i = np.atleast_1d(pseudorange) R_i = np.atleast_2d(pseudorange_stdev**2) return z_i, R_i, sat_pos_freq_i -