mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-17 02:42:10 +08:00
Merge remote-tracking branch 'origin/master' into master3
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
FROM ghcr.io/commaai/openpilot-base:latest
|
||||
|
||||
RUN apt update && apt install -y vim net-tools usbutils htop ripgrep tmux wget mesa-utils xvfb libxtst6 libxv1 libglu1-mesa gdb bash-completion
|
||||
RUN pip install ipython jupyter jupyterlab
|
||||
RUN python3 -m ensurepip --upgrade
|
||||
RUN pip3 install ipython jupyter jupyterlab
|
||||
|
||||
RUN cd /tmp && \
|
||||
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
|
||||
|
||||
@@ -41,10 +41,10 @@ jobs:
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: poetry lock
|
||||
- name: uv lock
|
||||
run: |
|
||||
pip install poetry
|
||||
poetry lock
|
||||
pip install uv
|
||||
uv lock
|
||||
- name: pre-commit autoupdate
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
@@ -62,7 +62,6 @@ jobs:
|
||||
cd $GITHUB_WORKSPACE
|
||||
cp .pre-commit-config.yaml $STRIPPED_DIR
|
||||
cp pyproject.toml $STRIPPED_DIR
|
||||
cp poetry.lock $STRIPPED_DIR
|
||||
cd $STRIPPED_DIR
|
||||
${{ env.RUN }} "unset PYTHONWARNINGS && SKIP=check-added-large-files,check-hooks-apply,check-useless-excludes pre-commit run --all && chmod -R 777 /tmp/pre-commit"
|
||||
|
||||
@@ -86,7 +85,7 @@ jobs:
|
||||
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
|
||||
- uses: ./.github/workflows/compile-openpilot
|
||||
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 15 || 30) }} # allow more time when we missed the scons cache
|
||||
|
||||
|
||||
build_mac:
|
||||
name: build macos
|
||||
runs-on: macos-latest
|
||||
@@ -102,7 +101,7 @@ jobs:
|
||||
# package install has DeprecationWarnings
|
||||
PYTHONWARNINGS: default
|
||||
- name: Test openpilot environment
|
||||
run: poetry run scons -h
|
||||
run: . .venv/bin/activate && scons -h
|
||||
|
||||
static_analysis:
|
||||
name: static analysis
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
exempt-milestones: true
|
||||
exempt-all-milestones: true
|
||||
|
||||
# pull request config
|
||||
stale-pr-message: 'This PR has had no activity for ${{ env.DAYS_BEFORE_PR_STALE }} days. It will be automatically closed in ${{ env.DAYS_BEFORE_PR_CLOSE }} days if there is no activity.'
|
||||
|
||||
@@ -53,10 +53,8 @@ jobs:
|
||||
python-version: '3.11.4'
|
||||
- name: Installing pip
|
||||
run: pip install pip==24.0
|
||||
- name: Installing poetry
|
||||
run: pip install poetry==1.7.0
|
||||
- name: Installing python dependencies
|
||||
run: poetry install --no-cache --no-root
|
||||
- name: Installing uv
|
||||
run: pip install uv
|
||||
- name: git LFS
|
||||
run: git lfs pull
|
||||
- run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
|
||||
@@ -69,7 +67,7 @@ jobs:
|
||||
scons-${{ runner.arch }}-ubuntu2004-${{ env.CACHE_COMMIT_DATE }}
|
||||
scons-${{ runner.arch }}-ubuntu2004
|
||||
- name: Building openpilot
|
||||
run: poetry run scons -u -j$(nproc)
|
||||
run: uv run scons -u -j$(nproc)
|
||||
- name: Saving scons cache
|
||||
uses: actions/cache/save@v4
|
||||
if: github.ref == 'refs/heads/master'
|
||||
@@ -100,6 +98,6 @@ jobs:
|
||||
- name: Test environment
|
||||
run: |
|
||||
devcontainer exec --workspace-folder . scons -j$(nproc) cereal/ common/
|
||||
devcontainer exec --workspace-folder . pip install pip-install-test
|
||||
devcontainer exec --workspace-folder . pip3 install pip-install-test
|
||||
devcontainer exec --workspace-folder . touch /home/batman/.comma/auth.json
|
||||
devcontainer exec --workspace-folder . sudo touch /root/test.txt
|
||||
|
||||
+3
-10
@@ -19,7 +19,7 @@ repos:
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: check-added-large-files
|
||||
exclude: '(docs/CARS.md)|(poetry.lock)|(third_party/acados/include/blasfeo/include/blasfeo_d_kernel.h)'
|
||||
exclude: '(docs/CARS.md)|(uv.lock)|(third_party/acados/include/blasfeo/include/blasfeo_d_kernel.h)'
|
||||
args:
|
||||
- --maxkb=120
|
||||
- --enforce-all
|
||||
@@ -27,13 +27,13 @@ repos:
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: '^(third_party/)|(body/)|(msgq/)|(panda/)|(opendbc/)|(rednose/)|(rednose_repo/)|(teleoprtc/)|(teleoprtc_repo/)|(selfdrive/ui/translations/.*.ts)|(poetry.lock)'
|
||||
exclude: '^(third_party/)|(body/)|(msgq/)|(panda/)|(opendbc/)|(rednose/)|(rednose_repo/)|(teleoprtc/)|(teleoprtc_repo/)|(selfdrive/ui/translations/.*.ts)|(uv.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,whit,indexIn
|
||||
- --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.4.10
|
||||
rev: v0.5.0
|
||||
hooks:
|
||||
- id: ruff
|
||||
exclude: '^(third_party/)|(msgq/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
|
||||
@@ -92,13 +92,6 @@ repos:
|
||||
language: system
|
||||
pass_filenames: false
|
||||
files: '^selfdrive/ui/translations/'
|
||||
- repo: https://github.com/python-poetry/poetry
|
||||
rev: '1.8.0'
|
||||
hooks:
|
||||
- id: poetry-check
|
||||
name: validate poetry lock
|
||||
args:
|
||||
- --lock
|
||||
- repo: https://github.com/python-jsonschema/check-jsonschema
|
||||
rev: 0.28.5
|
||||
hooks:
|
||||
|
||||
@@ -68,16 +68,15 @@ RUN usermod -aG sudo $USER
|
||||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
USER $USER
|
||||
|
||||
COPY --chown=$USER pyproject.toml poetry.lock /tmp/
|
||||
COPY --chown=$USER pyproject.toml uv.lock /tmp/
|
||||
COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/
|
||||
|
||||
ENV POETRY_VIRTUALENVS_CREATE=false
|
||||
ENV VIRTUAL_ENV=/home/$USER/venv/.venv
|
||||
RUN python3 -m venv $VIRTUAL_ENV
|
||||
ENV VIRTUAL_ENV=/home/$USER/.venv
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
RUN . $VIRTUAL_ENV/bin/activate && \
|
||||
cd /tmp && \
|
||||
RUN cd /tmp && \
|
||||
tools/install_python_dependencies.sh && \
|
||||
mkdir -p $VIRTUAL_ENV && \
|
||||
cp -r /tmp/.venv/* $VIRTUAL_ENV && \
|
||||
rm -rf /tmp/* && \
|
||||
rm -rf /home/$USER/.cache
|
||||
|
||||
|
||||
@@ -868,6 +868,37 @@ struct ControlsState @0x97ff69c53601abf1 {
|
||||
vPidDEPRECATED @2 :Float32;
|
||||
}
|
||||
|
||||
struct DrivingModelData {
|
||||
frameId @0 :UInt32;
|
||||
frameIdExtra @1 :UInt32;
|
||||
frameDropPerc @6 :Float32;
|
||||
|
||||
action @2 :ModelDataV2.Action;
|
||||
|
||||
laneLineMeta @3 :LaneLineMeta;
|
||||
meta @4 :MetaData;
|
||||
|
||||
path @5 :PolyPath;
|
||||
|
||||
struct PolyPath {
|
||||
xCoefficients @0 :List(Float32);
|
||||
yCoefficients @1 :List(Float32);
|
||||
zCoefficients @2 :List(Float32);
|
||||
}
|
||||
|
||||
struct LaneLineMeta {
|
||||
leftY @0 :Float32;
|
||||
rightY @1 :Float32;
|
||||
leftProb @2 :Float32;
|
||||
rightProb @3 :Float32;
|
||||
}
|
||||
|
||||
struct MetaData {
|
||||
laneChangeState @0 :LaneChangeState;
|
||||
laneChangeDirection @1 :LaneChangeDirection;
|
||||
}
|
||||
}
|
||||
|
||||
# All SI units and in device frame
|
||||
struct XYZTData @0xc3cbae1fd505ae80 {
|
||||
x @0 :List(Float32);
|
||||
@@ -2263,6 +2294,7 @@ struct Event {
|
||||
driverMonitoringState @71: DriverMonitoringState;
|
||||
liveLocationKalman @72 :LiveLocationKalman;
|
||||
modelV2 @75 :ModelDataV2;
|
||||
drivingModelData @128 :DrivingModelData;
|
||||
driverStateV2 @92 :DriverStateV2;
|
||||
|
||||
# camera stuff, each camera state has a matching encode idx
|
||||
|
||||
+2
-1
@@ -60,7 +60,8 @@ _services: dict[str, tuple] = {
|
||||
"driverMonitoringState": (True, 20., 10),
|
||||
"wideRoadEncodeIdx": (False, 20., 1),
|
||||
"wideRoadCameraState": (True, 20., 20),
|
||||
"modelV2": (True, 20., 40),
|
||||
"drivingModelData": (True, 20., 10),
|
||||
"modelV2": (True, 20., 0),
|
||||
"managerState": (True, 2., 1),
|
||||
"uploaderState": (True, 0., 1),
|
||||
"navInstruction": (True, 1., 10),
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ scons -j8 selfdrive/ui/
|
||||
cd selfdrive/ui/ && scons -u -j8
|
||||
|
||||
# test everything
|
||||
pytest .
|
||||
pytest
|
||||
|
||||
# test just logging services
|
||||
cd system/loggerd && pytest .
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ https://www.mkdocs.org/getting-started/
|
||||
|
||||
```
|
||||
pip install mkdocs mkdocs-terminal
|
||||
mkdocs --serve
|
||||
mkdocs serve
|
||||
```
|
||||
|
||||
inspiration:
|
||||
|
||||
Generated
-7976
File diff suppressed because one or more lines are too long
+132
-128
@@ -1,15 +1,143 @@
|
||||
[project]
|
||||
name = "openpilot"
|
||||
requires-python = ">= 3.11"
|
||||
readme = "README.md"
|
||||
license = {text = "MIT License"}
|
||||
version = "0.1.0"
|
||||
description = "an open source driver assistance system"
|
||||
authors = [
|
||||
{name ="Vehicle Researcher", email="user@comma.ai"}
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
# multiple users
|
||||
"sounddevice", # micd + soundd
|
||||
"pyserial", # pigeond + qcomgpsd
|
||||
"requests", # many one-off uses
|
||||
"sympy", # rednose + friends
|
||||
"crcmod", # cars + qcomgpsd
|
||||
"tqdm", # cars (fw_versions.py) on start + many one-off uses
|
||||
|
||||
# hardwared
|
||||
"smbus2", # configuring amp
|
||||
|
||||
# core
|
||||
"cffi",
|
||||
"scons",
|
||||
"pycapnp",
|
||||
"Cython",
|
||||
"setuptools",
|
||||
"numpy < 2.0.0", # control does not support numpy 2
|
||||
|
||||
# body / webrtcd
|
||||
"aiohttp",
|
||||
"aiortc",
|
||||
"pyaudio",
|
||||
|
||||
# panda
|
||||
"libusb1",
|
||||
"spidev; platform_system == 'Linux'",
|
||||
|
||||
# modeld
|
||||
"onnx >= 1.14.0",
|
||||
"onnxruntime >=1.16.3; platform_system == 'Linux' and platform_machine == 'aarch64'",
|
||||
"onnxruntime-gpu >=1.16.3; platform_system == 'Linux' and platform_machine == 'x86_64'",
|
||||
|
||||
# logging
|
||||
"pyzmq",
|
||||
"sentry-sdk",
|
||||
|
||||
# athena
|
||||
"PyJWT",
|
||||
"json-rpc",
|
||||
"websocket_client",
|
||||
|
||||
# acados deps
|
||||
"casadi",
|
||||
"future-fstrings",
|
||||
|
||||
# these should be removed
|
||||
"psutil",
|
||||
"pycryptodome", # used in updated/casync, panda, body, and a test
|
||||
|
||||
#logreader
|
||||
"zstd",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
docs = [
|
||||
"Jinja2",
|
||||
"sphinx",
|
||||
"sphinx-rtd-theme",
|
||||
"sphinx-sitemap"
|
||||
]
|
||||
|
||||
testing = [
|
||||
"coverage",
|
||||
"hypothesis ==6.47.*",
|
||||
"mypy",
|
||||
"pre-commit",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-cpp",
|
||||
"pytest-subtests",
|
||||
"pytest-xdist",
|
||||
"pytest-timeout",
|
||||
"pytest-randomly",
|
||||
"pytest-asyncio",
|
||||
"pytest-mock",
|
||||
"pytest-repeat",
|
||||
"ruff"
|
||||
]
|
||||
|
||||
dev = [
|
||||
"av",
|
||||
"azure-identity",
|
||||
"azure-storage-blob",
|
||||
"breathe",
|
||||
"control",
|
||||
"dictdiffer",
|
||||
"flaky",
|
||||
"inputs",
|
||||
"lru-dict",
|
||||
"matplotlib",
|
||||
"metadrive-simulator; platform_machine != 'aarch64'",
|
||||
"mpld3",
|
||||
"myst-parser",
|
||||
"natsort",
|
||||
"opencv-python-headless",
|
||||
"parameterized >=0.8, <0.9",
|
||||
#pprofile = "*"
|
||||
"pyautogui",
|
||||
"pygame",
|
||||
"pyopencl; platform_machine != 'aarch64'", # broken on arm64
|
||||
"pywinctl",
|
||||
"pyprof2calltree",
|
||||
"rerun-sdk",
|
||||
"tabulate",
|
||||
"types-requests",
|
||||
"types-tabulate",
|
||||
|
||||
# this is only pinned since 5.15.11 is broken
|
||||
"pyqt5 ==5.15.2; platform_machine == 'x86_64'", # no aarch64 wheels for macOS/linux
|
||||
|
||||
]
|
||||
|
||||
[tool.uv.sources]
|
||||
metadrive-simulator = { git = "https://github.com/commaai/metadrive.git", branch = "opencv_headless" }
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://comma.ai"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = [ "." ]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
minversion = "6.0"
|
||||
addopts = "--ignore=openpilot/ --ignore=cereal/ --ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=teleoprtc_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/ --ignore=teleoprtc_repo/ --ignore=msgq/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup"
|
||||
cpp_files = "test_*"
|
||||
cpp_harness = "selfdrive/test/cpp_harness.py"
|
||||
python_files = "test_*.py"
|
||||
@@ -75,131 +203,6 @@ warn_return_any=true
|
||||
# allow implicit optionals for default args
|
||||
implicit_optional = true
|
||||
|
||||
|
||||
[tool.poetry]
|
||||
name = "openpilot"
|
||||
version = "0.1.0"
|
||||
description = "an open source driver assistance system"
|
||||
authors = ["Vehicle Researcher <user@comma.ai>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/commaai/openpilot"
|
||||
documentation = "https://docs.comma.ai"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.11, <3.13"
|
||||
|
||||
# multiple users
|
||||
sounddevice = "*" # micd + soundd
|
||||
pyserial = "*" # pigeond + qcomgpsd
|
||||
requests = "*" # many one-off uses
|
||||
sympy = "*" # rednose + friends
|
||||
crcmod = "*" # cars + qcomgpsd
|
||||
tqdm = "*" # cars (fw_versions.py) on start + many one-off uses
|
||||
|
||||
# hardwared
|
||||
smbus2 = "*" # configuring amp
|
||||
|
||||
# core
|
||||
cffi = "*"
|
||||
scons = "*"
|
||||
pycapnp = "*"
|
||||
Cython = "*"
|
||||
setuptools = "*"
|
||||
numpy = "*"
|
||||
|
||||
# body / webrtcd
|
||||
aiohttp = "*"
|
||||
aiortc = "*"
|
||||
pyaudio = "*"
|
||||
|
||||
# panda
|
||||
libusb1 = "*"
|
||||
spidev = { version = "*", platform = "linux" }
|
||||
|
||||
# modeld
|
||||
onnx = ">=1.14.0"
|
||||
onnxruntime = { version = ">=1.16.3", platform = "linux", markers = "platform_machine == 'aarch64'" }
|
||||
onnxruntime-gpu = { version = ">=1.16.3", platform = "linux", markers = "platform_machine == 'x86_64'" }
|
||||
|
||||
# logging
|
||||
pyzmq = "*"
|
||||
sentry-sdk = "*"
|
||||
|
||||
# athena
|
||||
PyJWT = "*"
|
||||
json-rpc = "*"
|
||||
websocket_client = "*"
|
||||
|
||||
# acados deps
|
||||
casadi = "*"
|
||||
future-fstrings = "*"
|
||||
|
||||
# these should be removed
|
||||
psutil = "*"
|
||||
pycryptodome = "*" # used in updated/casync, panda, body, and a test
|
||||
|
||||
#logreader
|
||||
zstd = "*"
|
||||
|
||||
[tool.poetry.group.docs.dependencies]
|
||||
Jinja2 = "*"
|
||||
sphinx = "*"
|
||||
sphinx-rtd-theme = "*"
|
||||
sphinx-sitemap = "*"
|
||||
|
||||
[tool.poetry.group.testing.dependencies]
|
||||
coverage = "*"
|
||||
hypothesis = "~6.47"
|
||||
mypy = "*"
|
||||
pre-commit = "*"
|
||||
pytest = "*"
|
||||
pytest-cov = "*"
|
||||
pytest-cpp = "*"
|
||||
pytest-subtests = "*"
|
||||
pytest-xdist = "*"
|
||||
pytest-timeout = "*"
|
||||
pytest-randomly = "*"
|
||||
pytest-asyncio = "*"
|
||||
pytest-mock = "*"
|
||||
pytest-repeat = "*"
|
||||
ruff = "*"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
av = "*"
|
||||
azure-identity = "*"
|
||||
azure-storage-blob = "*"
|
||||
breathe = "*"
|
||||
control = "*"
|
||||
dictdiffer = "*"
|
||||
flaky = "*"
|
||||
inputs = "*"
|
||||
lru-dict = "*"
|
||||
matplotlib = "*"
|
||||
metadrive-simulator = { git = "https://github.com/commaai/metadrive.git", branch = "anisotropic_off", markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies
|
||||
mpld3 = "*"
|
||||
myst-parser = "*"
|
||||
natsort = "*"
|
||||
opencv-python-headless = "*"
|
||||
parameterized = "^0.8"
|
||||
#pprofile = "*"
|
||||
pyautogui = "*"
|
||||
pygame = "*"
|
||||
pyopencl = { version = "*", markers = "platform_machine != 'aarch64'" } # broken on arm64
|
||||
pywinctl = "*"
|
||||
pyprof2calltree = "*"
|
||||
rerun-sdk = "*"
|
||||
tabulate = "*"
|
||||
types-requests = "*"
|
||||
types-tabulate = "*"
|
||||
|
||||
# this is only pinned since 5.15.11 is broken
|
||||
pyqt5 = { version = "==5.15.2", markers = "platform_machine == 'x86_64'" } # no aarch64 wheels for macOS/linux
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
|
||||
[tool.ruff]
|
||||
indent-width = 2
|
||||
@@ -209,7 +212,8 @@ lint.select = [
|
||||
"UP", # pyupgrade
|
||||
"TRY302", "TRY400", "TRY401", # try/excepts
|
||||
"RUF008", "RUF100",
|
||||
"TID251"
|
||||
"TID251",
|
||||
"PLR1704",
|
||||
]
|
||||
lint.ignore = [
|
||||
"E741",
|
||||
|
||||
@@ -23,7 +23,7 @@ blacklist = [
|
||||
"^common/tests/",
|
||||
|
||||
# particularly large text files
|
||||
"poetry.lock",
|
||||
"uv.lock",
|
||||
"third_party/catch2",
|
||||
"selfdrive/car/tests/test_models.*",
|
||||
|
||||
|
||||
@@ -315,6 +315,7 @@ FW_VERSIONS = {
|
||||
b'68284456AI ',
|
||||
b'68284477AF ',
|
||||
b'68325564AH ',
|
||||
b'68325564AI ',
|
||||
b'68325565AH ',
|
||||
b'68325565AI ',
|
||||
b'68325618AD ',
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# ruff: noqa: E501
|
||||
from cereal import car
|
||||
from openpilot.selfdrive.car.hyundai.values import CAR
|
||||
|
||||
@@ -8,42 +7,6 @@ Ecu = car.CarParams.Ecu
|
||||
# i.e. if it sends the SCC messages or if another ECU like the camera or ADAS Driving ECU does
|
||||
|
||||
|
||||
FINGERPRINTS = {
|
||||
CAR.HYUNDAI_SANTA_FE: [{
|
||||
67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1156: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1379: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8
|
||||
},
|
||||
{
|
||||
67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 764: 8, 809: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1186: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8
|
||||
},
|
||||
{
|
||||
67: 8, 68: 8, 80: 4, 160: 8, 161: 8, 272: 8, 288: 4, 339: 8, 356: 8, 357: 8, 399: 8, 544: 8, 608: 8, 672: 8, 688: 5, 704: 1, 790: 8, 809: 8, 848: 8, 880: 8, 898: 8, 900: 8, 901: 8, 904: 8, 1056: 8, 1064: 8, 1065: 8, 1072: 8, 1075: 8, 1087: 8, 1088: 8, 1151: 8, 1200: 8, 1201: 8, 1232: 4, 1264: 8, 1265: 8, 1266: 8, 1296: 8, 1306: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1348: 8, 1349: 8, 1369: 8, 1370: 8, 1371: 8, 1407: 8, 1415: 8, 1419: 8, 1440: 8, 1442: 4, 1461: 8, 1470: 8
|
||||
}],
|
||||
CAR.HYUNDAI_SONATA: [{
|
||||
67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 546: 8, 549: 8, 550: 8, 576: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 8, 865: 8, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 908: 8, 909: 8, 912: 7, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1089: 5, 1096: 8, 1107: 5, 1108: 8, 1114: 8, 1136: 8, 1145: 8, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1184: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1268: 8, 1280: 8, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1330: 8, 1339: 8, 1342: 6, 1343: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1379: 8, 1384: 8, 1394: 8, 1407: 8, 1419: 8, 1427: 6, 1446: 8, 1456: 4, 1460: 8, 1470: 8, 1485: 8, 1504: 3, 1988: 8, 1996: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8, 2015: 8
|
||||
}],
|
||||
CAR.KIA_STINGER: [{
|
||||
67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 576: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1379: 8, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1456: 4, 1470: 8
|
||||
}],
|
||||
CAR.GENESIS_G90: [{
|
||||
67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2003: 8, 2004: 8, 2005: 8, 2008: 8, 2011: 8, 2012: 8, 2013: 8
|
||||
}],
|
||||
CAR.HYUNDAI_KONA_EV: [{
|
||||
127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 549: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1307: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1378: 4, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1473: 8, 1507: 8, 1535: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8, 1157: 4, 1193: 8, 1379: 8, 1988: 8, 1996: 8
|
||||
}],
|
||||
CAR.HYUNDAI_KONA_EV_2022: [{
|
||||
127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1069: 8, 1078: 4, 1136: 8, 1145: 8, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1173: 8, 1183: 8, 1188: 8, 1191: 2, 1193: 8, 1225: 8, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1339: 8, 1342: 8, 1343: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1379: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1446: 8, 1456: 4, 1470: 8, 1473: 8, 1485: 8, 1507: 8, 1535: 8, 1990: 8, 1998: 8
|
||||
}],
|
||||
CAR.KIA_NIRO_EV: [{
|
||||
127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 516: 8, 544: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1193: 8, 1225: 8, 1260: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1473: 8, 1507: 8, 1535: 8, 1990: 8, 1998: 8, 1996: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8, 2015: 8
|
||||
}],
|
||||
CAR.KIA_OPTIMA_H: [{
|
||||
68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1168: 7, 1173: 8, 1236: 2, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8
|
||||
},
|
||||
{
|
||||
68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576: 8, 593: 8, 688: 5, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 909: 8, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1168: 7, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1265: 4, 1268: 8, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1420: 8, 1425: 2, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8
|
||||
}],
|
||||
}
|
||||
|
||||
FW_VERSIONS = {
|
||||
CAR.HYUNDAI_AZERA_6TH_GEN: {
|
||||
(Ecu.fwdRadar, 0x7d0, None): [
|
||||
@@ -713,6 +676,7 @@ FW_VERSIONS = {
|
||||
b'\xf1\x00DEE MFC AT EUR LHD 1.00 1.00 99211-Q4000 191211',
|
||||
b'\xf1\x00DEE MFC AT EUR LHD 1.00 1.00 99211-Q4100 200706',
|
||||
b'\xf1\x00DEE MFC AT EUR LHD 1.00 1.03 95740-Q4000 180821',
|
||||
b'\xf1\x00DEE MFC AT KOR LHD 1.00 1.02 95740-Q4000 180705',
|
||||
b'\xf1\x00DEE MFC AT KOR LHD 1.00 1.03 95740-Q4000 180821',
|
||||
b'\xf1\x00DEE MFC AT USA LHD 1.00 1.00 99211-Q4000 191211',
|
||||
b'\xf1\x00DEE MFC AT USA LHD 1.00 1.01 99211-Q4500 210428',
|
||||
@@ -988,6 +952,7 @@ FW_VERSIONS = {
|
||||
b'\xf1\x00NE1 MFC AT CAN LHD 1.00 1.05 99211-GI010 220614',
|
||||
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.00 99211-GI100 230915',
|
||||
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.01 99211-GI010 211007',
|
||||
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.01 99211-GI100 240110',
|
||||
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.06 99211-GI000 210813',
|
||||
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.06 99211-GI010 230110',
|
||||
b'\xf1\x00NE1 MFC AT EUR RHD 1.00 1.01 99211-GI010 211007',
|
||||
@@ -1001,7 +966,6 @@ FW_VERSIONS = {
|
||||
b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.03 99211-GI010 220401',
|
||||
b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.05 99211-GI010 220614',
|
||||
b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.06 99211-GI010 230110',
|
||||
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.01 99211-GI100 240110',
|
||||
],
|
||||
},
|
||||
CAR.HYUNDAI_IONIQ_6: {
|
||||
|
||||
@@ -23,7 +23,7 @@ ALL_ECUS |= {ecu for config in FW_QUERY_CONFIGS.values() for ecu in config.extra
|
||||
|
||||
ALL_REQUESTS = {tuple(r.request) for config in FW_QUERY_CONFIGS.values() for r in config.requests}
|
||||
|
||||
MAX_EXAMPLES = int(os.environ.get('MAX_EXAMPLES', '40'))
|
||||
MAX_EXAMPLES = int(os.environ.get('MAX_EXAMPLES', '60'))
|
||||
|
||||
|
||||
def get_fuzzy_car_interface_args(draw: DrawType) -> dict:
|
||||
|
||||
@@ -160,6 +160,7 @@ FW_VERSIONS = {
|
||||
b'8821F0607200 ',
|
||||
b'8821F0608000 ',
|
||||
b'8821F0608200 ',
|
||||
b'8821F0608300 ',
|
||||
b'8821F0609000 ',
|
||||
b'8821F0609100 ',
|
||||
],
|
||||
@@ -205,6 +206,7 @@ FW_VERSIONS = {
|
||||
b'8821F0607200 ',
|
||||
b'8821F0608000 ',
|
||||
b'8821F0608200 ',
|
||||
b'8821F0608300 ',
|
||||
b'8821F0609000 ',
|
||||
b'8821F0609100 ',
|
||||
],
|
||||
@@ -799,6 +801,7 @@ FW_VERSIONS = {
|
||||
b'\x018821F6201400\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdCamera, 0x750, 0x6d): [
|
||||
b'\x028646F5303300\x00\x00\x00\x008646G3304000\x00\x00\x00\x00',
|
||||
b'\x028646F5303300\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
|
||||
b'\x028646F5303400\x00\x00\x00\x008646G3304000\x00\x00\x00\x00',
|
||||
],
|
||||
@@ -1490,6 +1493,7 @@ FW_VERSIONS = {
|
||||
b'\x01896630EA6300\x00\x00\x00\x00',
|
||||
b'\x018966348R1300\x00\x00\x00\x00',
|
||||
b'\x018966348R8500\x00\x00\x00\x00',
|
||||
b'\x018966348R9300\x00\x00\x00\x00',
|
||||
b'\x018966348W1300\x00\x00\x00\x00',
|
||||
b'\x018966348W2300\x00\x00\x00\x00',
|
||||
],
|
||||
|
||||
@@ -37,7 +37,7 @@ class KalmanParams:
|
||||
#Q = np.matrix([[10., 0.0], [0.0, 100.]])
|
||||
#R = 1e3
|
||||
#K = np.matrix([[ 0.05705578], [ 0.03073241]])
|
||||
dts = [dt * 0.01 for dt in range(1, 21)]
|
||||
dts = [i * 0.01 for i in range(1, 21)]
|
||||
K0 = [0.12287673, 0.14556536, 0.16522756, 0.18281627, 0.1988689, 0.21372394,
|
||||
0.22761098, 0.24069424, 0.253096, 0.26491023, 0.27621103, 0.28705801,
|
||||
0.29750003, 0.30757767, 0.31732515, 0.32677158, 0.33594201, 0.34485814,
|
||||
|
||||
@@ -23,12 +23,12 @@ def can_printer(bus, max_msg, addr, ascii_decode):
|
||||
if time.monotonic() - lp > 0.1:
|
||||
dd = chr(27) + "[2J"
|
||||
dd += f"{time.monotonic() - start:5.2f}\n"
|
||||
for addr in sorted(msgs.keys()):
|
||||
a = f"\"{msgs[addr][-1].decode('ascii', 'backslashreplace')}\"" if ascii_decode else ""
|
||||
x = binascii.hexlify(msgs[addr][-1]).decode('ascii')
|
||||
freq = len(msgs[addr]) / (time.monotonic() - start)
|
||||
if max_msg is None or addr < max_msg:
|
||||
dd += "%04X(%4d)(%6d)(%3dHz) %s %s\n" % (addr, addr, len(msgs[addr]), freq, x.ljust(20), a)
|
||||
for _addr in sorted(msgs.keys()):
|
||||
a = f"\"{msgs[_addr][-1].decode('ascii', 'backslashreplace')}\"" if ascii_decode else ""
|
||||
x = binascii.hexlify(msgs[_addr][-1]).decode('ascii')
|
||||
freq = len(msgs[_addr]) / (time.monotonic() - start)
|
||||
if max_msg is None or _addr < max_msg:
|
||||
dd += "%04X(%4d)(%6d)(%3dHz) %s %s\n" % (_addr, _addr, len(msgs[_addr]), freq, x.ljust(20), a)
|
||||
print(dd)
|
||||
lp = time.monotonic()
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ class ModelConstants:
|
||||
RYG_GREEN = 0.01165
|
||||
RYG_YELLOW = 0.06157
|
||||
|
||||
POLY_PATH_DEGREE = 4
|
||||
|
||||
# model outputs slices
|
||||
class Plan:
|
||||
POSITION = slice(0, 3)
|
||||
|
||||
@@ -41,17 +41,36 @@ def fill_xyvat(builder, t, x, y, v, a, x_std=None, y_std=None, v_std=None, a_std
|
||||
if a_std is not None:
|
||||
builder.aStd = a_std.tolist()
|
||||
|
||||
def fill_model_msg(msg: capnp._DynamicStructBuilder, net_output_data: dict[str, np.ndarray], publish_state: PublishState,
|
||||
def fill_xyz_poly(builder, degree, x, y, z):
|
||||
xyz = np.stack([x, y, z], axis=1)
|
||||
coeffs = np.polynomial.polynomial.polyfit(ModelConstants.T_IDXS, xyz, deg=degree)
|
||||
builder.xCoefficients = coeffs[:, 0].tolist()
|
||||
builder.yCoefficients = coeffs[:, 1].tolist()
|
||||
builder.zCoefficients = coeffs[:, 2].tolist()
|
||||
|
||||
def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._DynamicStructBuilder,
|
||||
net_output_data: dict[str, np.ndarray], publish_state: PublishState,
|
||||
vipc_frame_id: int, vipc_frame_id_extra: int, frame_id: int, frame_drop: float,
|
||||
timestamp_eof: int, model_execution_time: float, valid: bool) -> None:
|
||||
frame_age = frame_id - vipc_frame_id if frame_id > vipc_frame_id else 0
|
||||
msg.valid = valid
|
||||
frame_drop_perc = frame_drop * 100
|
||||
extended_msg.valid = valid
|
||||
base_msg.valid = valid
|
||||
|
||||
modelV2 = msg.modelV2
|
||||
driving_model_data = base_msg.drivingModelData
|
||||
|
||||
driving_model_data.frameId = vipc_frame_id
|
||||
driving_model_data.frameIdExtra = vipc_frame_id_extra
|
||||
driving_model_data.frameDropPerc = frame_drop_perc
|
||||
|
||||
action = driving_model_data.action
|
||||
action.desiredCurvature = float(net_output_data['desired_curvature'][0,0])
|
||||
|
||||
modelV2 = extended_msg.modelV2
|
||||
modelV2.frameId = vipc_frame_id
|
||||
modelV2.frameIdExtra = vipc_frame_id_extra
|
||||
modelV2.frameAge = frame_age
|
||||
modelV2.frameDropPerc = frame_drop * 100
|
||||
modelV2.frameDropPerc = frame_drop_perc
|
||||
modelV2.timestampEof = timestamp_eof
|
||||
modelV2.modelExecutionTime = model_execution_time
|
||||
|
||||
@@ -67,6 +86,10 @@ def fill_model_msg(msg: capnp._DynamicStructBuilder, net_output_data: dict[str,
|
||||
orientation_rate = modelV2.orientationRate
|
||||
fill_xyzt(orientation_rate, ModelConstants.T_IDXS, *net_output_data['plan'][0,:,Plan.ORIENTATION_RATE].T)
|
||||
|
||||
# poly path
|
||||
poly_path = driving_model_data.path
|
||||
fill_xyz_poly(poly_path, ModelConstants.POLY_PATH_DEGREE, *net_output_data['plan'][0,:,Plan.POSITION].T)
|
||||
|
||||
# lateral planning
|
||||
action = modelV2.action
|
||||
action.desiredCurvature = float(net_output_data['desired_curvature'][0,0])
|
||||
@@ -98,6 +121,12 @@ def fill_model_msg(msg: capnp._DynamicStructBuilder, net_output_data: dict[str,
|
||||
modelV2.laneLineStds = net_output_data['lane_lines_stds'][0,:,0,0].tolist()
|
||||
modelV2.laneLineProbs = net_output_data['lane_lines_prob'][0,1::2].tolist()
|
||||
|
||||
lane_line_meta = driving_model_data.laneLineMeta
|
||||
lane_line_meta.leftY = modelV2.laneLines[1].y[0]
|
||||
lane_line_meta.leftProb = modelV2.laneLineProbs[1]
|
||||
lane_line_meta.rightY = modelV2.laneLines[2].y[0]
|
||||
lane_line_meta.rightProb = modelV2.laneLineProbs[2]
|
||||
|
||||
# road edges
|
||||
modelV2.init('roadEdges', 2)
|
||||
for i in range(2):
|
||||
|
||||
@@ -149,7 +149,7 @@ def main(demo=False):
|
||||
cloudlog.warning(f"connected extra cam with buffer size: {vipc_client_extra.buffer_len} ({vipc_client_extra.width} x {vipc_client_extra.height})")
|
||||
|
||||
# messaging
|
||||
pm = PubMaster(["modelV2", "cameraOdometry"])
|
||||
pm = PubMaster(["modelV2", "drivingModelData", "cameraOdometry"])
|
||||
sm = SubMaster(["deviceState", "carState", "roadCameraState", "liveCalibration", "driverMonitoringState", "carControl"])
|
||||
|
||||
publish_state = PublishState()
|
||||
@@ -259,9 +259,10 @@ def main(demo=False):
|
||||
|
||||
if model_output is not None:
|
||||
modelv2_send = messaging.new_message('modelV2')
|
||||
drivingdata_send = messaging.new_message('drivingModelData')
|
||||
posenet_send = messaging.new_message('cameraOdometry')
|
||||
fill_model_msg(modelv2_send, model_output, publish_state, meta_main.frame_id, meta_extra.frame_id, frame_id, frame_drop_ratio,
|
||||
meta_main.timestamp_eof, model_execution_time, live_calib_seen)
|
||||
fill_model_msg(drivingdata_send, modelv2_send, model_output, publish_state, meta_main.frame_id, meta_extra.frame_id, frame_id,
|
||||
frame_drop_ratio, meta_main.timestamp_eof, model_execution_time, live_calib_seen)
|
||||
|
||||
desire_state = modelv2_send.modelV2.meta.desireState
|
||||
l_lane_change_prob = desire_state[log.Desire.laneChangeLeft]
|
||||
@@ -271,9 +272,12 @@ def main(demo=False):
|
||||
DH.update(sm['carState'], sm['carControl'].latActive, lane_change_prob)
|
||||
modelv2_send.modelV2.meta.laneChangeState = DH.lane_change_state
|
||||
modelv2_send.modelV2.meta.laneChangeDirection = DH.lane_change_direction
|
||||
drivingdata_send.drivingModelData.meta.laneChangeState = DH.lane_change_state
|
||||
drivingdata_send.drivingModelData.meta.laneChangeDirection = DH.lane_change_direction
|
||||
|
||||
fill_pose_msg(posenet_send, model_output, meta_main.frame_id, vipc_dropped_frames, meta_main.timestamp_eof, live_calib_seen)
|
||||
pm.send('modelV2', modelv2_send)
|
||||
pm.send('drivingModelData', drivingdata_send)
|
||||
pm.send('cameraOdometry', posenet_send)
|
||||
|
||||
last_vipc_frame_id = meta_main.frame_id
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b31b504bc0b440d3bc72967507a00eb4f112285626fbfb3135011500325ee6d6
|
||||
size 51452435
|
||||
oid sha256:39786068cae1ed8c0dc34ef80c281dfcc67ed18a50e06b90765c49bcfdbf7db4
|
||||
size 51453312
|
||||
|
||||
@@ -96,15 +96,16 @@ if __name__ == "__main__":
|
||||
all_logs = list(LogReader(BASE_URL + log_fn))
|
||||
cmp_log = []
|
||||
|
||||
# logs are ordered based on type: modelV2, driverStateV2
|
||||
# logs are ordered based on type: modelV2, drivingModelData, driverStateV2
|
||||
if not NO_MODEL:
|
||||
model_start_index = next(i for i, m in enumerate(all_logs) if m.which() in ("modelV2", "cameraOdometry"))
|
||||
cmp_log += all_logs[model_start_index:model_start_index + MAX_FRAMES*2]
|
||||
model_start_index = next(i for i, m in enumerate(all_logs) if m.which() in ("modelV2", "drivingModelData", "cameraOdometry"))
|
||||
cmp_log += all_logs[model_start_index:model_start_index + MAX_FRAMES*3]
|
||||
dmon_start_index = next(i for i, m in enumerate(all_logs) if m.which() == "driverStateV2")
|
||||
cmp_log += all_logs[dmon_start_index:dmon_start_index + MAX_FRAMES]
|
||||
|
||||
ignore = [
|
||||
'logMonoTime',
|
||||
'drivingModelData.frameDropPerc',
|
||||
'modelV2.frameDropPerc',
|
||||
'modelV2.modelExecutionTime',
|
||||
'driverStateV2.modelExecutionTime',
|
||||
|
||||
@@ -1 +1 @@
|
||||
73eb11111fb6407fa307c3f2bdd3331f2514c707
|
||||
01e8432830805165527d1dbadd5f009d19430b39
|
||||
@@ -565,7 +565,7 @@ CONFIGS = [
|
||||
ProcessConfig(
|
||||
proc_name="modeld",
|
||||
pubs=["deviceState", "roadCameraState", "wideRoadCameraState", "liveCalibration", "driverMonitoringState"],
|
||||
subs=["modelV2", "cameraOdometry"],
|
||||
subs=["modelV2", "drivingModelData", "cameraOdometry"],
|
||||
ignore=["logMonoTime", "modelV2.frameDropPerc", "modelV2.modelExecutionTime"],
|
||||
should_recv_callback=ModeldCameraSyncRcvCallback(),
|
||||
tolerance=NUMPY_TOLERANCE,
|
||||
|
||||
@@ -206,7 +206,7 @@ class TestOnroad:
|
||||
if f.name == "qcamera.ts":
|
||||
assert 2.15 < sz < 2.35
|
||||
elif f.name == "qlog":
|
||||
assert 0.7 < sz < 1.0
|
||||
assert 0.6 < sz < 1.0
|
||||
elif f.name == "rlog":
|
||||
assert 5 < sz < 50
|
||||
elif f.name.endswith('.hevc'):
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
test
|
||||
playsound
|
||||
test_sound
|
||||
test_translations
|
||||
ui_snapshot
|
||||
test_ui/report
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <QApplication>
|
||||
#include <QSoundEffect>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QTimer::singleShot(0, [=]{
|
||||
QSoundEffect s;
|
||||
const char *vol = getenv("VOLUME");
|
||||
s.setVolume(vol ? atof(vol) : 1.0);
|
||||
for (int i = 1; i < argc; i++) {
|
||||
QString fn = argv[i];
|
||||
qDebug() << "playing" << fn;
|
||||
|
||||
QEventLoop loop;
|
||||
s.setSource(QUrl::fromLocalFile(fn));
|
||||
QEventLoop::connect(&s, &QSoundEffect::loadedChanged, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
s.play();
|
||||
QEventLoop::connect(&s, &QSoundEffect::playingChanged, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
}
|
||||
QCoreApplication::exit();
|
||||
});
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -31,7 +31,7 @@ def main() -> NoReturn:
|
||||
|
||||
if len(record) > 2*1024*1024:
|
||||
print("WARNING: log too big to publish", len(record))
|
||||
print(print(record[:100]))
|
||||
print(record[:100])
|
||||
continue
|
||||
|
||||
# then we publish them
|
||||
|
||||
@@ -133,7 +133,7 @@ class TestBaseUpdate:
|
||||
class ParamsBaseUpdateTest(TestBaseUpdate):
|
||||
def _test_finalized_update(self, branch, version, agnos_version, release_notes):
|
||||
assert self.params.get("UpdaterNewDescription", encoding="utf-8").startswith(f"{version} / {branch}")
|
||||
assert self.params.get("UpdaterNewReleaseNotes", encoding="utf-8") == f"<p>{release_notes}</p>\n"
|
||||
assert self.params.get("UpdaterNewReleaseNotes", encoding="utf-8") == f"{release_notes}\n"
|
||||
super()._test_finalized_update(branch, version, agnos_version, release_notes)
|
||||
|
||||
def send_check_for_updates_signal(self, updated: ManagerProcess):
|
||||
|
||||
+11
-4
@@ -26,16 +26,23 @@ git clone --recurse-submodules https://github.com/commaai/openpilot.git
|
||||
|
||||
``` bash
|
||||
cd openpilot
|
||||
git lfs pull
|
||||
tools/ubuntu_setup.sh
|
||||
```
|
||||
|
||||
Activate a shell with the Python dependencies installed:
|
||||
**3. Git LFS**
|
||||
|
||||
``` bash
|
||||
poetry shell
|
||||
git lfs pull
|
||||
```
|
||||
|
||||
**3. Build openpilot**
|
||||
**4. Activate a python shell**
|
||||
|
||||
Activate a shell with the Python dependencies installed:
|
||||
``` bash
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
**5. Build openpilot**
|
||||
|
||||
``` bash
|
||||
scons -u -j$(nproc)
|
||||
|
||||
@@ -8,22 +8,34 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
ROOT=$DIR/../
|
||||
cd $ROOT
|
||||
|
||||
RC_FILE="${HOME}/.$(basename ${SHELL})rc"
|
||||
if [ "$(uname)" == "Darwin" ] && [ $SHELL == "/bin/bash" ]; then
|
||||
RC_FILE="$HOME/.bash_profile"
|
||||
fi
|
||||
# updating uv on macOS results in 403 sometimes
|
||||
function update_uv() {
|
||||
for i in $(seq 1 5);
|
||||
do
|
||||
if uv self update; then
|
||||
return 0
|
||||
else
|
||||
sleep 2
|
||||
fi
|
||||
done
|
||||
echo "Failed to update uv 5 times!"
|
||||
}
|
||||
|
||||
if ! command -v "poetry" > /dev/null 2>&1; then
|
||||
echo "installing poetry..."
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
POETRY_BIN='$HOME/.local/bin'
|
||||
ADD_PATH_CMD="export PATH=\"$POETRY_BIN:\$PATH\""
|
||||
if ! command -v "uv" > /dev/null 2>&1; then
|
||||
echo "installing uv..."
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
UV_BIN='$HOME/.cargo/env'
|
||||
ADD_PATH_CMD=". \"$UV_BIN\""
|
||||
eval $ADD_PATH_CMD
|
||||
printf "\n#poetry path\n$ADD_PATH_CMD\n" >> $RC_FILE
|
||||
fi
|
||||
|
||||
poetry config virtualenvs.prefer-active-python true --local
|
||||
poetry config virtualenvs.in-project true --local
|
||||
echo "updating uv..."
|
||||
update_uv
|
||||
|
||||
# TODO: remove --no-cache once this is fixed: https://github.com/astral-sh/uv/issues/4378
|
||||
echo "installing python packages..."
|
||||
uv --no-cache sync --all-extras
|
||||
source .venv/bin/activate
|
||||
|
||||
echo "PYTHONPATH=${PWD}" > $ROOT/.env
|
||||
if [[ "$(uname)" == 'Darwin' ]]; then
|
||||
@@ -32,15 +44,8 @@ if [[ "$(uname)" == 'Darwin' ]]; then
|
||||
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> $ROOT/.env
|
||||
fi
|
||||
|
||||
poetry self add poetry-dotenv-plugin@^0.1.0
|
||||
|
||||
echo "installing python packages..."
|
||||
poetry install --no-cache --no-root
|
||||
|
||||
[ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run"
|
||||
|
||||
if [ "$(uname)" != "Darwin" ] && [ -e "$ROOT/.git" ]; then
|
||||
echo "pre-commit hooks install..."
|
||||
$RUN pre-commit install
|
||||
$RUN git submodule foreach pre-commit install
|
||||
pre-commit install
|
||||
git submodule foreach pre-commit install
|
||||
fi
|
||||
|
||||
@@ -27,8 +27,14 @@ def noop(segment: LogIterable):
|
||||
@contextlib.contextmanager
|
||||
def setup_source_scenario(mocker, is_internal=False):
|
||||
internal_source_mock = mocker.patch("openpilot.tools.lib.logreader.internal_source")
|
||||
internal_source_mock.__name__ = internal_source_mock._mock_name
|
||||
|
||||
openpilotci_source_mock = mocker.patch("openpilot.tools.lib.logreader.openpilotci_source")
|
||||
openpilotci_source_mock.__name__ = openpilotci_source_mock._mock_name
|
||||
|
||||
comma_api_source_mock = mocker.patch("openpilot.tools.lib.logreader.comma_api_source")
|
||||
comma_api_source_mock.__name__ = comma_api_source_mock._mock_name
|
||||
|
||||
if is_internal:
|
||||
internal_source_mock.return_value = [QLOG_FILE]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user