mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-08 18:24:20 +08:00
Compare commits
1 Commits
lt
...
archive/ce
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4259145fb |
4
.devcontainer/.gitignore
vendored
4
.devcontainer/.gitignore
vendored
@@ -1,3 +1 @@
|
||||
.Xauthority
|
||||
.env
|
||||
.host/
|
||||
.Xauthority
|
||||
@@ -1,18 +1,6 @@
|
||||
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 python3 -m ensurepip --upgrade
|
||||
RUN pip3 install ipython jupyter jupyterlab
|
||||
|
||||
RUN cd /tmp && \
|
||||
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
|
||||
curl -L -o virtualgl.deb "https://github.com/VirtualGL/virtualgl/releases/download/3.1.1/virtualgl_3.1.1_$ARCH.deb" && \
|
||||
dpkg -i virtualgl.deb
|
||||
|
||||
RUN usermod -aG video batman
|
||||
|
||||
USER batman
|
||||
|
||||
RUN cd $HOME && \
|
||||
curl -O https://raw.githubusercontent.com/commaai/agnos-builder/master/userspace/home/.tmux.conf && \
|
||||
curl -O https://raw.githubusercontent.com/commaai/agnos-builder/master/userspace/home/.vimrc
|
||||
# remove gitconfig if exists, since its gonna be replaced by host one
|
||||
RUN rm -f /root/.gitconfig
|
||||
RUN apt update && apt install -y vim net-tools usbutils htop ripgrep
|
||||
RUN pip install ipython jupyter jupyterlab
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TARGET_USER=batman
|
||||
source .devcontainer/.host/.env
|
||||
|
||||
# override display flag for mac hosts
|
||||
if [[ $HOST_OS == darwin ]]; then
|
||||
echo "Setting up DISPLAY override for macOS..."
|
||||
cat <<EOF >> /home/$TARGET_USER/.bashrc
|
||||
source .devcontainer/.host/.env
|
||||
if [ -n "\$HOST_DISPLAY" ]; then
|
||||
DISPLAY_NUM=\$(echo "\$HOST_DISPLAY" | awk -F: '{print \$NF}')
|
||||
export DISPLAY=host.docker.internal:\$DISPLAY_NUM
|
||||
fi
|
||||
EOF
|
||||
fi
|
||||
|
||||
# setup virtualgl for mac hosts
|
||||
if [[ $HOST_OS == darwin ]]; then
|
||||
echo "Setting up virtualgl for macOS..."
|
||||
cat <<EOF >> /home/$TARGET_USER/.bashrc
|
||||
if [ -n "\$HOST_DISPLAY" ]; then
|
||||
export VGL_PORT=10000
|
||||
export VGL_CLIENT=host.docker.internal
|
||||
export VGL_COMPRESS=rgb
|
||||
export VGL_DISPLAY=:99
|
||||
export VGL_FPS=60
|
||||
# prevent vglrun from running exec
|
||||
alias exec=:; source vglrun :; unalias exec
|
||||
fi
|
||||
EOF
|
||||
fi
|
||||
|
||||
# These lines are temporary, to remain backwards compatible with old devcontainers
|
||||
# that were running as root and therefore had their caches written as root
|
||||
sudo chown -R $TARGET_USER: /tmp/scons_cache
|
||||
sudo chown -R $TARGET_USER: /tmp/comma_download_cache
|
||||
sudo chown -R $TARGET_USER: /home/batman/.comma
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source .devcontainer/.host/.env
|
||||
|
||||
# setup safe directories for submodules
|
||||
SUBMODULE_DIRS=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }')
|
||||
for DIR in $SUBMODULE_DIRS; do
|
||||
git config --global --add safe.directory "$PWD/$DIR"
|
||||
done
|
||||
|
||||
# virtual display for virtualgl
|
||||
if [[ "$HOST_OS" == "darwin" ]] && [[ -n "$HOST_DISPLAY" ]]; then
|
||||
echo "Starting virtual display at :99 ..."
|
||||
tmux new-session -d -s fakedisplay Xvfb :99 -screen 0 1920x1080x24
|
||||
fi
|
||||
37
.devcontainer/devcontainer.json
Normal file → Executable file
37
.devcontainer/devcontainer.json
Normal file → Executable file
@@ -3,39 +3,23 @@
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"postCreateCommand": ".devcontainer/container_post_create.sh",
|
||||
"postStartCommand": ".devcontainer/container_post_start.sh",
|
||||
"initializeCommand": [".devcontainer/host_setup"],
|
||||
"postCreateCommand": "bash -c 'if [[ $DISPLAY == *xquartz* ]]; then echo \"export DISPLAY=host.docker.internal:0\" >> /root/.bashrc; fi'",
|
||||
"postStartCommand": "git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | xargs -I{} git config --global --add safe.directory \"$PWD/{}\"",
|
||||
"initializeCommand": ".devcontainer/setup_host.sh",
|
||||
"privileged": true,
|
||||
"containerEnv": {
|
||||
"DISPLAY": "${localEnv:DISPLAY}",
|
||||
"PYTHONPATH": "${containerWorkspaceFolder}",
|
||||
"TERM": "xterm-256color",
|
||||
"force_color_prompt": "1"
|
||||
},
|
||||
"runArgs": [
|
||||
"--volume=/dev:/dev",
|
||||
"--volume=/tmp/.X11-unix:/tmp/.X11-unix",
|
||||
"--volume=${localWorkspaceFolder}/.devcontainer/.host/.Xauthority:/home/batman/.Xauthority",
|
||||
"--volume=${localEnv:HOME}/.comma:/home/batman/.comma",
|
||||
"--volume=${localEnv:HOME}/.azure:/home/batman/.azure",
|
||||
"--volume=${localWorkspaceFolder}/.devcontainer/.Xauthority:/root/.Xauthority",
|
||||
"--volume=${localEnv:HOME}/.comma:/root/.comma",
|
||||
"--volume=/tmp/comma_download_cache:/tmp/comma_download_cache",
|
||||
"--shm-size=1G",
|
||||
"--add-host=host.docker.internal:host-gateway", // required to use host.docker.internal on linux
|
||||
"--publish=0.0.0.0:8070-8079:8070-8079" // body ZMQ services
|
||||
"--volume=/tmp/devcontainer_scons_cache:/tmp/scons_cache",
|
||||
"--shm-size=1G"
|
||||
],
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/common-utils:2": {
|
||||
"installZsh": false,
|
||||
"installOhMyZsh": false,
|
||||
"upgradePackages": false,
|
||||
"username": "batman"
|
||||
},
|
||||
"ghcr.io/devcontainers-contrib/features/gh-cli:1": {},
|
||||
"ghcr.io/devcontainers/features/azure-cli:1": {}
|
||||
},
|
||||
"containerUser": "batman",
|
||||
"remoteUser": "batman",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
@@ -46,8 +30,5 @@
|
||||
"lharri73.dbc"
|
||||
]
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"type=volume,source=scons_cache,target=/tmp/scons_cache"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# pull base image
|
||||
if [[ -z $USE_LOCAL_IMAGE ]]; then
|
||||
echo "Updating openpilot_base image if needed..."
|
||||
docker pull ghcr.io/commaai/openpilot-base:latest
|
||||
fi
|
||||
|
||||
# setup .host dir
|
||||
mkdir -p .devcontainer/.host
|
||||
|
||||
# setup links to Xauthority
|
||||
XAUTHORITY_LINK=".devcontainer/.host/.Xauthority"
|
||||
rm -f $XAUTHORITY_LINK
|
||||
if [[ -z $XAUTHORITY ]]; then
|
||||
echo "XAUTHORITY not set. Fallback to ~/.Xauthority ..."
|
||||
if ! [[ -f $HOME/.Xauthority ]]; then
|
||||
echo "~/.XAuthority file does not exist. GUI tools may not work properly."
|
||||
touch $XAUTHORITY_LINK # dummy file to satisfy container volume mount
|
||||
else
|
||||
ln -sf $HOME/.Xauthority $XAUTHORITY_LINK
|
||||
fi
|
||||
else
|
||||
ln -sf $XAUTHORITY $XAUTHORITY_LINK
|
||||
fi
|
||||
|
||||
# setup host env file
|
||||
HOST_INFO_FILE=".devcontainer/.host/.env"
|
||||
SYSTEM=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
echo "HOST_OS=\"$SYSTEM\"" > $HOST_INFO_FILE
|
||||
echo "HOST_DISPLAY=\"$DISPLAY\"" >> $HOST_INFO_FILE
|
||||
|
||||
# run virtualgl if macos
|
||||
if [[ $SYSTEM == "darwin" ]]; then
|
||||
echo
|
||||
if [[ -f /opt/VirtualGL/bin/vglclient ]]; then
|
||||
echo "Starting VirtualGL client at port 10000..."
|
||||
VGL_LOG_FILE=".devcontainer/.host/.vgl/vglclient.log"
|
||||
mkdir -p "$(dirname $VGL_LOG_FILE)"
|
||||
/opt/VirtualGL/bin/vglclient -l "$VGL_LOG_FILE" -display "$DISPLAY" -port 10000 -detach
|
||||
else
|
||||
echo "VirtualGL not found. GUI tools may not work properly. Some GUI tools require OpenGL to work properly. To use them with XQuartz on mac, VirtualGL needs to be installed. To install it run:"
|
||||
echo
|
||||
echo " brew install --cask virtualgl"
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
@@ -1,10 +0,0 @@
|
||||
:: pull base image
|
||||
IF NOT DEFINED USE_LOCAL_IMAGE ^
|
||||
echo "Updating openpilot_base image if needed..." && ^
|
||||
docker pull ghcr.io/commaai/openpilot-base:latest
|
||||
|
||||
:: setup .host dir
|
||||
mkdir .devcontainer\.host
|
||||
|
||||
:: setup host env file
|
||||
echo "" > .devcontainer\.host\.env
|
||||
16
.devcontainer/setup_host.sh
Executable file
16
.devcontainer/setup_host.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# setup links to Xauthority
|
||||
XAUTHORITY_LINK=".devcontainer/.Xauthority"
|
||||
rm -f $XAUTHORITY_LINK
|
||||
if [[ -z $XAUTHORITY ]]; then
|
||||
echo "XAUTHORITY not set. Fallback to ~/.Xauthority ..."
|
||||
if ! [[ -f $HOME/.Xauthority ]]; then
|
||||
echo "~/.XAuthority file does not exist. GUI tools may not work properly."
|
||||
touch $XAUTHORITY_LINK # dummy file to satisfy container volume mount
|
||||
else
|
||||
ln -sf $HOME/.Xauthority $XAUTHORITY_LINK
|
||||
fi
|
||||
else
|
||||
ln -sf $XAUTHORITY $XAUTHORITY_LINK
|
||||
fi
|
||||
3
.dir-locals.el
Normal file
3
.dir-locals.el
Normal file
@@ -0,0 +1,3 @@
|
||||
((c++-mode (flycheck-gcc-language-standard . "c++11")
|
||||
(flycheck-clang-language-standard . "c++11")
|
||||
))
|
||||
@@ -28,8 +28,10 @@ chffr/app2
|
||||
chffr/backend/env
|
||||
selfdrive/nav
|
||||
selfdrive/baseui
|
||||
chffr/lib/vidindex/vidindex
|
||||
selfdrive/test/simulator2
|
||||
**/cache_data
|
||||
xx/chffr/lib/vidindex/vidindex
|
||||
xx/plus
|
||||
xx/community
|
||||
xx/projects
|
||||
|
||||
21
.gitattributes
vendored
21
.gitattributes
vendored
@@ -1,24 +1,3 @@
|
||||
* text=auto
|
||||
|
||||
# to move existing files into LFS:
|
||||
# git add --renormalize .
|
||||
*.dlc filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.svg filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
selfdrive/car/tests/test_models_segs.txt filter=lfs diff=lfs merge=lfs -text
|
||||
system/hardware/tici/updater filter=lfs diff=lfs merge=lfs -text
|
||||
selfdrive/ui/qt/spinner_larch64 filter=lfs diff=lfs merge=lfs -text
|
||||
selfdrive/ui/qt/text_larch64 filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/**/*.a filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/**/*.so filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/**/*.so.* filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/**/*.dylib filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/acados/*/t_renderer filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/qt5/larch64/bin/lrelease filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/qt5/larch64/bin/lupdate filter=lfs diff=lfs merge=lfs -text
|
||||
third_party/catch2/include/catch2/catch.hpp filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
12
.github/FUNDING.yml
vendored
12
.github/FUNDING.yml
vendored
@@ -1,12 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [sunnyhaibin] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: sunnyhaibin # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: ['https://paypal.me/sunnyhaibin0850'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
2
.github/ISSUE_TEMPLATE/pc_bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/pc_bug_report.yml
vendored
@@ -24,7 +24,7 @@ body:
|
||||
id: os-version
|
||||
attributes:
|
||||
label: OS Version
|
||||
placeholder: Ubuntu 24.04
|
||||
placeholder: Ubuntu 20.04
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE/car_port.md
vendored
2
.github/PULL_REQUEST_TEMPLATE/car_port.md
vendored
@@ -8,7 +8,7 @@ assignees: ''
|
||||
|
||||
**Checklist**
|
||||
|
||||
- [ ] added entry to CAR in selfdrive/car/*/values.py and ran `selfdrive/car/docs.py` to generate new docs
|
||||
- [ ] added to README
|
||||
- [ ] test route added to [routes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/car/tests/routes.py)
|
||||
- [ ] route with openpilot:
|
||||
- [ ] route with stock system:
|
||||
|
||||
6
.github/PULL_REQUEST_TEMPLATE/fingerprint.md
vendored
6
.github/PULL_REQUEST_TEMPLATE/fingerprint.md
vendored
@@ -6,8 +6,6 @@ labels: 'fingerprint'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Car**
|
||||
Which car (make, model, year) this fingerprint is for
|
||||
Discord username: []
|
||||
|
||||
**Route**
|
||||
A route with the fingerprint
|
||||
Route: []
|
||||
|
||||
3
.github/PULL_REQUEST_TEMPLATE/tuning.md
vendored
3
.github/PULL_REQUEST_TEMPLATE/tuning.md
vendored
@@ -28,4 +28,5 @@ Longitudinal:
|
||||
Lateral:
|
||||
* Straight driving at ~25, ~45 and ~65mph
|
||||
* Turns driving at ~25, ~45 and ~65mph
|
||||
-->
|
||||
|
||||
-->
|
||||
|
||||
30
.github/build.py
vendored
30
.github/build.py
vendored
@@ -1,30 +0,0 @@
|
||||
import pathlib
|
||||
|
||||
GITHUB_FOLDER = pathlib.Path(__file__).parent
|
||||
|
||||
PULL_REQUEST_TEMPLATES = (GITHUB_FOLDER / "PULL_REQUEST_TEMPLATE")
|
||||
|
||||
order = ["fingerprint", "car_bugfix", "bugfix", "car_port", "refactor"]
|
||||
|
||||
def create_pull_request_template():
|
||||
with open(GITHUB_FOLDER / "pull_request_template.md", "w") as f:
|
||||
f.write("<!-- Please copy and paste the relevant template -->\n\n")
|
||||
|
||||
for t in order:
|
||||
template = PULL_REQUEST_TEMPLATES / f"{t}.md"
|
||||
text = template.read_text()
|
||||
|
||||
# Remove metadata for GitHub
|
||||
start = text.find("---")
|
||||
end = text.find("---", start+1)
|
||||
text = text[end + 4:]
|
||||
|
||||
# Remove comments
|
||||
text = text.replace("<!-- ", "").replace("-->", "")
|
||||
|
||||
f.write(f"<!--- ***** Template: {template.stem.replace('_', ' ').title()} *****\n")
|
||||
f.write(text)
|
||||
f.write("\n\n")
|
||||
f.write("-->\n\n")
|
||||
|
||||
create_pull_request_template()
|
||||
79
.github/labeler.yaml
vendored
79
.github/labeler.yaml
vendored
@@ -1,79 +0,0 @@
|
||||
CI / testing:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: "{.github/**,**/test_*,Jenkinsfile}"
|
||||
|
||||
car:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/**'
|
||||
|
||||
body:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/body/*'
|
||||
|
||||
chrysler:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/chrysler/*'
|
||||
|
||||
ford:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/ford/*'
|
||||
|
||||
gm:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/gm/*'
|
||||
|
||||
honda:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/honda/*'
|
||||
|
||||
hyundai:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/hyundai/*'
|
||||
|
||||
mazda:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/mazda/*'
|
||||
|
||||
nissan:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/nissan/*'
|
||||
|
||||
subaru:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/subaru/*'
|
||||
|
||||
tesla:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/tesla/*'
|
||||
|
||||
toyota:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/toyota/*'
|
||||
|
||||
volkswagen:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/volkswagen/*'
|
||||
|
||||
fingerprint:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/car/*/fingerprints.py'
|
||||
|
||||
simulation:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'tools/sim/**'
|
||||
|
||||
ui:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/ui/**'
|
||||
|
||||
tools:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'tools/**'
|
||||
|
||||
multilanguage:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: 'selfdrive/ui/translations/**'
|
||||
|
||||
research:
|
||||
- changed-files:
|
||||
- any-glob-to-all-files: "{selfdrive/modeld/models/**,selfdrive/test/process_replay/model_replay_ref_commit}"
|
||||
60
.github/pull_request_template.md
vendored
60
.github/pull_request_template.md
vendored
@@ -1,68 +1,38 @@
|
||||
<!-- Please copy and paste the relevant template -->
|
||||
|
||||
<!--- ***** Template: Fingerprint *****
|
||||
<!--- ***** Template: Car bug fix *****
|
||||
|
||||
**Car**
|
||||
Which car (make, model, year) this fingerprint is for
|
||||
**Description** [](A description of the bug and the fix. Also link any relevant issues.)
|
||||
|
||||
**Verification** [](Explain how you tested this bug fix.)
|
||||
|
||||
**Route**
|
||||
A route with the fingerprint
|
||||
|
||||
-->
|
||||
|
||||
<!--- ***** Template: Car Bugfix *****
|
||||
|
||||
**Description**
|
||||
|
||||
A description of the bug and the fix. Also link the issue if it exists.
|
||||
|
||||
**Verification**
|
||||
|
||||
Explain how you tested this bug fix.
|
||||
|
||||
**Route**
|
||||
|
||||
Route: [a route with the bug fix]
|
||||
|
||||
-->
|
||||
|
||||
<!--- ***** Template: Bug fix *****
|
||||
|
||||
**Description** [](A description of the bug and the fix. Also link any relevant issues.)
|
||||
|
||||
**Verification** [](Explain how you tested this bug fix.)
|
||||
|
||||
-->
|
||||
|
||||
<!--- ***** Template: Bugfix *****
|
||||
|
||||
**Description**
|
||||
|
||||
A description of the bug and the fix. Also link the issue if it exists.
|
||||
|
||||
**Verification**
|
||||
|
||||
Explain how you tested this bug fix.
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!--- ***** Template: Car Port *****
|
||||
<!--- ***** Template: Car port *****
|
||||
|
||||
**Checklist**
|
||||
|
||||
- [ ] added entry to CAR in selfdrive/car/*/values.py and ran `selfdrive/car/docs.py` to generate new docs
|
||||
- [ ] added entry to CarInfo in selfdrive/car/*/values.py and ran `selfdrive/car/docs.py` to generate new docs
|
||||
- [ ] test route added to [routes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/car/tests/routes.py)
|
||||
- [ ] route with openpilot:
|
||||
- [ ] route with stock system:
|
||||
- [ ] car harness used (if comma doesn't sell it, put N/A):
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!--- ***** Template: Refactor *****
|
||||
|
||||
**Description**
|
||||
|
||||
A description of the refactor, including the goals it accomplishes.
|
||||
|
||||
**Verification**
|
||||
|
||||
Explain how you tested the refactor for regressions.
|
||||
**Description** [](A description of the refactor, including the goals it accomplishes.)
|
||||
|
||||
**Verification** [](Explain how you tested the refactor for regressions.)
|
||||
|
||||
-->
|
||||
|
||||
|
||||
49
.github/workflows/auto-cache/action.yaml
vendored
49
.github/workflows/auto-cache/action.yaml
vendored
@@ -1,49 +0,0 @@
|
||||
name: 'automatically cache based on current runner'
|
||||
|
||||
inputs:
|
||||
path:
|
||||
description: 'path to cache'
|
||||
required: true
|
||||
key:
|
||||
description: 'key'
|
||||
required: true
|
||||
restore-keys:
|
||||
description: 'restore-keys'
|
||||
required: true
|
||||
save:
|
||||
description: 'whether to save the cache'
|
||||
default: 'false'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: setup namespace cache
|
||||
if: ${{ contains(runner.name, 'nsc') }}
|
||||
uses: namespacelabs/nscloud-cache-action@v1
|
||||
with:
|
||||
path: ${{ inputs.path }}
|
||||
|
||||
- name: setup github cache
|
||||
if: ${{ !contains(runner.name, 'nsc') && inputs.save != 'false' }}
|
||||
uses: 'actions/cache@v4'
|
||||
with:
|
||||
path: ${{ inputs.path }}
|
||||
key: ${{ inputs.key }}
|
||||
restore-keys: ${{ inputs.restore-keys }}
|
||||
|
||||
- name: setup github cache
|
||||
if: ${{ !contains(runner.name, 'nsc') && inputs.save == 'false' }}
|
||||
uses: 'actions/cache/restore@v4'
|
||||
with:
|
||||
path: ${{ inputs.path }}
|
||||
key: ${{ inputs.key }}
|
||||
restore-keys: ${{ inputs.restore-keys }}
|
||||
|
||||
# make the directory manually in case we didn't get a hit, so it doesn't fail on future steps
|
||||
- id: scons-cache-setup
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ inputs.path }}
|
||||
sudo chmod -R 777 ${{ inputs.path }}
|
||||
sudo chown -R $USER ${{ inputs.path }}
|
||||
53
.github/workflows/auto_pr_review.yaml
vendored
53
.github/workflows/auto_pr_review.yaml
vendored
@@ -1,53 +0,0 @@
|
||||
name: "PR review"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize, edited, edited]
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
name: review
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
# Label PRs
|
||||
- uses: actions/labeler@v5.0.0
|
||||
with:
|
||||
dot: true
|
||||
configuration-path: .github/labeler.yaml
|
||||
|
||||
# Check PR target branch
|
||||
- name: check branch
|
||||
uses: Vankka/pr-target-branch-action@def32ec9d93514138d6ac0132ee62e120a72aed5
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
target: /^(?!master$).*/
|
||||
exclude: /commaai:.*/
|
||||
change-to: ${{ github.base_ref }}
|
||||
already-exists-action: close_this
|
||||
already-exists-comment: "Your PR should be made against the `master` branch"
|
||||
|
||||
# Welcome comment
|
||||
- name: comment
|
||||
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6
|
||||
if: github.event.pull_request.head.repo.full_name != 'commaai/openpilot'
|
||||
with:
|
||||
message: |
|
||||
<!-- _(run_id **${{ github.run_id }}**)_ -->
|
||||
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
|
||||
* Convert your PR to a draft unless it's ready to review
|
||||
* Read the [contributing docs](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md)
|
||||
* Before marking as "ready for review", ensure:
|
||||
* the goal is clearly stated in the description
|
||||
* all the tests are passing
|
||||
* the change is [something we merge](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md#what-gets-merged)
|
||||
* include a route or your device' dongle ID if relevant
|
||||
comment_tag: run_id
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
12
.github/workflows/badges.yaml
vendored
12
.github/workflows/badges.yaml
vendored
@@ -7,26 +7,22 @@ on:
|
||||
env:
|
||||
BASE_IMAGE: openpilot-base
|
||||
DOCKER_REGISTRY: ghcr.io/commaai
|
||||
RUN: docker run --shm-size 2G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $DOCKER_REGISTRY/$BASE_IMAGE:latest /bin/bash -c
|
||||
RUN: docker run --shm-size 1G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $DOCKER_REGISTRY/$BASE_IMAGE:latest /bin/sh -c
|
||||
|
||||
jobs:
|
||||
badges:
|
||||
name: create badges
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Push badges
|
||||
run: |
|
||||
${{ env.RUN }} "scons -j$(nproc) && python selfdrive/ui/translations/create_badges.py"
|
||||
|
||||
rm .gitattributes
|
||||
|
||||
git checkout --orphan badges
|
||||
git rm -rf --cached .
|
||||
git config user.email "badge-researcher@comma.ai"
|
||||
|
||||
101
.github/workflows/ci_weekly_report.yaml
vendored
101
.github/workflows/ci_weekly_report.yaml
vendored
@@ -1,101 +0,0 @@
|
||||
name: weekly CI test report
|
||||
on:
|
||||
schedule:
|
||||
- cron: '37 9 * * 1' # 9:37AM UTC -> 2:37AM PST every monday
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ci_runs:
|
||||
description: 'The amount of runs to trigger in CI test report'
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CI_RUNS: ${{ github.event.inputs.ci_runs || '50' }}
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
ci_runs: ${{ steps.ci_runs_setup.outputs.matrix }}
|
||||
steps:
|
||||
- id: ci_runs_setup
|
||||
name: CI_RUNS=${{ env.CI_RUNS }}
|
||||
run: |
|
||||
matrix=$(python3 -c "import json; print(json.dumps({ 'run_number' : list(range(${{ env.CI_RUNS }})) }))")
|
||||
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
||||
|
||||
ci_matrix_run:
|
||||
needs: [ setup ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJSON(needs.setup.outputs.ci_runs)}}
|
||||
uses: commaai/openpilot/.github/workflows/ci_weekly_run.yaml@master
|
||||
with:
|
||||
run_number: ${{ matrix.run_number }}
|
||||
|
||||
report:
|
||||
needs: [ci_matrix_run]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: Get job results
|
||||
uses: actions/github-script@v7
|
||||
id: get-job-results
|
||||
with:
|
||||
script: |
|
||||
const jobs = await github
|
||||
.paginate("GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt}/jobs", {
|
||||
owner: "commaai",
|
||||
repo: "${{ github.event.repository.name }}",
|
||||
run_id: "${{ github.run_id }}",
|
||||
attempt: "${{ github.run_attempt }}",
|
||||
})
|
||||
var report = {}
|
||||
jobs.slice(1, jobs.length-1).forEach(job => {
|
||||
if (job.conclusion === "skipped") return;
|
||||
const jobName = job.name.split(" / ")[2];
|
||||
const runRegex = /\((.*?)\)/;
|
||||
const run = job.name.match(runRegex)[1];
|
||||
report[jobName] = report[jobName] || { successes: [], failures: [], cancelled: [] };
|
||||
switch (job.conclusion) {
|
||||
case "success":
|
||||
report[jobName].successes.push({ "run_number": run, "link": job.html_url}); break;
|
||||
case "failure":
|
||||
report[jobName].failures.push({ "run_number": run, "link": job.html_url }); break;
|
||||
case "cancelled":
|
||||
report[jobName].cancelled.push({ "run_number": run, "link": job.html_url }); break;
|
||||
}
|
||||
});
|
||||
return JSON.stringify({"jobs": report});
|
||||
|
||||
- name: Add job results to summary
|
||||
env:
|
||||
JOB_RESULTS: ${{ fromJSON(steps.get-job-results.outputs.result) }}
|
||||
run: |
|
||||
cat <<EOF >> template.html
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Job</th>
|
||||
<th>✅ Passing</th>
|
||||
<th>❌ Failure Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key in jobs.keys() %}<tr>
|
||||
<td>{% for i in range(5) %}{% if i+1 <= (5 * jobs[key]["successes"]|length // ${{ env.CI_RUNS }}) %}🟩{% else %}🟥{% endif %}{% endfor%}</td>
|
||||
<td>{{ key }}</td>
|
||||
<td>{{ 100 * jobs[key]["successes"]|length // ${{ env.CI_RUNS }} }}%</td>
|
||||
<td>{% if jobs[key]["failures"]|length > 0 %}<details>{% for failure in jobs[key]["failures"] %}<a href="{{ failure['link'] }}">Log for run #{{ failure['run_number'] }}</a><br>{% endfor %}</details>{% else %}{% endif %}</td>
|
||||
</td>
|
||||
</tr>{% endfor %}
|
||||
</table>
|
||||
EOF
|
||||
|
||||
pip install jinja2-cli
|
||||
echo $JOB_RESULTS | jinja2 template.html > report.html
|
||||
echo "# CI Test Report - ${{ env.CI_RUNS }} Runs" >> $GITHUB_STEP_SUMMARY
|
||||
cat report.html >> $GITHUB_STEP_SUMMARY
|
||||
21
.github/workflows/ci_weekly_run.yaml
vendored
21
.github/workflows/ci_weekly_run.yaml
vendored
@@ -1,21 +0,0 @@
|
||||
name: weekly CI test run
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
run_number:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: ci-run-${{ inputs.run_number }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
selfdrive_tests:
|
||||
uses: commaai/openpilot/.github/workflows/selfdrive_tests.yaml@master
|
||||
with:
|
||||
run_number: ${{ inputs.run_number }}
|
||||
tools_tests:
|
||||
uses: commaai/openpilot/.github/workflows/tools_tests.yaml@master
|
||||
with:
|
||||
run_number: ${{ inputs.run_number }}
|
||||
97
.github/workflows/codeql.yml
vendored
97
.github/workflows/codeql.yml
vendored
@@ -1,97 +0,0 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "*-c3", "master*" ]
|
||||
pull_request:
|
||||
branches: [ "master", "*-c3", "master*" ]
|
||||
schedule:
|
||||
- cron: '39 7 * * 2'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: c-cpp
|
||||
build-mode: autobuild
|
||||
- language: javascript-typescript
|
||||
build-mode: none
|
||||
- language: python
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
21
.github/workflows/compile-openpilot/action.yaml
vendored
21
.github/workflows/compile-openpilot/action.yaml
vendored
@@ -1,21 +0,0 @@
|
||||
name: 'compile openpilot'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- shell: bash
|
||||
name: Build openpilot with all flags
|
||||
run: |
|
||||
${{ env.RUN }} "scons -j$(nproc)"
|
||||
${{ env.RUN }} "release/check-dirty.sh"
|
||||
- shell: bash
|
||||
name: Cleanup scons cache and rebuild
|
||||
run: |
|
||||
${{ env.RUN }} "rm -rf /tmp/scons_cache/* && \
|
||||
scons -j$(nproc) --cache-populate"
|
||||
- name: Save scons cache
|
||||
uses: actions/cache/save@v4
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
path: .ci_cache/scons_cache
|
||||
key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
64
.github/workflows/docs.yaml
vendored
64
.github/workflows/docs.yaml
vendored
@@ -1,64 +0,0 @@
|
||||
name: docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
workflow_call:
|
||||
inputs:
|
||||
run_number:
|
||||
default: '1'
|
||||
required: true
|
||||
type: string
|
||||
concurrency:
|
||||
group: docs-tests-ci-run-${{ inputs.run_number }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
name: build docs
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
# Build
|
||||
- name: Build docs
|
||||
run: |
|
||||
# TODO: can we install just the "docs" dependency group without the normal deps?
|
||||
pip install mkdocs
|
||||
mkdocs build
|
||||
|
||||
# Push to docs.comma.ai
|
||||
- uses: actions/checkout@v4
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
|
||||
with:
|
||||
path: openpilot-docs
|
||||
ssh-key: ${{ secrets.OPENPILOT_DOCS_KEY }}
|
||||
repository: commaai/openpilot-docs
|
||||
- name: Push
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
|
||||
run: |
|
||||
set -x
|
||||
|
||||
source release/identity.sh
|
||||
|
||||
cd openpilot-docs
|
||||
git checkout --orphan tmp
|
||||
git rm -rf .
|
||||
|
||||
# copy over docs
|
||||
cp -r ../docs_site/ docs/
|
||||
|
||||
# GitHub pages config
|
||||
touch docs/.nojekyll
|
||||
echo -n docs.comma.ai > docs/CNAME
|
||||
|
||||
git add -f .
|
||||
git commit -m "build docs"
|
||||
|
||||
# docs live in different repo to not bloat openpilot's full clone size
|
||||
git push -f origin tmp:gh-pages
|
||||
45
.github/workflows/jenkins-pr-trigger.yaml
vendored
45
.github/workflows/jenkins-pr-trigger.yaml
vendored
@@ -1,45 +0,0 @@
|
||||
name: jenkins scan
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created, edited]
|
||||
|
||||
jobs:
|
||||
# TODO: gc old branches in a separate job in this workflow
|
||||
scan-comments:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.issue.pull_request }}
|
||||
steps:
|
||||
- name: Check for trigger phrase
|
||||
id: check_comment
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const triggerPhrase = "trigger-jenkins";
|
||||
const comment = context.payload.comment.body;
|
||||
const commenter = context.payload.comment.user.login;
|
||||
|
||||
const { data: permissions } = await github.rest.repos.getCollaboratorPermissionLevel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
username: commenter
|
||||
});
|
||||
|
||||
const hasWriteAccess = permissions.permission === 'write' || permissions.permission === 'admin';
|
||||
|
||||
return (hasWriteAccess && comment.includes(triggerPhrase));
|
||||
result-encoding: json
|
||||
|
||||
- name: Checkout repository
|
||||
if: steps.check_comment.outputs.result == 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/pull/${{ github.event.issue.number }}/head
|
||||
|
||||
- name: Push to tmp-jenkins branch
|
||||
if: steps.check_comment.outputs.result == 'true'
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git checkout -b tmp-jenkins-${{ github.event.issue.number }}
|
||||
GIT_LFS_SKIP_PUSH=1 git push -f origin tmp-jenkins-${{ github.event.issue.number }}
|
||||
46
.github/workflows/mirror_to_gitlab.yaml
vendored
46
.github/workflows/mirror_to_gitlab.yaml
vendored
@@ -1,46 +0,0 @@
|
||||
name: Mirror to GitLab
|
||||
|
||||
on:
|
||||
push:
|
||||
delete:
|
||||
workflow_dispatch: # This enables manual triggering
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Wait for other instances of this workflow to conclude
|
||||
uses: softprops/turnstyle@8db075d65b19bf94e6e8687b504db69938dc3c65
|
||||
with:
|
||||
same-branch-only: 'true'
|
||||
abort-after-seconds: 300
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
fetch-depth: 0 # Fetch full history
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name 'GitHub Action'
|
||||
git config --global user.email 'action@github.com'
|
||||
|
||||
- name: Set up SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
|
||||
- name: Add GitLab public keys
|
||||
run: |
|
||||
ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
|
||||
|
||||
# Note: If you have issues with "push rejected missing LFS" or something make sure you disabled LFS on the GITLAB repo if you intend to use a different LFS repo other than the target repo.
|
||||
- name: Sync and commit changes
|
||||
id: sync-and-commit
|
||||
run: |
|
||||
# Add GitLab remote
|
||||
git remote add gitlab git@gitlab.com:sunnypilot/sunnyhaibin/sunnypilot-github-mirror.git
|
||||
git push -u --force gitlab ${{ github.ref }}
|
||||
12
.github/workflows/prebuilt.yaml
vendored
12
.github/workflows/prebuilt.yaml
vendored
@@ -11,28 +11,22 @@ env:
|
||||
jobs:
|
||||
build_prebuilt:
|
||||
name: build prebuilt
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
env:
|
||||
PUSH_IMAGE: true
|
||||
permissions:
|
||||
checks: read
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Wait for green check mark
|
||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||
uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc
|
||||
uses: lewagon/wait-on-check-action@e2558238c09778af25867eb5de5a3ce4bbae3dcd
|
||||
with:
|
||||
ref: master
|
||||
wait-interval: 30
|
||||
running-workflow-name: 'build prebuilt'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
check-regexp: ^((?!.*(build master-ci).*).)*$
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- run: git lfs pull
|
||||
- name: Build and Push docker image
|
||||
run: |
|
||||
$DOCKER_LOGIN
|
||||
|
||||
14
.github/workflows/release.yaml
vendored
14
.github/workflows/release.yaml
vendored
@@ -1,7 +1,7 @@
|
||||
name: release
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
- cron: '0 * * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -12,11 +12,8 @@ jobs:
|
||||
ImageOS: ubuntu20
|
||||
container:
|
||||
image: ghcr.io/commaai/openpilot-base:latest
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
permissions:
|
||||
checks: read
|
||||
contents: write
|
||||
steps:
|
||||
- name: Install wait-on-check-action dependencies
|
||||
run: |
|
||||
@@ -24,14 +21,13 @@ jobs:
|
||||
sudo apt-get install -y libyaml-dev
|
||||
- name: Wait for green check mark
|
||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||
uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc
|
||||
uses: lewagon/wait-on-check-action@e2558238c09778af25867eb5de5a3ce4bbae3dcd
|
||||
with:
|
||||
ref: master
|
||||
wait-interval: 30
|
||||
running-workflow-name: 'build master-ci'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
check-regexp: ^((?!.*(build prebuilt).*).)*$
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
@@ -47,7 +43,7 @@ jobs:
|
||||
export PYTHONPATH=$TARGET_DIR
|
||||
cd $TARGET_DIR
|
||||
scons -j$(nproc)
|
||||
pytest -n logical selfdrive/car/tests/test_car_interfaces.py
|
||||
selfdrive/car/tests/test_car_interfaces.py
|
||||
- name: Push master-ci
|
||||
run: |
|
||||
unset TARGET_DIR
|
||||
|
||||
56
.github/workflows/repo-maintenance.yaml
vendored
56
.github/workflows/repo-maintenance.yaml
vendored
@@ -2,59 +2,31 @@ name: repo maintenance
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 14 * * 1" # every Monday at 2am UTC (6am PST)
|
||||
- cron: "0 15 * * 2"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
bump_submodules:
|
||||
name: bump_submodules
|
||||
runs-on: ubuntu-latest
|
||||
updates:
|
||||
name: updates
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: ghcr.io/commaai/openpilot-base:latest
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: bump submodules
|
||||
- uses: actions/checkout@v3
|
||||
- name: poetry lock
|
||||
run: |
|
||||
pip install poetry
|
||||
poetry lock
|
||||
- name: pre-commit autoupdate
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
git -c submodule."tinygrad".update=none submodule update --remote
|
||||
git add .
|
||||
pre-commit autoupdate
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83
|
||||
uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5
|
||||
with:
|
||||
author: Vehicle Researcher <user@comma.ai>
|
||||
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
|
||||
commit-message: bump submodules
|
||||
title: '[bot] Bump submodules'
|
||||
branch: auto-bump-submodules
|
||||
base: master
|
||||
delete-branch: true
|
||||
body: 'Automatic PR from repo-maintenance -> bump_submodules'
|
||||
labels: bot
|
||||
package_updates:
|
||||
name: package_updates
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/commaai/openpilot-base:latest
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: uv lock
|
||||
run: |
|
||||
python3 -m ensurepip --upgrade
|
||||
pip3 install uv
|
||||
uv lock --upgrade
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83
|
||||
with:
|
||||
author: Vehicle Researcher <user@comma.ai>
|
||||
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
|
||||
commit-message: Update Python packages
|
||||
title: '[bot] Update Python packages'
|
||||
commit-message: Update Python packages and pre-commit hooks
|
||||
title: 'Update Python packages and pre-commit hooks'
|
||||
branch: auto-package-updates
|
||||
base: master
|
||||
delete-branch: true
|
||||
body: 'Automatic PR from repo-maintenance -> package_updates'
|
||||
labels: bot
|
||||
|
||||
387
.github/workflows/selfdrive_tests.yaml
vendored
387
.github/workflows/selfdrive_tests.yaml
vendored
@@ -5,47 +5,43 @@ on:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
run_number:
|
||||
default: '1'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: selfdrive-tests-ci-run-${{ inputs.run_number }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
|
||||
group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PYTHONWARNINGS: error
|
||||
BASE_IMAGE: openpilot-base
|
||||
CL_BASE_IMAGE: openpilot-base-cl
|
||||
AZURE_TOKEN: ${{ secrets.AZURE_COMMADATACI_OPENPILOTCI_TOKEN }}
|
||||
|
||||
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||
BUILD: selfdrive/test/docker_build.sh base
|
||||
|
||||
RUN: docker run --shm-size 2G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e CI=1 -e PYTHONWARNINGS=error -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c
|
||||
RUN: docker run --shm-size 1G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONWARNINGS=error -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/sh -c
|
||||
|
||||
PYTEST: pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append --durations=0 --durations-min=5 --hypothesis-seed 0 -n logical
|
||||
BUILD_CL: selfdrive/test/docker_build.sh cl
|
||||
|
||||
RUN_CL: docker run --shm-size 1G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONWARNINGS=error -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $CL_BASE_IMAGE /bin/sh -c
|
||||
|
||||
UNIT_TEST: coverage run --append -m unittest discover
|
||||
PYTEST: pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append --durations=0 --durations-min=5
|
||||
|
||||
jobs:
|
||||
build_release:
|
||||
name: build release
|
||||
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
|
||||
((github.event_name != 'pull_request') ||
|
||||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
STRIPPED_DIR: /tmp/releasepilot
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- run: git lfs pull
|
||||
- name: Build devel
|
||||
timeout-minutes: 1
|
||||
run: TARGET_DIR=$STRIPPED_DIR release/build_devel.sh
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Check submodules
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
|
||||
timeout-minutes: 1
|
||||
@@ -54,167 +50,250 @@ jobs:
|
||||
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
|
||||
run: |
|
||||
cd $STRIPPED_DIR
|
||||
${{ env.RUN }} "python system/manager/build.py"
|
||||
${{ env.RUN }} "CI=1 python selfdrive/manager/build.py"
|
||||
- name: Run tests
|
||||
timeout-minutes: 3
|
||||
timeout-minutes: 2
|
||||
run: |
|
||||
cd $STRIPPED_DIR
|
||||
${{ env.RUN }} "release/check-dirty.sh && \
|
||||
MAX_EXAMPLES=5 $PYTEST -m 'not slow' selfdrive/car"
|
||||
- name: static analysis
|
||||
timeout-minutes: 1
|
||||
python -m unittest discover selfdrive/car"
|
||||
- name: pre-commit
|
||||
timeout-minutes: 3
|
||||
run: |
|
||||
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 }} "scripts/lint.sh"
|
||||
${{ env.RUN }} "unset PYTHONWARNINGS && pre-commit run --all"
|
||||
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ${{ fromJson(
|
||||
((github.repository == 'commaai/openpilot') &&
|
||||
((github.event_name != 'pull_request') ||
|
||||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && '["x86_64", "aarch64"]' || '["x86_64"]' ) }}
|
||||
runs-on: ${{ (matrix.arch == 'aarch64') && 'namespace-profile-arm64-2x8' || 'ubuntu-latest' }}
|
||||
build_all:
|
||||
name: build all
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Setup docker push
|
||||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Build openpilot with all flags
|
||||
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 12 || 30) }} # allow more time when we missed the scons cache
|
||||
run: |
|
||||
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
|
||||
echo "TARGET_ARCHITECTURE=${{ matrix.arch }}" >> "$GITHUB_ENV"
|
||||
$DOCKER_LOGIN
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
${{ env.RUN }} "scons -j$(nproc)"
|
||||
${{ env.RUN }} "release/check-dirty.sh"
|
||||
- name: Cleanup scons cache and rebuild
|
||||
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 2 || 30) }} # allow more time when we missed the scons cache
|
||||
run: |
|
||||
${{ env.RUN }} "rm -rf /tmp/scons_cache/* && \
|
||||
scons -j$(nproc) --cache-populate"
|
||||
- name: Save scons cache
|
||||
uses: actions/cache/save@v3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
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
|
||||
path: .ci_cache/scons_cache
|
||||
key: scons-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
|
||||
build_mac:
|
||||
name: build macOS
|
||||
name: build macos
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- run: git lfs pull
|
||||
- name: Determine pre-existing Homebrew packages
|
||||
if: steps.dependency-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
echo 'EXISTING_CELLAR<<EOF' >> $GITHUB_ENV
|
||||
brew list --formula -1 >> $GITHUB_ENV
|
||||
echo 'EOF' >> $GITHUB_ENV
|
||||
- name: Restore scons cache
|
||||
id: scons-restore-cache
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: /tmp/scons_cache
|
||||
key: macos_scons-${{ github.sha }}
|
||||
restore-keys: macos_scons-
|
||||
- name: Cache dependencies
|
||||
id: dependency-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
.env
|
||||
.venv
|
||||
~/github_brew_cache_entries.txt
|
||||
~/.pyenv
|
||||
~/Library/Caches/pypoetry
|
||||
/usr/local/Cellar
|
||||
/usr/local/opt
|
||||
/usr/local/Caskroom/gcc-arm-*
|
||||
/opt/homebrew/Cellar
|
||||
/opt/homebrew/opt
|
||||
/opt/homebrew/Caskroom/gcc-arm-*
|
||||
/Applications/ArmGNUToolchain/*/*/*
|
||||
key: macos_deps-${{ hashFiles('tools/mac_setup.sh', 'tools/install_python_dependencies.sh', 'poetry.lock') }}
|
||||
restore-keys: macos_deps-
|
||||
- name: Brew link restored dependencies
|
||||
run: |
|
||||
if [ -f ~/github_brew_cache_entries.txt ]; then
|
||||
brew link --force --overwrite $(cat ~/github_brew_cache_entries.txt) # `--force` for keg-only packages
|
||||
if [ -d /Applications/ArmGNUToolchain ]; then # link gcc-arm-embedded manually
|
||||
GCC_TOOLCHAIN="$(echo /Applications/ArmGNUToolchain/**/**/bin)"
|
||||
echo "$GCC_TOOLCHAIN" >> $GITHUB_PATH
|
||||
fi
|
||||
else
|
||||
echo "Cache entries not found"
|
||||
fi
|
||||
- name: Install dependencies
|
||||
if: steps.dependency-cache.outputs.cache-hit != 'true'
|
||||
run: ./tools/mac_setup.sh
|
||||
env:
|
||||
# package install has DeprecationWarnings
|
||||
PYTHONWARNINGS: default
|
||||
- run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
|
||||
- name: Getting scons cache
|
||||
uses: 'actions/cache@v4'
|
||||
- name: Build openpilot
|
||||
run: |
|
||||
eval "$(pyenv init --path)"
|
||||
poetry run scons -j$(nproc)
|
||||
- name: Run tests
|
||||
run: |
|
||||
eval "$(pyenv init --path)"
|
||||
poetry run tools/plotjuggler/test_plotjuggler.py
|
||||
- name: Pre Cache - Cleanup scons cache
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
rm -rf /tmp/scons_cache/*
|
||||
eval "$(pyenv init --path)"
|
||||
poetry run scons -j$(nproc) --cache-populate
|
||||
- name: Save scons cache
|
||||
id: scons-save-cache
|
||||
uses: actions/cache/save@v3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
path: /tmp/scons_cache
|
||||
key: scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }}
|
||||
scons-${{ runner.arch }}-macos
|
||||
- name: Building openpilot
|
||||
run: . .venv/bin/activate && scons -j$(nproc)
|
||||
key: macos_scons-${{ github.sha }}
|
||||
- name: Pre Cache - Remove pre-existing Homebrew packages
|
||||
if: steps.dependency-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
new_cellar=$(brew list --formula -1)
|
||||
exceptions="zstd lz4 xz" # caching step needs zstd
|
||||
comm -12 <(echo "$EXISTING_CELLAR") <(echo "$new_cellar") | while read pkg; do
|
||||
if [[ " $exceptions " != *" $pkg "* ]]; then
|
||||
rm -rf "$(brew --cellar)/$pkg"
|
||||
fi
|
||||
done
|
||||
comm -13 <(echo "$EXISTING_CELLAR") <(echo "$new_cellar") | tee ~/github_brew_cache_entries.txt
|
||||
# .fseventsd directory causes permission errors in dep caching step
|
||||
# its used by the system to observe changes within the directory - toolchain works without it, just remove it
|
||||
sudo rm -rf /Applications/ArmGNUToolchain/*/*/.fseventsd
|
||||
|
||||
docker_push_multiarch:
|
||||
name: docker push multiarch tag
|
||||
runs-on: ubuntu-latest
|
||||
docker_push:
|
||||
name: docker push
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
|
||||
needs: [build]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- name: Setup docker
|
||||
submodules: true
|
||||
- name: Setup to push to repo
|
||||
run: |
|
||||
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
|
||||
$DOCKER_LOGIN
|
||||
- name: Merge x64 and arm64 tags
|
||||
- uses: ./.github/workflows/setup
|
||||
with:
|
||||
git-lfs: false
|
||||
- name: Build and push CL Docker image
|
||||
run: |
|
||||
export PUSH_IMAGE=true
|
||||
scripts/retry.sh selfdrive/test/docker_tag_multiarch.sh base x86_64 aarch64
|
||||
eval "$BUILD_CL"
|
||||
|
||||
static_analysis:
|
||||
name: static analysis
|
||||
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
|
||||
((github.event_name != 'pull_request') ||
|
||||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: pre-commit
|
||||
timeout-minutes: 4
|
||||
run: ${{ env.RUN }} "unset PYTHONWARNINGS && pre-commit run --all"
|
||||
|
||||
valgrind:
|
||||
name: valgrind
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Build openpilot
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: static analysis
|
||||
- name: Run valgrind
|
||||
timeout-minutes: 1
|
||||
run: ${{ env.RUN }} "scripts/lint.sh"
|
||||
run: |
|
||||
${{ env.RUN }} "python selfdrive/test/test_valgrind_replay.py"
|
||||
- name: Print logs
|
||||
if: always()
|
||||
run: cat selfdrive/test/valgrind_logs.txt
|
||||
|
||||
unit_tests:
|
||||
name: unit tests
|
||||
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
|
||||
((github.event_name != 'pull_request') ||
|
||||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
with:
|
||||
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Build openpilot
|
||||
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Run unit tests
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 40
|
||||
run: |
|
||||
${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \
|
||||
export MAPBOX_TOKEN='pk.eyJ1Ijoiam5ld2IiLCJhIjoiY2xxNW8zZXprMGw1ZzJwbzZneHd2NHljbSJ9.gV7VPRfbXFetD-1OVF0XZg' && \
|
||||
$PYTEST --timeout 60 -m 'not slow' && \
|
||||
${{ env.RUN }} "export SKIP_LONG_TESTS=1 && \
|
||||
$PYTEST --rootdir . -c selfdrive/test/pytest-ci.ini && \
|
||||
selfdrive/locationd/test/_test_locationd_lib.py && \
|
||||
./system/ubloxd/tests/test_glonass_runner && \
|
||||
./selfdrive/ui/tests/create_test_translations.sh && \
|
||||
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
|
||||
pytest ./selfdrive/ui/tests/test_translations.py"
|
||||
./selfdrive/ui/tests/test_translations.py && \
|
||||
./common/tests/test_common && \
|
||||
./selfdrive/boardd/tests/test_boardd_usbprotocol && \
|
||||
./system/loggerd/tests/test_logger &&\
|
||||
./system/proclogd/tests/test_proclog && \
|
||||
./tools/replay/tests/test_replay && \
|
||||
./tools/cabana/tests/test_cabana && \
|
||||
./system/camerad/test/ae_gray_test && \
|
||||
./selfdrive/test/process_replay/test_fuzzy.py"
|
||||
- name: "Upload coverage to Codecov"
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
process_replay:
|
||||
name: process replay
|
||||
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
|
||||
((github.event_name != 'pull_request') ||
|
||||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
|
||||
runs-on: ${{ ((github.event.pull_request.head.repo.full_name == 'commaai/openpilot') || (github.repository == 'commaai/openpilot')) && 'buildjet-8vcpu-ubuntu-2004' || 'ubuntu-20.04' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
with:
|
||||
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Cache test routes
|
||||
id: dependency-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .ci_cache/comma_download_cache
|
||||
key: proc-replay-${{ hashFiles('.github/workflows/selfdrive_tests.yaml', 'selfdrive/test/process_replay/ref_commit', 'selfdrive/test/process_replay/test_regen.py') }}
|
||||
key: proc-replay-${{ hashFiles('.github/workflows/selfdrive_tests.yaml', 'selfdrive/test/process_replay/ref_commit') }}
|
||||
- name: Build openpilot
|
||||
run: |
|
||||
${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Run replay
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
${{ env.RUN }} "coverage run selfdrive/test/process_replay/test_processes.py -j$(nproc) && \
|
||||
${{ env.RUN }} "CI=1 coverage run selfdrive/test/process_replay/test_processes.py -j$(nproc) && \
|
||||
chmod -R 777 /tmp/comma_download_cache && \
|
||||
coverage combine && \
|
||||
coverage xml"
|
||||
- name: Print diff
|
||||
id: print-diff
|
||||
if: always()
|
||||
run: cat selfdrive/test/process_replay/diff.txt
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
with:
|
||||
@@ -223,101 +302,109 @@ jobs:
|
||||
- name: Upload reference logs
|
||||
if: ${{ failure() && steps.print-diff.outcome == 'success' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }}
|
||||
run: |
|
||||
${{ env.RUN }} "unset PYTHONWARNINGS && AZURE_TOKEN='$AZURE_TOKEN' python selfdrive/test/process_replay/test_processes.py -j$(nproc) --upload-only"
|
||||
${{ env.RUN }} "unset PYTHONWARNINGS && CI=1 AZURE_TOKEN='$AZURE_TOKEN' python selfdrive/test/process_replay/test_processes.py -j$(nproc) --upload-only"
|
||||
- name: "Upload coverage to Codecov"
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
test_modeld:
|
||||
name: model tests
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Build base Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Build Docker image
|
||||
# Sim docker is needed to get the OpenCL drivers
|
||||
run: eval "$BUILD_CL"
|
||||
- name: Build openpilot
|
||||
run: |
|
||||
${{ env.RUN }} "scons -j$(nproc)"
|
||||
# PYTHONWARNINGS triggers a SyntaxError in onnxruntime
|
||||
- name: Run model replay with ONNX
|
||||
timeout-minutes: 2
|
||||
run: |
|
||||
${{ env.RUN_CL }} "unset PYTHONWARNINGS && \
|
||||
ONNXCPU=1 CI=1 NO_NAV=1 coverage run selfdrive/test/process_replay/model_replay.py && \
|
||||
coverage xml"
|
||||
- name: Run unit tests
|
||||
timeout-minutes: 4
|
||||
run: |
|
||||
${{ env.RUN }} "unset PYTHONWARNINGS && \
|
||||
ONNXCPU=1 NO_NAV=1 coverage run selfdrive/test/process_replay/model_replay.py && \
|
||||
coverage combine && coverage xml"
|
||||
- name: Run regen
|
||||
timeout-minutes: 4
|
||||
run: |
|
||||
${{ env.RUN }} "ONNXCPU=1 $PYTEST selfdrive/test/process_replay/test_regen.py && \
|
||||
chmod -R 777 /tmp/comma_download_cache"
|
||||
${{ env.RUN_CL }} "unset PYTHONWARNINGS && \
|
||||
$UNIT_TEST selfdrive/modeld && \
|
||||
coverage xml"
|
||||
- name: "Upload coverage to Codecov"
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
test_cars:
|
||||
name: cars
|
||||
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
|
||||
((github.event_name != 'pull_request') ||
|
||||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job: [0, 1]
|
||||
job: [0, 1, 2, 3, 4]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Cache test routes
|
||||
id: dependency-cache
|
||||
uses: ./.github/workflows/auto-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .ci_cache/comma_download_cache
|
||||
key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'selfdrive/car/tests/routes.py') }}-${{ matrix.job }}
|
||||
- name: Build openpilot
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Test car models
|
||||
timeout-minutes: 20
|
||||
timeout-minutes: 25
|
||||
run: |
|
||||
${{ env.RUN }} "$PYTEST selfdrive/car/tests/test_models.py && \
|
||||
${{ env.RUN }} "$PYTEST -n auto --dist=loadscope selfdrive/car/tests/test_models.py && \
|
||||
chmod -R 777 /tmp/comma_download_cache"
|
||||
env:
|
||||
NUM_JOBS: 2
|
||||
NUM_JOBS: 5
|
||||
JOB_ID: ${{ matrix.job }}
|
||||
- name: "Upload coverage to Codecov"
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
name: ${{ github.job }}-${{ matrix.job }}
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
car_docs_diff:
|
||||
name: PR comments
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name == 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
- run: git lfs pull
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Get base car info
|
||||
run: |
|
||||
${{ env.RUN }} "scons -j$(nproc) && python selfdrive/debug/dump_car_docs.py --path /tmp/openpilot_cache/base_car_docs"
|
||||
${{ env.RUN }} "scons -j$(nproc) && python selfdrive/debug/dump_car_info.py --path /tmp/openpilot_cache/base_car_info"
|
||||
sudo chown -R $USER:$USER ${{ github.workspace }}
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
path: current
|
||||
- run: cd current && git lfs pull
|
||||
- name: Save car docs diff
|
||||
id: save_diff
|
||||
run: |
|
||||
cd current
|
||||
${{ env.RUN }} "scons -j$(nproc)"
|
||||
output=$(${{ env.RUN }} "python selfdrive/debug/print_docs_diff.py --path /tmp/openpilot_cache/base_car_docs")
|
||||
output=$(${{ env.RUN }} "python selfdrive/debug/print_docs_diff.py --path /tmp/openpilot_cache/base_car_info")
|
||||
output="${output//$'\n'/'%0A'}"
|
||||
echo "::set-output name=diff::$output"
|
||||
- name: Find comment
|
||||
if: ${{ env.AZURE_TOKEN != '' }}
|
||||
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
|
||||
uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: This PR makes changes to
|
||||
- name: Update comment
|
||||
if: ${{ steps.save_diff.outputs.diff != '' && env.AZURE_TOKEN != '' }}
|
||||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
|
||||
uses: peter-evans/create-or-update-comment@b95e16d2859ad843a14218d1028da5b2c4cbc4b4
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
@@ -325,7 +412,7 @@ jobs:
|
||||
edit-mode: replace
|
||||
- name: Delete comment
|
||||
if: ${{ steps.fc.outputs.comment-id != '' && steps.save_diff.outputs.diff == '' && env.AZURE_TOKEN != '' }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.deleteComment({
|
||||
@@ -333,27 +420,3 @@ jobs:
|
||||
repo: context.repo.repo,
|
||||
comment_id: ${{ steps.fc.outputs.comment-id }}
|
||||
})
|
||||
|
||||
create_ui_report:
|
||||
# This job name needs to be the same as UI_JOB_NAME in ui_preview.yaml
|
||||
name: Create UI Report
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- name: Build openpilot
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Create Test Report
|
||||
run: >
|
||||
${{ env.RUN }} "PYTHONWARNINGS=ignore &&
|
||||
source selfdrive/test/setup_xvfb.sh &&
|
||||
export MAPBOX_TOKEN='pk.eyJ1Ijoiam5ld2IiLCJhIjoiY2xxNW8zZXprMGw1ZzJwbzZneHd2NHljbSJ9.gV7VPRfbXFetD-1OVF0XZg' &&
|
||||
python selfdrive/ui/tests/test_ui/run.py"
|
||||
- name: Upload Test Report
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: report-${{ github.event.number }}
|
||||
path: selfdrive/ui/tests/test_ui/report_1/screenshots
|
||||
|
||||
40
.github/workflows/setup-with-retry/action.yaml
vendored
40
.github/workflows/setup-with-retry/action.yaml
vendored
@@ -1,40 +0,0 @@
|
||||
name: 'openpilot env setup, with retry on failure'
|
||||
|
||||
inputs:
|
||||
docker_hub_pat:
|
||||
description: 'Auth token for Docker Hub, required for BuildJet jobs'
|
||||
required: false
|
||||
default: ''
|
||||
sleep_time:
|
||||
description: 'Time to sleep between retries'
|
||||
required: false
|
||||
default: 30
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- id: setup1
|
||||
uses: ./.github/workflows/setup
|
||||
continue-on-error: true
|
||||
with:
|
||||
docker_hub_pat: ${{ inputs.docker_hub_pat }}
|
||||
is_retried: true
|
||||
- if: steps.setup1.outcome == 'failure'
|
||||
shell: bash
|
||||
run: sleep ${{ inputs.sleep_time }}
|
||||
- id: setup2
|
||||
if: steps.setup1.outcome == 'failure'
|
||||
uses: ./.github/workflows/setup
|
||||
continue-on-error: true
|
||||
with:
|
||||
docker_hub_pat: ${{ inputs.docker_hub_pat }}
|
||||
is_retried: true
|
||||
- if: steps.setup2.outcome == 'failure'
|
||||
shell: bash
|
||||
run: sleep ${{ inputs.sleep_time }}
|
||||
- id: setup3
|
||||
if: steps.setup2.outcome == 'failure'
|
||||
uses: ./.github/workflows/setup
|
||||
with:
|
||||
docker_hub_pat: ${{ inputs.docker_hub_pat }}
|
||||
is_retried: true
|
||||
54
.github/workflows/setup/action.yaml
vendored
54
.github/workflows/setup/action.yaml
vendored
@@ -1,56 +1,38 @@
|
||||
name: 'openpilot env setup'
|
||||
|
||||
inputs:
|
||||
docker_hub_pat:
|
||||
description: 'Auth token for Docker Hub, required for BuildJet jobs'
|
||||
required: true
|
||||
default: ''
|
||||
is_retried:
|
||||
description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly'
|
||||
git_lfs:
|
||||
description: 'Whether or not to pull the git lfs'
|
||||
required: false
|
||||
default: 'false'
|
||||
default: 'true'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# assert that this action is retried using the setup-with-retry
|
||||
- shell: bash
|
||||
if: ${{ inputs.is_retried == 'false' }}
|
||||
run: |
|
||||
echo "You should not run this action directly. Use setup-with-retry instead"
|
||||
exit 1
|
||||
|
||||
# do this after checkout to ensure our custom LFS config is used to pull from GitLab
|
||||
- shell: bash
|
||||
if: ${{ inputs.git_lfs == 'true' }}
|
||||
run: git lfs pull
|
||||
|
||||
# on BuildJet runners, must be logged into DockerHub to avoid rate limiting
|
||||
# https://buildjet.com/for-github-actions/docs/guides/docker
|
||||
- shell: bash
|
||||
if: ${{ contains(runner.name, 'buildjet') && inputs.docker_hub_pat == '' }}
|
||||
run: |
|
||||
echo "Need to set the Docker Hub PAT secret as an input to this action"
|
||||
exit 1
|
||||
- name: Login to Docker Hub
|
||||
if: contains(runner.name, 'buildjet')
|
||||
shell: bash
|
||||
run: |
|
||||
docker login -u adeebshihadeh -p ${{ inputs.docker_hub_pat }}
|
||||
|
||||
# build cache
|
||||
- id: date
|
||||
shell: bash
|
||||
run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
|
||||
- shell: bash
|
||||
run: echo "$CACHE_COMMIT_DATE"
|
||||
- id: scons-cache
|
||||
uses: ./.github/workflows/auto-cache
|
||||
- id: restore-scons-cache
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: .ci_cache/scons_cache
|
||||
key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
key: scons-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}
|
||||
scons-${{ runner.arch }}
|
||||
scons-${{ env.CACHE_COMMIT_DATE }}-
|
||||
scons-
|
||||
# if we didn't get a cache hit, make the directory manually so it doesn't fail on future steps
|
||||
- id: scons-cache-setup
|
||||
shell: bash
|
||||
if: steps.restore-scons-cache.outputs.cache-hit != 'true'
|
||||
run: mkdir -p $GITHUB_WORKSPACE/.ci_cache/scons_cache
|
||||
# as suggested here: https://github.com/moby/moby/issues/32816#issuecomment-910030001
|
||||
- id: normalize-file-permissions
|
||||
shell: bash
|
||||
@@ -58,6 +40,12 @@ runs:
|
||||
run: |
|
||||
find . -type f -executable -not -perm 755 -exec chmod 755 {} \;
|
||||
find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \;
|
||||
- id: setup-buildx-action
|
||||
if: contains(runner.name, 'buildjet')
|
||||
name: Set up Docker Buildx on buildjet to ensure a consistent cache
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver: docker-container
|
||||
# build our docker image
|
||||
- shell: bash
|
||||
run: eval ${{ env.BUILD }}
|
||||
run: eval ${{ env.BUILD }}
|
||||
29
.github/workflows/stale.yaml
vendored
29
.github/workflows/stale.yaml
vendored
@@ -1,29 +0,0 @@
|
||||
name: stale
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DAYS_BEFORE_PR_CLOSE: 2
|
||||
DAYS_BEFORE_PR_STALE: 9
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
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.'
|
||||
close-pr-message: 'This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes.'
|
||||
stale-pr-label: stale
|
||||
delete-branch: ${{ github.event.pull_request.head.repo.full_name == 'commaai/openpilot' }} # only delete branches on the main repo
|
||||
exempt-pr-labels: "ignore stale,needs testing,car port,car" # if wip or it needs testing from the community, don't mark as stale
|
||||
days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }}
|
||||
days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }}
|
||||
|
||||
# issue config
|
||||
days-before-issue-stale: -1 # ignore issues for now
|
||||
130
.github/workflows/tools_tests.yaml
vendored
130
.github/workflows/tools_tests.yaml
vendored
@@ -5,99 +5,97 @@ on:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
workflow_call:
|
||||
inputs:
|
||||
run_number:
|
||||
default: '1'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: tools-tests-ci-run-${{ inputs.run_number }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
|
||||
group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BASE_IMAGE: openpilot-base
|
||||
CL_BASE_IMAGE: openpilot-base-cl
|
||||
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
BUILD: selfdrive/test/docker_build.sh base
|
||||
|
||||
RUN: docker run --shm-size 2G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c
|
||||
RUN: docker run --shm-size 1G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/sh -c
|
||||
|
||||
BUILD_CL: selfdrive/test/docker_build.sh cl
|
||||
|
||||
RUN_CL: docker run --shm-size 1G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $CL_BASE_IMAGE /bin/sh -c
|
||||
|
||||
|
||||
jobs:
|
||||
simulator_driving:
|
||||
name: simulator driving
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- name: Build openpilot
|
||||
run: |
|
||||
${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Run bridge test
|
||||
run: |
|
||||
${{ env.RUN }} "export MAPBOX_TOKEN='pk.eyJ1Ijoiam5ld2IiLCJhIjoiY2xxNW8zZXprMGw1ZzJwbzZneHd2NHljbSJ9.gV7VPRfbXFetD-1OVF0XZg' && \
|
||||
source selfdrive/test/setup_xvfb.sh && \
|
||||
source selfdrive/test/setup_vsound.sh && \
|
||||
CI=1 pytest tools/sim/tests/test_metadrive_bridge.py"
|
||||
|
||||
test_compatibility:
|
||||
name: test 20.04 + 3.11
|
||||
plotjuggler:
|
||||
name: plotjuggler
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Installing ubuntu dependencies
|
||||
run: INSTALL_EXTRA_PACKAGES=no tools/install_ubuntu_dependencies.sh
|
||||
- name: Installing python
|
||||
uses: actions/setup-python@v5
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Build openpilot
|
||||
timeout-minutes: 5
|
||||
run: ${{ env.RUN }} "scons -j$(nproc) --directory=/tmp/openpilot/cereal --minimal"
|
||||
- name: Test PlotJuggler
|
||||
timeout-minutes: 2
|
||||
run: |
|
||||
${{ env.RUN }} "pytest tools/plotjuggler/"
|
||||
|
||||
simulator:
|
||||
name: simulator
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
python-version: '3.11.4'
|
||||
- name: Installing pip
|
||||
run: pip install pip==24.0
|
||||
- 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
|
||||
- name: Getting scons cache
|
||||
uses: 'actions/cache@v4'
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup
|
||||
- name: Build base cl image
|
||||
run: eval "$BUILD_CL"
|
||||
- name: Setup to push to repo
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
|
||||
run: |
|
||||
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
|
||||
$DOCKER_LOGIN
|
||||
- name: Build and push sim image
|
||||
run: |
|
||||
selfdrive/test/docker_build.sh sim
|
||||
|
||||
docs:
|
||||
name: build docs
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: /tmp/scons_cache
|
||||
key: scons-${{ runner.arch }}-ubuntu2004-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
scons-${{ runner.arch }}-ubuntu2004-${{ env.CACHE_COMMIT_DATE }}
|
||||
scons-${{ runner.arch }}-ubuntu2004
|
||||
- name: Building openpilot
|
||||
run: uv run scons -u -j$(nproc)
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup
|
||||
with:
|
||||
git_lfs: false
|
||||
- name: Setup to push to repo
|
||||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
|
||||
run: |
|
||||
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
|
||||
$DOCKER_LOGIN
|
||||
- name: Build and push docs image
|
||||
run: |
|
||||
selfdrive/test/docker_build.sh docs
|
||||
|
||||
devcontainer:
|
||||
name: devcontainer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/workflows/setup-with-retry
|
||||
- name: Use local image for testing devcontainer with latest base image
|
||||
run: |
|
||||
echo "USE_LOCAL_IMAGE=true" >> "$GITHUB_ENV"
|
||||
- name: Setup Dev Container CLI
|
||||
run: npm install -g @devcontainers/cli
|
||||
- name: Build dev container image
|
||||
run: ./scripts/retry.sh devcontainer build --workspace-folder .
|
||||
run: devcontainer build --workspace-folder .
|
||||
- name: Run dev container
|
||||
run: |
|
||||
mkdir -p /tmp/devcontainer_scons_cache/
|
||||
cp -r $GITHUB_WORKSPACE/.ci_cache/scons_cache/. /tmp/devcontainer_scons_cache/
|
||||
devcontainer up --workspace-folder .
|
||||
run: devcontainer up --workspace-folder .
|
||||
- name: Test environment
|
||||
run: |
|
||||
devcontainer exec --workspace-folder . scons -j$(nproc) cereal/ common/
|
||||
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
|
||||
run: devcontainer exec --workspace-folder . scons --dry-run
|
||||
|
||||
91
.github/workflows/ui_preview.yaml
vendored
91
.github/workflows/ui_preview.yaml
vendored
@@ -1,91 +0,0 @@
|
||||
name: "ui preview"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [assigned, opened, synchronize, reopened, edited]
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'selfdrive/ui/**'
|
||||
|
||||
env:
|
||||
UI_JOB_NAME: "Create UI Report"
|
||||
|
||||
jobs:
|
||||
preview:
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
name: preview
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
actions: read
|
||||
steps:
|
||||
- name: Waiting for ui test to start
|
||||
run: sleep 30
|
||||
|
||||
- name: Wait for ui report
|
||||
uses: lewagon/wait-on-check-action@v1.3.4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
check-name: ${{ env.UI_JOB_NAME }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
allowed-conclusions: success
|
||||
wait-interval: 20
|
||||
|
||||
- name: Get workflow run ID
|
||||
id: get_run_id
|
||||
run: |
|
||||
echo "run_id=$(curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs | jq -r '.check_runs[] | select(.name == "${{ env.UI_JOB_NAME }}") | .html_url | capture("(?<number>[0-9]+)") | .number')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Checkout ci-artifacts
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: commaai/ci-artifacts
|
||||
ssh-key: ${{ secrets.CI_ARTIFACTS_DEPLOY_KEY }}
|
||||
path: ${{ github.workspace }}/ci-artifacts
|
||||
ref: master
|
||||
|
||||
- name: Download artifact
|
||||
id: download-artifact
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run_id: ${{ steps.get_run_id.outputs.run_id }}
|
||||
search_artifacts: true
|
||||
name: report-${{ github.event.number }}
|
||||
path: ${{ github.workspace }}/ci-artifacts
|
||||
|
||||
- name: Push Screenshots
|
||||
working-directory: ${{ github.workspace }}/ci-artifacts
|
||||
run: |
|
||||
git checkout -b openpilot/pr-${{ github.event.number }}
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "<>"
|
||||
git add ${{ github.workspace }}/ci-artifacts/*
|
||||
git commit -m "screenshots for PR #${{ github.event.number }}"
|
||||
git push origin openpilot/pr-${{ github.event.number }} --force
|
||||
|
||||
- name: Comment Screenshots on PR
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
message: |
|
||||
<!-- _(run_id_screenshots **${{ github.run_id }}**)_ -->
|
||||
## UI Screenshots
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/homescreen.png"></td>
|
||||
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/onroad.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/onroad_map.png"></td>
|
||||
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/onroad_sidebar.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/settings_network.png"></td>
|
||||
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/settings_device.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
comment_tag: run_id_screenshots
|
||||
pr_number: ${{ github.event.number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
35
.gitignore
vendored
35
.gitignore
vendored
@@ -10,12 +10,11 @@ venv/
|
||||
.overlay_init
|
||||
.overlay_consistent
|
||||
.sconsign.dblite
|
||||
.vscode*
|
||||
model2.png
|
||||
a.out
|
||||
.hypothesis
|
||||
|
||||
/docs_site/
|
||||
|
||||
*.dylib
|
||||
*.DSYM
|
||||
*.d
|
||||
@@ -42,15 +41,13 @@ compile_commands.json
|
||||
compare_runtime*.html
|
||||
|
||||
persist
|
||||
selfdrive/pandad/pandad
|
||||
cereal/services.h
|
||||
cereal/gen
|
||||
cereal/messaging/bridge
|
||||
board/obj/
|
||||
selfdrive/boardd/boardd
|
||||
selfdrive/logcatd/logcatd
|
||||
selfdrive/mapd/default_speeds_by_region.json
|
||||
system/proclogd/proclogd
|
||||
selfdrive/ui/_ui
|
||||
selfdrive/ui/translations/alerts_generated.h
|
||||
selfdrive/ui/translations/tmp
|
||||
selfdrive/test/longitudinal_maneuvers/out
|
||||
selfdrive/car/tests/cars_dump
|
||||
system/camerad/camerad
|
||||
@@ -60,8 +57,12 @@ selfdrive/modeld/_navmodeld
|
||||
selfdrive/modeld/_dmonitoringmodeld
|
||||
/src/
|
||||
|
||||
one
|
||||
notebooks
|
||||
xx
|
||||
yy
|
||||
hyperthneed
|
||||
panda_jungle
|
||||
provisioning
|
||||
|
||||
.coverage*
|
||||
@@ -77,7 +78,6 @@ comma*.sh
|
||||
|
||||
selfdrive/modeld/thneed/compile
|
||||
selfdrive/modeld/models/*.thneed
|
||||
selfdrive/modeld/models/*.pkl
|
||||
|
||||
*.bz2
|
||||
|
||||
@@ -87,22 +87,3 @@ build/
|
||||
|
||||
poetry.toml
|
||||
Pipfile
|
||||
|
||||
### VisualStudioCode ###
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
|
||||
### VisualStudioCode Patch ###
|
||||
# Ignore all local history of files
|
||||
.history
|
||||
.ionide
|
||||
|
||||
240
.gitlab-ci.yml
240
.gitlab-ci.yml
@@ -1,240 +0,0 @@
|
||||
variables:
|
||||
BUILD_DIR: "/data/openpilot"
|
||||
OUTPUT_DIR: "${CI_PROJECT_DIR}/output"
|
||||
CI_DIR: "${CI_PROJECT_DIR}/release/ci"
|
||||
VERSION: 'echo $(date "+%Y.%m.%d")'
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
|
||||
DEV_C3_SOURCE_BRANCH: "master-dev-c3"
|
||||
GIT_CONFIG_USER_EMAIL: "gitlab@pipeline.com"
|
||||
GIT_CONFIG_USER_NAME: "Gitlab Pipeline"
|
||||
PUBLIC_REPO_URL: "https://github.com/sunnyhaibin/sunnypilot"
|
||||
BASE_BUILD_NUMER: 3000
|
||||
|
||||
EXTRA_VERSION_IDENTIFIER: "${CI_PIPELINE_IID}"
|
||||
NEW_BRANCH: ${CI_COMMIT_REF_NAME}-prebuilt
|
||||
|
||||
stages:
|
||||
- build
|
||||
- sanity
|
||||
- publish
|
||||
- notify
|
||||
|
||||
default:
|
||||
retry: 2
|
||||
tags:
|
||||
- sunnypilot
|
||||
- x86
|
||||
|
||||
.default_before_script: &default_before_script
|
||||
- 'if [ "$EXTRA_VERSION_IDENTIFIER" = "$CI_PIPELINE_IID" ]; then export EXTRA_VERSION_IDENTIFIER=$((CI_PIPELINE_IID + BASE_BUILD_NUMER)); fi'
|
||||
- 'export VERSION=$(eval $VERSION)-${EXTRA_VERSION_IDENTIFIER}'
|
||||
- 'mkdir -p "${BUILD_DIR}/"'
|
||||
- 'git config --global user.email "${GIT_CONFIG_USER_EMAIL}"'
|
||||
- 'git config --global user.name "${GIT_CONFIG_USER_NAME}"'
|
||||
|
||||
|
||||
workflow: # If running on any branch other than main.
|
||||
rules:
|
||||
# We are an MR, but it's a draft, we won't proceed with anything.
|
||||
- if: '$CI_MERGE_REQUEST_TITLE =~ /^wip:/i || $CI_MERGE_REQUEST_TITLE =~ /^draft:/i'
|
||||
when: never
|
||||
|
||||
# Below are the rules when a commit is done (code has been added to the branch)
|
||||
# Commit to master-dev-c3
|
||||
- if: $CI_COMMIT_REF_NAME == $DEV_C3_SOURCE_BRANCH
|
||||
variables:
|
||||
EXTRA_VERSION_IDENTIFIER: "${CI_PIPELINE_IID}"
|
||||
NEW_BRANCH: "dev-c3"
|
||||
AUTO_BUILD: true
|
||||
when: always
|
||||
#commit made to main (master)
|
||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
variables:
|
||||
NEW_BRANCH: "staging-c3"
|
||||
VERSION: 'cat common/version.h | grep COMMA_VERSION | sed -e "s/[^0-9|.]//g"'
|
||||
EXTRA_VERSION_IDENTIFIER: "staging"
|
||||
AUTO_PUBLISH: true
|
||||
AUTO_BUILD: true
|
||||
when: always
|
||||
# if tag
|
||||
- if: $CI_COMMIT_TAG
|
||||
variables:
|
||||
NEW_BRANCH: "release-c3"
|
||||
VERSION: 'cat common/version.h | grep COMMA_VERSION | sed -e "s/[^0-9|.]//g"'
|
||||
EXTRA_VERSION_IDENTIFIER: "release"
|
||||
AUTO_BUILD: true
|
||||
- when: always
|
||||
|
||||
|
||||
build:
|
||||
stage: build
|
||||
cache:
|
||||
key: "${CI_COMMIT_REF_SLUG}"
|
||||
paths:
|
||||
- "${CI_DIR}/scons_cache"
|
||||
before_script:
|
||||
- find $BUILD_DIR/ -mindepth 1 -delete
|
||||
- *default_before_script
|
||||
- "echo Starting build stage..."
|
||||
- "echo BUILD_DIR: ${BUILD_DIR}"
|
||||
- "echo CI_DIR: ${CI_DIR}"
|
||||
- "echo VERSION: ${VERSION}"
|
||||
- "echo CI_COMMIT_REF_NAME: ${CI_COMMIT_REF_NAME}"
|
||||
- git config --global --add safe.directory ${CI_PROJECT_DIR}
|
||||
script:
|
||||
- export PYTHONPATH="$BUILD_DIR"
|
||||
- "echo Building Panda..."
|
||||
- scons -j$(nproc) cache_dir=${CI_DIR}/scons_cache ${CI_PROJECT_DIR}/panda
|
||||
- mkdir -p ${BUILD_DIR}
|
||||
- ls -la ${BUILD_DIR}
|
||||
- "echo Building Rest..."
|
||||
- ./release/release_files.py | sort | uniq | rsync -vrRl --files-from=- . $BUILD_DIR/
|
||||
# - cp -pR --parents $(cat release/files_common release/files_tici | sort | uniq) $BUILD_DIR/ 2> >(grep -v 'warning:' >&2)
|
||||
- cd $BUILD_DIR
|
||||
- sed -i '/from .board.jungle import PandaJungle, PandaJungleDFU/s/^/#/' panda/__init__.py # comment panda jungle when prebuilt
|
||||
- scons -j$(nproc) cache_dir=${CI_DIR}/scons_cache --minimal
|
||||
- touch ${BUILD_DIR}/prebuilt
|
||||
- sudo rm -rf ${OUTPUT_DIR}
|
||||
- mkdir -p ${OUTPUT_DIR}
|
||||
# We first include the paths we want to keep, even if we later will be excluding the other things on those paths
|
||||
- rsync -avm
|
||||
--include='**/panda/board/'
|
||||
--include='**/panda/board/obj'
|
||||
--include='**/panda/board/obj/panda.bin.signed'
|
||||
--include='**/panda/board/obj/panda_h7.bin.signed'
|
||||
--include='**/panda/board/obj/bootstub.panda.bin'
|
||||
--include='**/panda/board/obj/bootstub.panda_h7.bin'
|
||||
--exclude='.sconsign.dblite'
|
||||
--exclude='*.a'
|
||||
--exclude='*.A'
|
||||
--exclude='*.o'
|
||||
--exclude='*.O'
|
||||
--exclude='*.os'
|
||||
--exclude='*.OS'
|
||||
--exclude='*.pyc'
|
||||
--exclude='*.PYC'
|
||||
--exclude='moc_*'
|
||||
--exclude='MOC_*'
|
||||
--exclude='*.cc'
|
||||
--exclude='*.CC'
|
||||
--exclude='Jenkinsfile'
|
||||
--exclude='supercombo.onnx'
|
||||
--exclude='**/panda/board/*'
|
||||
--exclude='**/panda/board/obj/**'
|
||||
--exclude='**/panda/certs/'
|
||||
--exclude='**/panda/crypto/'
|
||||
--exclude='**/release/'
|
||||
--exclude='**/.github/'
|
||||
--exclude='**/selfdrive/ui/replay/'
|
||||
--exclude='**/__pycache__/'
|
||||
--exclude='**/selfdrive/ui/*.h'
|
||||
--exclude='**/selfdrive/ui/**/*.h'
|
||||
--exclude='**/selfdrive/ui/qt/offroad/sunnypilot/'
|
||||
--exclude='**/.git/'
|
||||
--exclude='**/SConstruct'
|
||||
--exclude='**/SConscript'
|
||||
--delete-excluded
|
||||
--chown=comma:comma
|
||||
${BUILD_DIR}/ ${OUTPUT_DIR}/
|
||||
after_script:
|
||||
# cleanup build dir after doing work
|
||||
- find $BUILD_DIR/ -mindepth 1 -delete
|
||||
artifacts:
|
||||
paths:
|
||||
- ${OUTPUT_DIR}/
|
||||
tags: [ 'sunnypilot', 'tici' ]
|
||||
rules:
|
||||
- if: $AUTO_BUILD
|
||||
when: always
|
||||
- when: manual
|
||||
|
||||
.publish_base: &publish_base
|
||||
image: alpine
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
stage: publish
|
||||
needs:
|
||||
- job: build
|
||||
artifacts: true
|
||||
before_script:
|
||||
- 'apk update && apk upgrade'
|
||||
- 'apk add git bash openssh'
|
||||
- 'eval $(ssh-agent -s)'
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- 'mkdir -p ~/.ssh/'
|
||||
- 'chmod 700 ~/.ssh'
|
||||
- export HOST=$(echo ${GIT_ORIGIN} | cut -d'@' -f2 | cut -d':' -f1)
|
||||
- echo fetching ssh pub keys for ${HOST}
|
||||
- 'ssh-keyscan -H ${HOST} >> ~/.ssh/known_hosts' # Adding gitlab to trusted
|
||||
- 'chmod 644 ~/.ssh/known_hosts'
|
||||
- *default_before_script
|
||||
script:
|
||||
- echo "${GIT_ORIGIN}"
|
||||
- echo "Calling to publish [${CI_DIR}/publish.sh ${CI_PROJECT_DIR} ${OUTPUT_DIR} ${NEW_BRANCH} ${VERSION} ${GIT_ORIGIN}]"
|
||||
- git config --global --add safe.directory ${OUTPUT_DIR}
|
||||
- $CI_DIR/publish.sh "${CI_PROJECT_DIR}" "${OUTPUT_DIR}" "${NEW_BRANCH}" "${VERSION}" "${GIT_ORIGIN}" "-${EXTRA_VERSION_IDENTIFIER}"
|
||||
allow_failure: false
|
||||
|
||||
publish to private gitlab prebuilt:
|
||||
extends: ".publish_base"
|
||||
variables:
|
||||
GIT_ORIGIN: git@gitlab.com:sunnypilot/public/sunnypilot-prebuilts.git
|
||||
rules:
|
||||
- if: $AUTO_BUILD
|
||||
when: on_success
|
||||
- if: $CI_MERGE_REQUEST_IID
|
||||
when: on_success
|
||||
- when: manual
|
||||
|
||||
publish to public github prebuilt:
|
||||
extends: ".publish_base"
|
||||
variables:
|
||||
GIT_ORIGIN: git@github.com:sunnyhaibin/sunnypilot.git
|
||||
GIT_CONFIG_USER_EMAIL: "jason.wen@sunnypilot.ai"
|
||||
GIT_CONFIG_USER_NAME: "Jason Wen"
|
||||
rules:
|
||||
- if: $AUTO_PUBLISH
|
||||
when: on_success
|
||||
- when: manual
|
||||
|
||||
.notify_discord: ¬ify_discord
|
||||
image: alpine
|
||||
stage: notify
|
||||
needs: ["build"]
|
||||
variables:
|
||||
DISCORD_HOOK: "${DISCORD_MANUAL_BUILD_WEBHOOK_URL}" # Default hook if not overriden by children
|
||||
before_script:
|
||||
- 'apk add curl jq envsubst'
|
||||
script:
|
||||
- echo using [${TEMPLATE}]
|
||||
- cat release/ci/${TEMPLATE} | envsubst | tee payload.json
|
||||
- 'curl -X POST -H "Content-Type: application/json" -d "$(cat payload.json)" ${DISCORD_HOOK} | jq .'
|
||||
rules:
|
||||
- if: $NEW_BRANCH
|
||||
when: on_success
|
||||
- when: never
|
||||
allow_failure: true
|
||||
|
||||
notify pending action:
|
||||
extends: ".notify_discord"
|
||||
variables:
|
||||
TEMPLATE: "discord_template_notify_dev_private.json"
|
||||
before_script:
|
||||
- !reference [".notify_discord", "before_script"]
|
||||
- export AVATAR_URL=$(curl -s -X GET "https://gitlab.com/api/v4/avatar?email=${GITLAB_USER_EMAIL}" | jq -r '.avatar_url')
|
||||
|
||||
notify new dev build:
|
||||
extends: ".notify_discord"
|
||||
stage: notify
|
||||
needs: ["publish to public github prebuilt"] # This notify shall only happen after a publish to github public
|
||||
variables:
|
||||
TEMPLATE: "discord_template_notify_dev_public.json"
|
||||
before_script:
|
||||
- !reference [".notify_discord", "before_script"]
|
||||
- export EXTRA_VERSION_IDENTIFIER=$((CI_PIPELINE_IID + BASE_BUILD_NUMER))
|
||||
rules:
|
||||
- if: $NEW_BRANCH == "dev-c3"
|
||||
variables:
|
||||
DISCORD_HOOK: "${DISCORD_NEW_BUILD_WEBHOOK_URL}" # Overriding hook because we know we are dev-c3
|
||||
- !reference [".notify_discord", "rules"]
|
||||
25
.gitmodules
vendored
25
.gitmodules
vendored
@@ -1,18 +1,21 @@
|
||||
[submodule "panda"]
|
||||
path = panda
|
||||
url = https://github.com/sunnyhaibin/panda.git
|
||||
url = ../../commaai/panda.git
|
||||
[submodule "opendbc"]
|
||||
path = opendbc_repo
|
||||
url = https://github.com/sunnypilot/opendbc.git
|
||||
[submodule "msgq"]
|
||||
path = msgq_repo
|
||||
url = https://github.com/sunnypilot/msgq.git
|
||||
path = opendbc
|
||||
url = ../../commaai/opendbc.git
|
||||
[submodule "laika_repo"]
|
||||
path = laika_repo
|
||||
url = ../../commaai/laika.git
|
||||
[submodule "cereal"]
|
||||
path = cereal
|
||||
url = ../../commaai/cereal.git
|
||||
[submodule "rednose_repo"]
|
||||
path = rednose_repo
|
||||
url = https://github.com/commaai/rednose.git
|
||||
[submodule "teleoprtc_repo"]
|
||||
path = teleoprtc_repo
|
||||
url = https://github.com/commaai/teleoprtc
|
||||
url = ../../commaai/rednose.git
|
||||
[submodule "body"]
|
||||
path = body
|
||||
url = ../../commaai/body.git
|
||||
[submodule "tinygrad"]
|
||||
path = tinygrad_repo
|
||||
url = https://github.com/tinygrad/tinygrad.git
|
||||
url = https://github.com/geohot/tinygrad.git
|
||||
|
||||
25
.idea/customTargets.xml
generated
25
.idea/customTargets.xml
generated
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CLionExternalBuildManager">
|
||||
<target id="a62f99e8-5ec4-434c-8122-49efed5af108" name="Poetry SCons Build Debug" defaultType="TOOL">
|
||||
<configuration id="b93ec964-16e5-4962-a12e-3ed360ce8f02" name="Poetry SCons Build Debug">
|
||||
<build type="TOOL">
|
||||
<tool actionId="Tool_External Tools_Poetry SCons Build Debug" />
|
||||
</build>
|
||||
<clean type="TOOL">
|
||||
<tool actionId="Tool_External Tools_Poetry SCons Clean" />
|
||||
</clean>
|
||||
</configuration>
|
||||
</target>
|
||||
<target id="edd8ad9d-183b-467c-a355-0d9a0ecab026" name="Poetry SCons Build Release" defaultType="TOOL">
|
||||
<configuration id="09523339-5ce3-4223-ab9e-904f38ad7752" name="Poetry SCons Build Release">
|
||||
<build type="TOOL">
|
||||
<tool actionId="Tool_External Tools_Poetry SCons Build Release" />
|
||||
</build>
|
||||
<clean type="TOOL">
|
||||
<tool actionId="Tool_External Tools_Poetry SCons Clean" />
|
||||
</clean>
|
||||
</configuration>
|
||||
</target>
|
||||
</component>
|
||||
</project>
|
||||
23
.idea/tools/External Tools.xml
generated
23
.idea/tools/External Tools.xml
generated
@@ -1,23 +0,0 @@
|
||||
<toolSet name="External Tools">
|
||||
<tool name="Poetry SCons Build Debug" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
|
||||
<exec>
|
||||
<option name="COMMAND" value="bash" />
|
||||
<option name="PARAMETERS" value="-c "source .venv/bin/activate && scons -u -j$(nproc) --compile_db --ccflags=\"-fno-inline\""" />
|
||||
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
|
||||
</exec>
|
||||
</tool>
|
||||
<tool name="Poetry SCons Clean" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
|
||||
<exec>
|
||||
<option name="COMMAND" value="bash" />
|
||||
<option name="PARAMETERS" value="-c "source .venv/bin/activate && scons -c" " />
|
||||
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
|
||||
</exec>
|
||||
</tool>
|
||||
<tool name="Poetry SCons Build Release" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
|
||||
<exec>
|
||||
<option name="COMMAND" value="bash" />
|
||||
<option name="PARAMETERS" value="-c "source .venv/bin/activate && scons -u -j$(nproc) --compile_db" " />
|
||||
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
|
||||
</exec>
|
||||
</tool>
|
||||
</toolSet>
|
||||
@@ -1,41 +0,0 @@
|
||||
[importlinter]
|
||||
root_packages =
|
||||
openpilot
|
||||
|
||||
[importlinter:contract:1]
|
||||
name = Forbid imports from openpilot.selfdrive.car to openpilot.system
|
||||
type = forbidden
|
||||
source_modules =
|
||||
openpilot.selfdrive.car
|
||||
forbidden_modules =
|
||||
openpilot.system
|
||||
openpilot.body
|
||||
openpilot.docs
|
||||
openpilot.msgq
|
||||
openpilot.panda
|
||||
openpilot.rednose
|
||||
openpilot.release
|
||||
openpilot.teleoprtc
|
||||
openpilot.tinygrad
|
||||
ignore_imports =
|
||||
openpilot.selfdrive.car.card -> openpilot.common.realtime
|
||||
openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events
|
||||
openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events
|
||||
openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.logreader
|
||||
openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.car.card
|
||||
openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.route
|
||||
openpilot.selfdrive.car.tests.test_models -> openpilot.system.hardware.hw
|
||||
openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers
|
||||
openpilot.selfdrive.car.isotp_parallel_query -> openpilot.common.swaglog
|
||||
openpilot.selfdrive.car.fw_versions -> openpilot.common.swaglog
|
||||
openpilot.selfdrive.car.disable_ecu -> openpilot.common.swaglog
|
||||
openpilot.selfdrive.car.vin -> openpilot.common.swaglog
|
||||
openpilot.selfdrive.car.ecu_addrs -> openpilot.common.swaglog
|
||||
openpilot.selfdrive.car.car_helpers -> openpilot.common.swaglog
|
||||
openpilot.selfdrive.car.car_helpers -> openpilot.system.version
|
||||
openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.drive_helpers
|
||||
openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_angle
|
||||
openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.longcontrol
|
||||
openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_torque
|
||||
openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_pid
|
||||
unmatched_ignore_imports_alerting = warn
|
||||
@@ -1,4 +1,4 @@
|
||||
[lfs]
|
||||
url = https://gitlab.com/sunnypilot/public/sunnypilot-lfs.git/info/lfs
|
||||
pushurl = ssh://git@gitlab.com/sunnypilot/public/sunnypilot-lfs.git
|
||||
url = https://gitlab.com/commaai/openpilot-lfs.git/info/lfs
|
||||
pushurl = ssh://git@gitlab.com/commaai/openpilot-lfs.git
|
||||
locksverify = false
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[lfs]
|
||||
url = https://gitlab.com/commaai/openpilot-lfs.git/info/lfs
|
||||
pushurl = ssh://git@gitlab.com/commaai/openpilot-lfs.git
|
||||
locksverify = false
|
||||
82
.pre-commit-config.yaml
Normal file
82
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,82 @@
|
||||
repos:
|
||||
- repo: meta
|
||||
hooks:
|
||||
- id: check-hooks-apply
|
||||
- id: check-useless-excludes
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: check-ast
|
||||
exclude: '^(third_party)/'
|
||||
- id: check-json
|
||||
- id: check-toml
|
||||
- id: check-xml
|
||||
- id: check-yaml
|
||||
- id: check-merge-conflict
|
||||
- id: check-symlinks
|
||||
- id: check-added-large-files
|
||||
args: ['--maxkb=100']
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.5
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: '^(third_party/)|(body/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(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
|
||||
- --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: mypy
|
||||
language: system
|
||||
types: [python]
|
||||
args: ['--explicit-package-bases']
|
||||
exclude: '^(third_party/)|(cereal/)|(opendbc/)|(panda/)|(laika/)|(laika_repo/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(xx/)'
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.0.287
|
||||
hooks:
|
||||
- id: ruff
|
||||
exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)'
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: cppcheck
|
||||
name: cppcheck
|
||||
entry: cppcheck
|
||||
language: system
|
||||
types: [c++]
|
||||
exclude: '^(third_party/)|(cereal/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(tools/)|(selfdrive/modeld/thneed/debug/)|(selfdrive/modeld/test/)|(selfdrive/camerad/test/)|(installer/)'
|
||||
args:
|
||||
- --error-exitcode=1
|
||||
- --language=c++
|
||||
- --quiet
|
||||
- --force
|
||||
- -j8
|
||||
- repo: https://github.com/cpplint/cpplint
|
||||
rev: 1.6.1
|
||||
hooks:
|
||||
- id: cpplint
|
||||
exclude: '^(third_party/)|(cereal/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
|
||||
args:
|
||||
- --quiet
|
||||
- --counting=total
|
||||
- --linelength=240
|
||||
# https://google.github.io/styleguide/cppguide.html
|
||||
# relevant rules are whitelisted, see all options with: cpplint --filter=
|
||||
- --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: test_translations
|
||||
name: test translations
|
||||
entry: selfdrive/ui/tests/test_translations.py
|
||||
language: script
|
||||
pass_filenames: false
|
||||
- repo: https://github.com/python-poetry/poetry
|
||||
rev: '1.6.0'
|
||||
hooks:
|
||||
- id: poetry-check
|
||||
- id: poetry-lock
|
||||
name: validate poetry lock
|
||||
args:
|
||||
- --check
|
||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3.11.4
|
||||
@@ -1,10 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build Debug" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/selfdrive/ui" PASS_PARENT_ENVS_2="true" PROJECT_NAME="openpilot-special" TARGET_NAME="Poetry SCons Build Debug" CONFIG_NAME="Poetry SCons Build Debug" RUN_PATH="ui">
|
||||
<envs>
|
||||
<env name="QT_DBL_CLICK_DIST" value="150" />
|
||||
</envs>
|
||||
<method v="2">
|
||||
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,10 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build Release" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/selfdrive/ui" PASS_PARENT_ENVS_2="true" PROJECT_NAME="openpilot-special" TARGET_NAME="Poetry SCons Build Release" CONFIG_NAME="Poetry SCons Build Release" RUN_PATH="ui">
|
||||
<envs>
|
||||
<env name="QT_DBL_CLICK_DIST" value="150" />
|
||||
</envs>
|
||||
<method v="2">
|
||||
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
8
.vscode/extensions.json
vendored
8
.vscode/extensions.json
vendored
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-python.python",
|
||||
"ms-vscode.cpptools",
|
||||
"elagil.pre-commit-helper",
|
||||
"charliermarsh.ruff",
|
||||
]
|
||||
}
|
||||
47
.vscode/launch.json
vendored
47
.vscode/launch.json
vendored
@@ -1,47 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"inputs": [
|
||||
{
|
||||
"id": "python_process",
|
||||
"type": "pickString",
|
||||
"description": "Select the process to debug",
|
||||
"options": [
|
||||
"selfdrive/controls/controlsd.py",
|
||||
"selfdrive/navd/navd.py",
|
||||
"system/timed/timed.py",
|
||||
"tools/sim/run_bridge.py"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cpp_process",
|
||||
"type": "pickString",
|
||||
"description": "Select the process to debug",
|
||||
"options": [
|
||||
"selfdrive/ui/ui"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "args",
|
||||
"description": "Arguments to pass to the process",
|
||||
"type": "promptString"
|
||||
}
|
||||
],
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: openpilot Process",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${input:python_process}",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": true,
|
||||
"args": "${input:args}"
|
||||
},
|
||||
{
|
||||
"name": "C++: openpilot Process",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/${input:cpp_process}",
|
||||
"cwd": "${workspaceFolder}",
|
||||
}
|
||||
]
|
||||
}
|
||||
27
.vscode/settings.json
vendored
27
.vscode/settings.json
vendored
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"editor.tabSize": 2,
|
||||
"editor.insertSpaces": true,
|
||||
"editor.renderWhitespace": "trailing",
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"search.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.venv": true,
|
||||
"**/__pycache__": true
|
||||
},
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.venv": true,
|
||||
"**/__pycache__": true
|
||||
},
|
||||
"python.analysis.exclude": [
|
||||
"**/.git",
|
||||
"**/.venv",
|
||||
"**/__pycache__",
|
||||
// exclude directories that should be using the symlinked version
|
||||
"common/**",
|
||||
"selfdrive/**",
|
||||
"system/**",
|
||||
"third_party/**",
|
||||
"tools/**",
|
||||
]
|
||||
}
|
||||
985
CHANGELOGS.md
985
CHANGELOGS.md
@@ -1,985 +0,0 @@
|
||||
sunnypilot - 0.9.8.0 (2024-xx-xx)
|
||||
========================
|
||||
* Always on driver monitoring toggle
|
||||
************************
|
||||
* UPDATED: Synced with commaai's openpilot
|
||||
* master commit 4ef757c (July 06, 2024)
|
||||
* NEW❗: Default Driving Model: Notre Dame (July 01, 2024)
|
||||
* NEW❗: Longitudinal: Acceleration Personality thanks to kegman, rav4kumar, and arne1282!
|
||||
* Select from three distinct acceleration personalities: Eco, Normal, and Sport
|
||||
* Acceleration personalities are integrated directly into the model's acceleration matrix and can be activated in real-time!
|
||||
* NEW❗: Longitudinal: Dynamic Personality thanks to rav4kumar!
|
||||
* Dynamically adjusts following distance and reaction based on your "Driving Personality" setting
|
||||
* Personalities adapt in real-time to your speed and the distance to the lead car
|
||||
* Provides a more responsive and tailored driving experience compared to predefined settings
|
||||
* UPDATED: Driving Personality: Updated mode names
|
||||
* Aggressive, Moderate, Standard, Relaxed
|
||||
* NEW❗: Hyundai CAN: Enable Cruise Main by Default
|
||||
* Set CRUISE MAIN to ON by default when the car starts, without engaging MADS
|
||||
* This feature only applies when "openpilot Longitudinal Control (Alpha)" is enabled under the "Toggles" menu
|
||||
* NEW❗: Toyota - Enhanced Blind Spot Monitor (BSM) thanks to arne182, rav4kumar, and eFiniLan!
|
||||
* Enables Blind Spot Monitor (BSM) signals parsing in sunnypilot using the factory Blind Spot Monitor (BSM)
|
||||
* sunnypilot will use debugging CAN messages to receive unfiltered BSM signals, allowing detection of more objects
|
||||
* Supported platforms
|
||||
* RAV4 TSS1, equipped with factory Blind Spot Monitoring (BSM)
|
||||
* Lexus LSS1, equipped with factory Blind Spot Monitoring (BSM)
|
||||
* Toyota TSS1/1.5, equipped with factory Blind Spot Monitoring (BSM)
|
||||
* Prius TSS2, equipped with factory Blind Spot Monitoring (BSM)
|
||||
* NOTE: Only enable this feature if your Toyota/Lexus vehicle has factory Blind Spot Monitor equipped, and mentioned in the supported platforms list
|
||||
* UPDATED: Toyota: TSS2 longitudinal: Custom Tuning
|
||||
* Re-tuned and tested by the community (July 1, 2024)
|
||||
* UPDATED: Driving Model Selector v5
|
||||
* NEW❗: Driving Model additions
|
||||
* Notre Dame (July 01, 2024) - NDv3
|
||||
* UPDATED: Neural Network Lateral Control (NNLC)
|
||||
* NEW❗: Remove Lateral Jerk Response (Alpha)
|
||||
* FIXED: Hotfix for "lazy" steering performance in tighter curves thanks to twilsonco!
|
||||
* UPDATED: Toyota: Continued support for Smart DSU (SDSU) and Radar CAN Filter
|
||||
* In response to the official deprecation of support for Smart DSU (SDSU) and Radar CAN Filter in the upstream ([commaai/openpilot#32777](https://github.com/commaai/openpilot/pull/32777)), sunnypilot will continue maintaining software support for Smart DSU (SDSU) and Radar CAN Filter
|
||||
* UPDATED: Continued support for Mapbox navigation
|
||||
* In response to the official temporary deprecation of support for Mapbox navigation in the upstream ([commaai/openpilot#32773](https://github.com/commaai/openpilot/pull/32773)), sunnypilot will continue maintaining software support for Mapbox navigation
|
||||
* NEW❗: Toyota - Automatic Brake Hold (AHB) thanks to AlexandreSato!
|
||||
* When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold
|
||||
* NOTE: Only for Toyota/Lexus vehicles with TSS2/LSS2
|
||||
* NEW❗: Toyota - Automatic Door Locking and Unlocking thanks to AlexandreSato, cydia2020, and dragonpilot-community!
|
||||
* Auto Lock by Speed: All doors are automatically locked when vehicle speed is approximately 6 mph (10 km/h) or higher
|
||||
* Auto Unlock by Shift to P: All doors are automatically unlocked when shifting the shift lever to P
|
||||
* FIXED: Driving Personality:
|
||||
* Maniac mode now correctly enforced when selected
|
||||
* FIXED: Experimental Model Distance Button Hold
|
||||
* Experimental Model toggle with distance button hold no longer changes Personality
|
||||
* Personality setting remains consistent when switching between Chill and Experimental Mode
|
||||
* UI Updates
|
||||
* Display Metrics Below Chevron
|
||||
* NEW❗: Time to Lead Car
|
||||
* Displays the time to reach the position previously occupied by the lead car
|
||||
* NEW❗: Display Distance, Speed, and Time to Lead Car simultaneously
|
||||
* Ford F-150 2022-23 support
|
||||
* Ford F-150 Lightning 2021-23 support
|
||||
* Ford Mustang Mach-E 2021-23 support
|
||||
* Hyundai Kona Electric Non-SCC 2019 support thanks to NikitaNekrasov!
|
||||
* Kia Ceed Plug-in Hybrid Non-SCC 2022 support thanks to TerminatorNL!
|
||||
|
||||
sunnypilot - 0.9.7.1 (2024-06-13)
|
||||
========================
|
||||
* New driving model
|
||||
* Inputs the past curvature for smoother and more accurate lateral control
|
||||
* Simplified neural network architecture in the model's last layers
|
||||
* Minor fixes to desire augmentation and weight decay
|
||||
* New driver monitoring model
|
||||
* Improved end-to-end bit for phone detection
|
||||
* Adjust driving personality with the follow distance button
|
||||
* Support for hybrid variants of supported Ford models
|
||||
* Fingerprinting without the OBD-II port on all cars
|
||||
* Improved fuzzy fingerprinting for Ford and Volkswagen
|
||||
************************
|
||||
* UPDATED: Synced with commaai's openpilot
|
||||
* master commit f8cb04e (June 10, 2024)
|
||||
* NEW❗: sunnylink (Alpha early access)
|
||||
* NEW❗: Config/Settings Backup
|
||||
* Remotely back up and restore sunnypilot settings easily
|
||||
* Device registration with sunnylink ensures a secure, integrated experience across services
|
||||
* AES encryption derived from the device's RSA private key is used for utmost security
|
||||
* Settings are encrypted on-device, transmitted securely via HTTPS, and stored encrypted on sunnylink
|
||||
* Prevents loss of settings after device resets, offering peace of mind through end-to-end encryption
|
||||
* Early alpha access to all current and previous GitHub Sponsors and Patreon supporters
|
||||
* GitHub account pairing from device settings scanning QR code
|
||||
* Pairing your account will allow you to access features via our API (still WIP but accessible if you dig a little on our code 😉)
|
||||
* Allow inheritance of your sponsorship status, allowing you to get extra features and early access whenever applicable
|
||||
* NEW❗: iOS Siri Shortcuts Navigation support thanks to twilsonco and mike86437!
|
||||
* iOS and macOS Shortcuts to quickly set navigation destinations from your iOS device
|
||||
* comma Prime support
|
||||
* Personal Mapbox/Amap/Google Maps token support
|
||||
* Instructions on how to set up your iOS Siri Shortcuts: https://routinehub.co/shortcut/17677/
|
||||
* NEW❗: Forced Offroad mode
|
||||
* Force sunnypilot in the offroad state even when the car is on
|
||||
* When Forced Offroad mode is on, allows changing offroad-only settings even when the car is turned on
|
||||
* To engage/disengage Force Offroad, go to Settings -> Device panel
|
||||
* NEW❗: Ford CAN-FD longitudinal
|
||||
* NEW❗: Parse speed limit sign recognition from camera for certain supported platforms
|
||||
* UPDATED: Auto Lane Change Timer -> Auto Lane Change by Blinker
|
||||
* NEW❗: New "Off" option to disable lane change by blinker
|
||||
* UPDATED: Pause Lateral Below Speed with Blinker
|
||||
* NEW❗: Customizable Pause Lateral Speed
|
||||
* Pause lateral actuation with blinker when traveling below the desired speed selected. Default is 20 MPH or 32 km/h.
|
||||
* UPDATED: Hyundai CAN Longitudinal
|
||||
* Auto-enable radar tracks on platforms with applicable Mando radar
|
||||
* UPDATED: Hyundai CAN-FD Radar-based SCC
|
||||
* Longitudinal support for CAN-FD Radar-based SCC cars
|
||||
* UPDATED: Hyundai CAN-FD Camera-based SCC
|
||||
* NEW❗: Parse lead info for camera-based SCC platforms with longitudinal support
|
||||
* Improve lead tracking when using openpilot longitudinal
|
||||
* RE-ENABLED: Map-based Turn Speed Control (M-TSC) for supported platforms
|
||||
* openpilot Longitudinal Control available cars
|
||||
* Custom Stock Longitudinal Control available cars
|
||||
* UPDATED: Continued support for comma Pedal
|
||||
* In response to the official deprecation of support for comma Pedal in the upstream, sunnypilot will continue maintaining software support for comma Pedal
|
||||
* UPDATED: Driving Model Selector v4
|
||||
* NEW❗: Driving Model additions
|
||||
* North Dakota (April 29, 2024) - NDv2
|
||||
* WD40 (April 09, 2024) - WD40
|
||||
* Duck Amigo (March 18, 2024) - DA
|
||||
* Recertified Herbalist (March 01, 2024) - CHLR
|
||||
* Legacy Driving Models with Navigate on openpilot (NoO) support
|
||||
* Includes Duck Amigo and all preceding models
|
||||
* UPDATED: Bumping mapd by [@pfeiferj](https://github.com/pfeiferj) to version [v1.9.0](https://github.com/pfeiferj/mapd/releases/tag/v1.9.0) thanks to pfeiferj!
|
||||
* UPDATED: Reset Mapbox Access Token -> Reset Access Tokens for Map Services
|
||||
* Reset self-service access tokens for Mapbox, Amap, and Google Maps
|
||||
* UPDATED: Upstream native support for Gap Adjust Cruise
|
||||
* UPDATED: Neural Network Lateral Control (NNLC)
|
||||
* Due to upstream changes with platform simplifications, most platforms will match and fallback to combined platform model
|
||||
* This will be updated when the new mapping of platforms are restructured (thanks @twilsonco 😉)
|
||||
* UI Updates
|
||||
* Display Metrics Below Chevron
|
||||
* NEW❗: Metrics is now being displayed below the chevron instead of above
|
||||
* NEW❗: Display both Distance and Speed simultaneously
|
||||
* NEW❗: View sunnylink connectivity status on the left sidebar!
|
||||
|
||||
sunnypilot - 0.9.6.2 (2024-05-29)
|
||||
========================
|
||||
* REMOVED: Screen Recorder
|
||||
* Screen Recorder is removed due to unnecessary resource usage
|
||||
* An improved version will be available in the near future. Stay tuned!
|
||||
|
||||
sunnypilot - 0.9.6.1 (2024-02-27)
|
||||
========================
|
||||
* New driving model
|
||||
* Vision model trained on more data
|
||||
* Improved driving performance
|
||||
* Directly outputs curvature for lateral control
|
||||
* New driver monitoring model
|
||||
* Trained on larger dataset
|
||||
* AGNOS 9
|
||||
* comma body streaming and controls over WebRTC
|
||||
* Improved fuzzy fingerprinting for many makes and models
|
||||
* Alpha longitudinal support for new Toyota models
|
||||
* Chevrolet Equinox 2019-22 support thanks to JasonJShuler and nworb-cire!
|
||||
* Dodge Durango 2020-21 support
|
||||
* Hyundai Staria 2023 support thanks to sunnyhaibin!
|
||||
* Kia Niro Plug-in Hybrid 2022 support thanks to sunnyhaibin!
|
||||
* Lexus LC 2024 support thanks to nelsonjchen!
|
||||
* Toyota RAV4 2023-24 support
|
||||
* Toyota RAV4 Hybrid 2023-24 support
|
||||
************************
|
||||
* UPDATED: Synced with commaai's openpilot
|
||||
* master commit db57a21 (February 22, 2024)
|
||||
* v0.9.6 release (February 27, 2024)
|
||||
* UPDATED: Dynamic Experimental Control (DEC)
|
||||
* Synced with dragonpilot-community/dragonpilot:beta3 commit f4ee52f
|
||||
* NEW❗: Default Driving Model: Certified Herbalist v2 (February 13, 2024)
|
||||
* UPDATED: Driving Model Selector v3
|
||||
* NEW❗: Driving Model additions
|
||||
* Certified Herbalist v2 (February 13, 2024) - CHv2
|
||||
* Certified Herbalist (February 5, 2024) - CH
|
||||
* Los Angeles v2 (January 24, 2024) - LAv2
|
||||
* Los Angeles (January 22, 2024) - LAv1
|
||||
* NEW❗: Model Caching thanks to DevTekVE!
|
||||
* Model caching allows the selection of previously downloaded Driving Model
|
||||
* Users can now access cached versions of selected models, eliminating redundant downloads for previously fetched models
|
||||
* Legacy Driving Models support
|
||||
* New Delhi (December 21, 2023) - ND
|
||||
* Blue Diamond v2 (December 11, 2023) - BDv2
|
||||
* Blue Diamond (November 18, 2023) - BDv1
|
||||
* Farmville (November 7, 2023) - FV
|
||||
* Night Strike (October 3, 2023) - NS
|
||||
* Certain features are deprecated with newer Driving Models
|
||||
* Dynamic Lane Profile (DLP)
|
||||
* Custom Offsets
|
||||
* UPDATED: Dynamic Lane Profile (DLP)
|
||||
* Continued support for Legacy Driving Models (e.g., ND, BDv2, BDv1, FV, NS)
|
||||
* Deprecated support for newer Driving Models (e.g., CHv2, CH, LAv2, LAv1)
|
||||
* UPDATED: Custom Offsets
|
||||
* Continued support for Legacy Driving Models (e.g., ND, BDv2, BDv1, FV, NS)
|
||||
* Deprecated support for newer Driving Models (e.g., CHv2, CH, LAv2, LAv1)
|
||||
* UPDATED: Hyundai/Kia/Genesis - ESCC Radar Interceptor
|
||||
* Message parsing improvements with the latest firmware update: https://github.com/sunnypilot/panda/tree/test-escc-smdps
|
||||
* UI Updates
|
||||
* NEW❗: Visuals: Display Feature Status toggle
|
||||
* Display the statuses of certain features on the driving screen
|
||||
* NEW❗: Visuals: Enable Onroad Settings toggle
|
||||
* Display the Onroad Settings button on the driving screen to adjust feature options on the driving screen, without navigating into the settings menu
|
||||
* REMOVED: "Device ambient" temperature option on the sidebar
|
||||
* FIXED: New comma 3X support
|
||||
* FIXED: New comma eSIM support
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - 0.9.5.3 (2023-12-24)
|
||||
========================
|
||||
* UPDATED: Dynamic Experimental Control (DEC)
|
||||
* Synced with dragonpilot-community/dragonpilot:lp-dp-beta2 commit 578d38b
|
||||
* UPDATED: Driving Model Selector v2
|
||||
* Driving models sort in descending order based on availability date
|
||||
* Experimental/unmerged driving models are only available in "dev-c3" branch
|
||||
* To select and use experimental driving models, navigate to "Software" panel, select the "dev-c3" branch, and check for update
|
||||
* UPDATED: Vision-based Turn Speed Control (V-TSC) implementation
|
||||
* Refactored implementation thanks to pfeiferj!
|
||||
* More accurate and consistent velocity calculation to achieve smoother longitudinal control in curves
|
||||
* NEW❗: Speed Limit Warning
|
||||
* Display alert and/or chime to warn the driver when the cruising speed is faster than the speed limit plus the Warning Offset
|
||||
* Customizable Warning Offset, independent of Speed Limit Control (SLC)'s Limit Offset
|
||||
* UPDATED: Speed Limit Source Policy
|
||||
* Selectable speed limit source for Speed Limit Control and Speed Limit Warning
|
||||
* Applicable to: Speed Limit Control, Speed Limit Warning
|
||||
* UPDATED: Speed Limit Control (SLC)
|
||||
* Engage Mode: Removed "Warning Only" mode - this has been replaced by the new Speed Limit Warning sub-menu
|
||||
* UPDATED: OpenStreetMap (OSM) implementation
|
||||
* Refactored implementation thanks to pfeiferj!
|
||||
* Less resource impact
|
||||
* Significantly smaller sizes with databases
|
||||
* All regions are available to download
|
||||
* Weekly map updates thanks to pfeiferj!
|
||||
* Increased the font size of the road name
|
||||
* C3X-specific changes
|
||||
* Altitude (ALT.) display on Developer UI
|
||||
* Current street name on top of driving screen when "OSM Debug UI" is enabled
|
||||
* UPDATED: Map-based Turn Speed Control (M-TSC) implementation
|
||||
* Only available in "staging-c3" and "dev-c3" branches. If you are using "release-c3" branch, navigate to "Software" panel, select the desired target branch, and check for update
|
||||
* Refactored implementation thanks to pfeiferj!
|
||||
* Based on the new OpenStreetMap implementation
|
||||
* Improved predicted curvature calculations from OpenStreetMap data
|
||||
* UI updates
|
||||
* RE-ENABLED: Navigation: Full screen support
|
||||
* Display the map view in full screen
|
||||
* To switch back to driving view, tap on the border edge
|
||||
* Hyundai Bayon Non-SCC 2019 support thanks to polein78!
|
||||
|
||||
sunnypilot - 0.9.5.2 (2023-12-07)
|
||||
========================
|
||||
* NEW❗: MADS: Allow Navigate on openpilot in Chill Mode
|
||||
* Allow navigation to feed map view into the driving model while using Chill Mode
|
||||
* Support all platforms, including platforms that do not support openpilot longitudinal control & Experimental Mode
|
||||
* NEW❗: Neural Network Lateral Controller
|
||||
* Formerly known as "NNFF", this replaces the lateral "torque" controller with one using a neural network trained on each car's (actually, each separate EPS firmware) driving data for increased controls accuracy
|
||||
* Contact @twilsonco in the sunnypilot Discord server with feedback, or to provide log data for your car if your car is currently unsupported
|
||||
* NEW❗: Driving Model Selector
|
||||
* Easily switch between driving models without reinstalling branches. Offering immediate access to the latest models upon release
|
||||
* An internet connection is required for downloading models. Each model switch currently involves downloading the model again. Future updates may allow for offline switching
|
||||
* Warning is displayed for metered connections to avoid unexpected data usage if on cellular data
|
||||
* Change driving models via **Settings -> Software -> Current Driving Model**.
|
||||
* NEW❗: Hyundai CAN longitudinal:
|
||||
* NEW❗: Enable radar tracks for certain Santa Fe platforms
|
||||
* Internal Combustion Engine (ICE) 2021-23
|
||||
* Hybrid 2022-23
|
||||
* Plug-in Hybrid 2022-23
|
||||
* NEW❗: Lane Change: When manually braking with steering engaged, turning on the turn signal will default to Nudge mode
|
||||
* Volkswagen MQB CC only platforms (radar or no radar) support thanks to jyoung8607!
|
||||
|
||||
sunnypilot - 0.9.5.1 (2023-11-17)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master commit e94c3c5
|
||||
* NEW❗: Farmville driving model
|
||||
* NEW❗: Onroad Settings Panel
|
||||
* Onroad buttons (i.e., DLP, GAC) moved to its dedicated panel
|
||||
* Driving Personality
|
||||
* Dynamic Lane Profile (DLP)
|
||||
* Dynamic Experimental Control (DEC)
|
||||
* Speed Limit Control (SLC)
|
||||
* NEW❗: Display main feature status on onroad view in real-time
|
||||
* GAP - Driving Personality
|
||||
* DLP - Dynamic Lane Profile
|
||||
* DEC - Dynamic Experimental Control
|
||||
* SLC - Speed Limit Control
|
||||
* NEW❗: Dynamic Experimental Control (DEC) thanks to dragonpilot-community!
|
||||
* Automatically determines and selects between openpilot ACC and openpilot End to End longitudinal based on conditions for a more natural drive
|
||||
* Dynamic Experimental Control is only active while in Experimental Mode
|
||||
* When Dynamic Experimental Control is ON, initially setting cruise speed will set to the vehicle's current speed
|
||||
* NEW❗: Hyundai CAN longitudinal:
|
||||
* NEW❗: Parse lead info for camera-based SCC platforms
|
||||
* Improve lead tracking when using openpilot longitudinal
|
||||
* NEW❗: Parse lead distance to display on car cluster
|
||||
* Introduced better lead distance calculation to display on the car's cluster, replacing the binary "lead visible" indication on the SCC cluster
|
||||
* Lead distance is now categorized into different ranges for more detailed and comprehensive information to the driver similar to how stock ACC does it
|
||||
* NEW❗: Parse speed limit sign recognition from camera for certain supported platforms
|
||||
* NEW❗: Subaru - Stop and Go auto-resume support thanks to martinl!
|
||||
* Global (excluding Gen 2 and Hybrid) and Pre-Global support
|
||||
* NEW❗: Toyota - Stop and Go hack
|
||||
* Allow some Toyota/Lexus cars to auto resume during stop and go traffic
|
||||
* Only applicable to certain models and model years
|
||||
* NEW❗: Toyota: ZSS support thanks to dragonpilot-community and ErichMoraga!
|
||||
* NEW❗: MSPA (Cereal structs refactor)
|
||||
* Make sunnypilot Parsable Again - @sshane
|
||||
* sunnypilot is now parsable with stock openpilot tools
|
||||
* NEW❗: Display 3D buildings on map thanks to jakethesnake420!
|
||||
* openpilot Longitudianl Control capable cars only
|
||||
* UPDATED: Gap Adjust Cruise is now a part of Driving Personality
|
||||
* [DISTANCE/FOLLOW DISTANCE/GAP DISTANCE] physical button on the steering wheel to select Driving Personality on by default
|
||||
* Status now viewable in onroad view or Onroad Settings Panel
|
||||
* REMOVED: Gap Adjust Cruise toggle
|
||||
* UPDATED: Speed Limit Control (SLC)
|
||||
* NEW❗: Speed Limit Engage Mode
|
||||
* Select the desired mode to set the cruising speed to the speed limit
|
||||
* Warning Only: Warn the driver when the vehicle is driven faster than the speed limit
|
||||
* Auto: Automatic speed adjustment on motorways based on speed limit data
|
||||
* User Confirm: Inform the driver to change set speed of Adaptive Cruise Control to help the driver stay within the speed limit
|
||||
* Supported platforms
|
||||
* openpilot Longitudinal Control available cars (Excluding certain Toyota/Lexus, Ford, explained below)
|
||||
* Custom Stock Longitudinal Control available cars
|
||||
* Unsupported platforms
|
||||
* Toyota/Lexus and Ford - most platforms do not allow us to control the PCM's set speed, requires testers to verify
|
||||
* NEW❗: Speed limit source selector
|
||||
* Select the desired precedence order of sources used to adapt cruise speed to road limits
|
||||
* UPDATED: Custom Stock Longitudinal Control
|
||||
* RE-ENABLED: Hyundai/Kia/Genesis CAN-FD platforms
|
||||
* UPDATED: Custom Offsets reimplementation
|
||||
* Camera Offset only works in Laneful (Laneful Only or Laneful in Auto mode when using Dynamic Lane Profile)
|
||||
* Path Offset can be applied to both Laneless and Laneful
|
||||
* UPDATED: Refactored Torque Lateral Control custom tuning menu
|
||||
* NEW❗: Less Restrict Settings for Self-Tune (Beta)
|
||||
* NEW❗: Custom Tuning for setting offline and live values in real-time
|
||||
* UPDATED: Auto-detect custom Mapbox token if a personal Mapbox token is provided
|
||||
* REMOVED: "Enable Mapbox Navigation" toggle
|
||||
* UI updates
|
||||
* New Settings menu redesign and improved interactions
|
||||
* FIXED: Retain hotspot/tethering state was not consistently saved
|
||||
* FIXED: Map stuck in "Map Loading" if comma Prime is active
|
||||
* FIXED: OpenStreetMap implementation on C3X devices
|
||||
* M-TSC
|
||||
* Altitude (ALT.) display on Developer UI
|
||||
* Current street name on top of driving screen when "OSM Debug UI" is enabled
|
||||
* Hyundai Kona Non-SCC 2019 support thanks to Quex!
|
||||
* Kia Seltos Non-SCC 2023-24 support thanks to Moodkiller and jeroid_!
|
||||
|
||||
sunnypilot - 0.9.4.1 (2023-08-11)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's 0.9.4 release
|
||||
* NEW❗: Moonrise driving model
|
||||
* NEW❗: Ford upstream models support
|
||||
* UPDATED: Dynamic Lane Profile selector in the "SP - Controls" menu
|
||||
* REMOVED: Dynamic Lane Profile driving screen UI button
|
||||
* FIXED: Disallow torque lateral control for angle control platforms (e.g. Ford, Nissan, Tesla)
|
||||
* Torque lateral control cannot be used by angle control platforms, and would cause a "Controls Unresponsive" error if Torque lateral control is enforced in settings
|
||||
* REMOVED: Speed Limit Style override
|
||||
* Honda Accord 2016-17 support thanks to mlocoteta!
|
||||
* Serial Steering hardware required. For more information, see https://github.com/mlocoteta/serialSteeringHardware
|
||||
* mapd: utilize advisory speed limit in curves (#142) thanks to pfeiferj!
|
||||
|
||||
sunnypilot - 0.9.3.1 (2023-07-09)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's 0.9.3 release
|
||||
* NEW❗: Display Temperature on Sidebar toggle
|
||||
* Display Ambient temperature, memory temperature, CPU core with the highest temperature, GPU temperature, or max of Memory/CPU/GPU on the sidebar
|
||||
* Replace "Display CPU Temperature on Sidebar" toggle
|
||||
* NEW❗: Hot Coffee driving model
|
||||
* NEW❗: HKG CAN: Smoother Stopping Performance (Beta) toggle
|
||||
* Smoother stopping behind a stopped car or desired stopping event.
|
||||
* This is only applicable to HKG CAN platforms using openpilot longitudinal control
|
||||
* NEW❗: Toyota: TSS2 longitudinal: Custom Tuning
|
||||
* Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars thanks to dragonpilot-community!
|
||||
* NEW❗: Enable Screen Recorder toggle
|
||||
* Enable this will display a button on the onroad screen to toggle on or off real-time screen recording with UI elements.
|
||||
* IMPROVED: Dynamic Lane Profile: when using Laneline planner via Laneline Mode or Auto Mode, enforce Laneless planner while traveling below 10 MPH or 16 km/h
|
||||
* REMOVED: Display CPU Temperature on Sidebar
|
||||
|
||||
sunnypilot - 0.9.2.3 (2023-06-18)
|
||||
========================
|
||||
* NEW❗: Auto Lane Change: Delay with Blind Spot
|
||||
* Toggle to enable a delay timer for seamless lane changes when blind spot monitoring (BSM) detects an obstructing vehicle, ensuring safe maneuvering
|
||||
* NEW❗: Driving Screen Off: Wake with Non-Critical Events
|
||||
* When Driving Screen Off Timer is not set to "Always On":
|
||||
* Enabled: Wake the brightness of the screen to display all events
|
||||
* Disabled: Wake the brightness of the screen to display critical events
|
||||
* Currently, all non-nudge modes are default to continue lane change after 1 seconds of blind spot detection
|
||||
* NEW❗: Fleet Manager PIN Requirement toggle
|
||||
* User can now enable or disable PIN requirement on the comma device before accessing Fleet Manager
|
||||
* NEW❗: Reset all sunnypilot settings toggle
|
||||
* NEW❗: Turn signals display on screen when blinker is used
|
||||
* Green: Blinker is on
|
||||
* Red: Blinker is on, car detected in the adjacent blind spot or road edge detected
|
||||
* IMPROVED: mapd: better exceptions handling when loading dependencies
|
||||
* UPDATED: Green Traffic Light Chime no longer displays an orange border when executed
|
||||
* FIXED: mapd: Road name flashing caused by desync with last GPS timestamp
|
||||
* FIXED: Ram HD (2500/3500): Ignore paramsd sanity check
|
||||
* Live parameters have trouble with self-tuning on this platform with upstream openpilot 0.9.2
|
||||
* Hyundai: Longitudinal support for CAN-based Camera SCC cars thanks to Zack1010OP's Patreon sponsor!
|
||||
|
||||
sunnypilot - 0.9.2.2 (2023-06-13)
|
||||
========================
|
||||
* NEW❗: Toyota: Allow M.A.D.S. toggling with LKAS Button (Beta)
|
||||
* IMPROVED: Ram: cruise button handling
|
||||
|
||||
sunnypilot - 0.9.2.1 (2023-06-10)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's 0.9.2 release
|
||||
* UPDATED: feature revamp with better stability
|
||||
* UPDATED:
|
||||
* M.A.D.S.
|
||||
* Path color becomes LIGHT ORANGE during Driver Steering Override
|
||||
* Gap Adjust Cruise (now known as Driving Personality in upstream openpilot 0.9.3):
|
||||
* Updated profiles and jerk changes
|
||||
* Experimental Mode support
|
||||
* Three settings: Stock, Aggressive, and Maniac
|
||||
* Stock is recommended and the default
|
||||
* In Aggressive/Maniac mode, lead follow distance is shorter and quicker gas/brake response
|
||||
* Dynamic Lane Profile
|
||||
* Display blue borders on both sides of the driving path when Laneline mode is being used in the planner
|
||||
* Auto Mode optimization
|
||||
* Permanent: Laneless during Auto Lane Change execution
|
||||
* Mapd
|
||||
* OpenStreetMap Database: new regions added
|
||||
* Developer UI (Dev UI)
|
||||
* REMOVED: 2-column design
|
||||
* NEW❗: 1-column + 1-row design
|
||||
* Custom Stock Longitudinal Control
|
||||
* NEW❗: Chrysler/Jeep/Ram support
|
||||
* NEW❗: Mazda support
|
||||
* NEW❗: Volkswagen PQ support
|
||||
* DISABLED: Hyundai/Kia/Genesis CAN-FD platforms
|
||||
* NEW❗: Switch between Chill (openpilot ACC) and Experimental (E2E longitudinal) with DISTANCE button on the steering wheel
|
||||
* To switch between Chill and Experimental Mode: press and hold the DISTANCE button on the steering wheel for over 0.5 second
|
||||
* All openpilot longitudinal capable cars support
|
||||
* NEW❗: Nicki Minaj driving model
|
||||
* NEW❗: Nissan and Mazda upstream models support
|
||||
* NEW❗: Pre-Global Subaru upstream models support
|
||||
* NEW❗: Display End-to-end Longitudinal Status (Beta)
|
||||
* Display an icon that appears when the End-to-end model decides to start or stop
|
||||
* NEW❗: Green Traffic Light Chime (Beta)
|
||||
* A chime will play when the traffic light you are waiting for turns green, and you have no vehicle in front of you.
|
||||
* NEW❗: Lead Vehicle Departure Alert
|
||||
* Notify when the leading vehicle drives away
|
||||
* NEW❗: Speedometer: Display True Speed
|
||||
* Display the true vehicle current speed from wheel speed sensors.
|
||||
* NEW❗: Speedometer: Hide from Onroad Screen
|
||||
* NEW❗: Auto-Hide UI Buttons
|
||||
* Hide UI buttons on driving screen after a 30-second timeout. Tap on the screen at anytime to reveal the UI buttons
|
||||
* Applicable to Dynamic Lane Profile (DLP) and Gap Adjust Cruise (GAC)
|
||||
* NEW❗: Display DM Camera in Reverse Gear
|
||||
* Show Driver Monitoring camera while the car is in reverse gear
|
||||
* NEW❗: Block Lane Change: Road Edge Detection (Beta)
|
||||
* Block lane change when road edge is detected on the stalk actuated side
|
||||
* NEW❗: Display CPU Temperature on Sidebar
|
||||
* Display the CPU core with the highest temperature on the sidebar
|
||||
* NEW❗: Display current driving model in Software settings
|
||||
* NEW❗: HKG: smartMDPS automatic detection (installed with applicable firmware)
|
||||
* FIXED: Unintended siren/alarm from the comma device if the vehicle is turned off too quickly in PARK gear
|
||||
* FIXED: mapd: Exception handling for loading dependencies
|
||||
* Fleet Manager via Browser support thanks to actuallylemoncurd, AlexandreSato, ntegan1, and royjr!
|
||||
* Access your dashcam footage, screen recordings, and error logs when the car is turned off
|
||||
* Connect to the device via Wi-Fi, mobile hotspot, or tethering on the comma device, then navigate to http://ipAddress:5050 to access.
|
||||
* Honda Clarity 2018-22 support thanks to mcallbosco, vanillagorillaa and wirelessnet2!
|
||||
* Ram: Steer to 0/7 MPH support thanks to vincentw56!
|
||||
* Retain hotspot/tethering state across reboots thanks to rogerioaguas!
|
||||
|
||||
sunnypilot - Version Latest (2023-02-22)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2023.02.19-04:52:00:GMT - 0.9.2
|
||||
* Refactor sunnypilot features to be more stable
|
||||
|
||||
sunnypilot - Version Latest (2022-12-16)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.12.16-06:31:00:GMT - 0.9.1
|
||||
* NEW❗: GM:
|
||||
* NEW❗: Gap Adjust Cruise support - Chill, Normal, Aggressive
|
||||
* NEW❗: Experimental Mode: Hold DISTANCE button on the steering wheel for 0.5 second to switch between Experimental Mode and Chill Mode
|
||||
* REMOVED❌: Toytoa: SnG Hack
|
||||
* This method is not recommended and may cause some cars to not behave as expected
|
||||
* SDSU is strongly recommended to enable SnG for Toyota vehicles without SnG from factory
|
||||
* commaai: radard: add missing accel data for vision-only leads (commaai/openpilot#26619) - pending PR
|
||||
* VOACC performance is drastically improved when using Chill Mode
|
||||
* IMPROVED: M.A.D.S. events handling
|
||||
* IMPROVED: UI: screen recorder button change
|
||||
* IMPROVED: OpenStreetMap Offline Database optimization
|
||||
* FIXED: Toyota: vehicles' LKAS button no longer has a delay with toggling M.A.D.S.
|
||||
* FIXED: Toyota: brake pedal press at standstill causing Cruise Fault
|
||||
* FIXED: Volkswagen MQB: reduce Camera Malfunction occurrences (requires testing)
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-12-10)
|
||||
========================
|
||||
* IMPROVED: NEW❗ Developer UI design
|
||||
* Second column metrics is now moved to the bottom of the screen
|
||||
* ACC. = Acceleration
|
||||
* L.S. = Lead Speed
|
||||
* E.T. = EPS Torque
|
||||
* B.D. = Bearing Degree
|
||||
* FRI. = Friction
|
||||
* L.A. = Lateral Acceleration
|
||||
* ALT. = Altitude
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-12-07)
|
||||
========================
|
||||
* NEW❗: Screen Recorder support thanks to neokii and Kumar!
|
||||
* NEW❗: End-to-end longitudinal start/stop status icon
|
||||
* Only appears when Experimental Mode is enabled
|
||||
* NEW❗: End-to-end longitudinal car chime when starting
|
||||
* Hyundai/Kia/Genesis CAN platform, Honda/Acura Bosch/Nidec, Toyota/Lexus
|
||||
* i.e. Traffic light turns green, stop sign ready to go, etc.
|
||||
* Only appears when Experimental Mode is enabled AND longitudinal control is disengaged
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-12-05)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.12.04-22:46:00:GMT - 0.9.1
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-11-12)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.11.12-10:02:00:GMT - 0.8.17
|
||||
* FIXED: CAN Error for CAN HKG cars that do not have navigation from the factory
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-11-11)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.11.11-21:22:00:GMT - 0.8.17
|
||||
* commaai: AGNOS 6.2 (commaai/openpilot#26441)
|
||||
* NEW❗: Speed Limit Control - HKG - add speed limit from car's navigation head unit
|
||||
* Compatible with certain models, trims, and model years
|
||||
* DISABLED: FCA: RAM HD - steer down to 0
|
||||
* FIXED: UI: End-to-end longitudinal button on driving screen synchronization
|
||||
* FIXED: Honda: Longitudinal status with set cruise speed now displays properly in the car's dashboard
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-11-08)
|
||||
========================
|
||||
* ADDED: New Zealand offline OpenStreetMap database
|
||||
|
||||
sunnypilot - Version Latest (2022-11-04)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.11.05-01:44:00:GMT - 0.8.17
|
||||
* RE-ENABLED: Dynamic Lane Profile - preserves lanelines
|
||||
* Can be found in "SP - Controls" menu
|
||||
* NEW❗: DLP: switch to laneless for current/future curves thanks to @twilsonco!
|
||||
* Can be found in "SP - Controls" menu
|
||||
* NEW❗: UI: Road Camera Selector
|
||||
* Enable this will display a button on the driving screen to select the driving camera
|
||||
* Can be found in "SP - Visuals" menu
|
||||
* NEW❗: Controls: Camera & Path Custom Offsets
|
||||
* Only applicable to laneline mode when using Dynamic Lane Profile
|
||||
* NEW❗: Buttons on driving screen are now sorted based on priority and availability
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-28)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.28-03:53:00:GMT - 0.8.17
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-26)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.26-06:20:00:GMT - 0.8.17
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-25)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.25-23:53:00:GMT - 0.8.17
|
||||
* Pre-Global Subaru support thanks to @martinl!
|
||||
* NEW❗: Speed Limit values turn red when current speed is higher than posted speed limit
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-23)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.22-23:15:00:GMT - 0.8.17
|
||||
* IMPROVED: Custom Stock Longitudinal Control - HKG - only allow engagement on user button press
|
||||
* IMPROVED: Custom Stock Longitudinal Control - Volkswagen MQB & PQ - more consistent set speed change
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-21)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.21-17:33:00:GMT - 0.8.17
|
||||
* IMPROVED: Custom Stock Longitudinal Control - Volkswagen MQB & PQ - more predictable button send logic
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-20)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.20-20:25:00:GMT - 0.8.17
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-19)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.19-08:31:00:GMT - 0.8.17
|
||||
* IMPROVED: Controls: Speed Limit Control - accelerator press only disengage if "Disengage on Accelerator Pedal" is enabled
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-18)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.18-04:44:00:GMT - 0.8.17
|
||||
* RE-ENABLED: Volkswagen MQB & PQ with Custom Stock Longitudinal Control
|
||||
* NEW❗: Steering Rate Cost Live Tune
|
||||
* Enables live tune for Steering Rate Cost. Lower value allows steering wheel to move more freely at low speed
|
||||
* Can be found in "SP - Controls" menu
|
||||
* FIXED: MADS: GM - include Regen Paddle logic thanks to @twilsonco!
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-17)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.17-23:54:00:GMT+1 - 0.8.17
|
||||
* ENABLED: "Custom Stock Longitudinal Control" toggle for CAN-FD cars
|
||||
* FIXED: HKG CAN-FD: Could not engage when openpilot longitudinal is enabled
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-13)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.13-19:43:00:GMT+1 - 0.8.17
|
||||
* ADDED: Live Tmux toggle
|
||||
* Can be found in "SP - General" menu
|
||||
* IMPROVED: OpenStreetMap Database Update - only check for database update with explicit user decision
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-11)
|
||||
========================
|
||||
* ADDED: Hyundai openpilot longitudinal improvements - huge thanks to @aragon7777!
|
||||
* ADDED: Check for OpenStreetMap Database Update button
|
||||
* UPDATED: commaai: Low speed lateral control improvements (commaai:openpilot#26022, bbcd448) - pending PR
|
||||
* FIXED: MUTCD speed limit spacing adjusts dynamically when no subtext is shown (i.e., speed limit offset, distance to next speed limit)
|
||||
* FIXED: MADS: Intermittent CAN Error when engaging for Toyota Prius TSS-P
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-09)
|
||||
========================
|
||||
* ADDED: commaai: Low speed lateral control improvements (commaai:openpilot#26022, bca288bb) - pending PR
|
||||
* FIXED: MADS: Intermittent CAN Error when engaging for Toyota Prius TSS-P
|
||||
* IMPROVED: mapd: stop signs and other supported traffic_calming tags are now slowing/stopping as expected
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-08)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.08-12:07:00:GMT+1 - 0.8.17
|
||||
* FIXED: MADS: Intermittent CAN Error when engaging for Toyota Prius TSS-P
|
||||
* IMPROVED: mapd: Speed Humps are now set at 20 MPH or 32 km/h
|
||||
* IMPROVED: OpenStreetMap Offline Database download experience
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-10-07)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.10.07-08:16:00:GMT - 0.8.17
|
||||
* NEW❗: OpenStreetMap database can now be downloaded locally for offline use
|
||||
* Now offering US South, US West, US Northeast, US Florida, Taiwan, and South Africa
|
||||
* Databases updated - 2022.10.05-03:30:00:GMT
|
||||
* NEW❗: mapd: Stop Sign, Yield, Speed Bump, Speed Hump, Sharp Curve support - huge thanks to @move-fast and @dragonpilot-community!
|
||||
* Go to https://openstreetmap.org and start mapping out your area!
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-09-30)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.30-22:43:00:GMT - 0.8.17
|
||||
* RE-ADDED: Torque Lateral Controller Live Tune Menu
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-09-23)
|
||||
========================
|
||||
* ADDED: Developer UI: latAccelFactorFiltered & frictionCoefficientFiltered values displays in green if Torque is using live params
|
||||
* Bug fixes and performance improvements
|
||||
|
||||
sunnypilot - Version Latest (2022-09-22)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.19-22:19:00:GMT - 0.8.17
|
||||
* NEW❗: Toggle to explicitly enable Custom Stock Longitudinal Control
|
||||
* Applicable cars only: Honda, Hyundai/Kia/Genesis
|
||||
* Settings -> Toggles menu
|
||||
|
||||
sunnypilot - Version Latest (2022-09-21)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.19-22:19:00:GMT - 0.8.17
|
||||
* ADDED: Toggle to enable Live Torque (self/auto tune) with Torque lateral controller
|
||||
* To enable, first enable "Enforce Torque Lateral Controller" toggle
|
||||
* UPDATED: New metrics in Developer UI (when Live Torque is enabled)
|
||||
* REMOVED: latAccelFactorRaw & frictionCoefficientRaw from torqued
|
||||
* ADDED: latAccelFactorFiltered & frictionCoefficientFiltered from torqued
|
||||
* REMOVED: Temporary remove Torque Lateral Controller Live Tune Menu
|
||||
|
||||
sunnypilot - Version Latest (2022-09-20)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.19-22:19:00:GMT - 0.8.17
|
||||
* ADDED: Toggle to enable Live Torque (self/auto tune) with Torque lateral controller
|
||||
* To enable, first enable "Enforce Torque Lateral Controller" toggle
|
||||
* REMOVED: Temporary remove Torque Lateral Controller Live Tune Menu
|
||||
|
||||
sunnypilot - Version Latest (2022-09-18)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.17-11:23:00:GMT - 0.8.17
|
||||
* ADDED: Kia Forte Non-SCC 2019 support for @askalice
|
||||
* FIXED: Torque Lateral Control Live Tune now syncs with commaai:openpilot#25822
|
||||
* FIXED: mapd dependencies no longer need to be re-downloaded after unknown reboots
|
||||
|
||||
sunnypilot - Version Latest (2022-09-17)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.17-11:23:00:GMT - 0.8.17
|
||||
* NEW❗: Non SCC HKG support
|
||||
* Custom Stock Longitudinal Control
|
||||
* ❗No❗ openpilot longitudinal control
|
||||
* FIXED: Honda Bosch random low-value set speed changes
|
||||
|
||||
sunnypilot - Version Latest (2022-09-16)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.16-20:23:00:GMT - 0.8.17
|
||||
|
||||
sunnypilot - Version Latest (2022-09-15)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.16-02:00:00:GMT - 0.8.17
|
||||
* FIXED: Block additional auto lane change actions if blinker stays on after the first lane change
|
||||
* REVERTED: Some Toyota with LKAS button no longer requires double press to engage/disengage M.A.D.S.
|
||||
|
||||
sunnypilot - Version Latest (2022-09-14)u
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
|
||||
* NEW❗: GM models supported in Force Car Recognition (FCR)
|
||||
* Under "SP - Vehicles"
|
||||
* NEW❗: Prompt to select car in "SP - Vehicles" if car unrecognized on startup
|
||||
* FIXED: Some Toyota with LKAS button no longer requires double press to engage/disengage M.A.D.S.
|
||||
* UPDATED: ESCC: Use radar tracks from radar if available
|
||||
|
||||
sunnypilot - Version Latest (2022-09-13)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
|
||||
* NEW❗: New metric in Developer UI
|
||||
* Actual Lateral Acceleration (Roll Compensated)
|
||||
|
||||
sunnypilot - Version Latest (2022-09-12)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
|
||||
* FIXED: Honda Nidec models not gaining speed when longitudinal engaged
|
||||
|
||||
sunnypilot - Version Latest (2022-09-11)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
|
||||
* NEW❗: Hyundai Enhanced SCC now forwards FCW and AEB signals and commands from radar to car
|
||||
* RE-ENABLED: MADS Status Icon toggle
|
||||
|
||||
sunnypilot - Version Latest (2022-09-10)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
|
||||
* NEW❗: RAM improvement implementation thanks to realfast!
|
||||
* DISABLED: Chrysler/Jeep/Ram with Custom Stock Longitudinal Control
|
||||
* DISABLED: Volkswagen MQB & PQ with Custom Stock Longitudinal Control
|
||||
|
||||
sunnypilot - Version Latest (2022-09-09)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.09-07:35:00:GMT - 0.8.17
|
||||
* NEW❗: MADS now supporting General Motors (GM)
|
||||
* ADDED: Custom Stock Longitudinal Control - Volkswagen
|
||||
* MQB & PQ
|
||||
* ADDED: Reverse ACC Change
|
||||
* ACC +/-: Short=5, Long=1
|
||||
* ADDED: Custom Stock Longitudinal Control
|
||||
* Hyundai/Kia/Genesis
|
||||
* Honda Bosch
|
||||
* ADDED: Hyundai: 2015-16 Genesis resume from standstill fix (commaai:openpilot#25579) - pending PR
|
||||
* Vision Turn Speed Control re-enabled
|
||||
* Disable Onroad Uploads toggle re-enabled
|
||||
|
||||
sunnypilot - Version Latest (2022-09-08)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.08-04:05:00:GMT - 0.8.17
|
||||
* NEW❗: Block lane change initiation while brake is pressed
|
||||
|
||||
sunnypilot - Version Latest (2022-09-07)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.08-04:05:00:GMT - 0.8.17
|
||||
* NEW❗: Display End-to-end longitudinal 🌮 on screen
|
||||
* NEW❗: Hold DISTANCE button on the steering wheel for 1 second to switch between E2E Long and ACC mode
|
||||
* Enable toggle on the driving screen to switch between modes with End-to-end longitudinal
|
||||
* Only applicable to cars with openpilot longitudinal control
|
||||
* NEW❗: Block lane change initiation while brake is pressed
|
||||
* REMOVED: Dynamic Lane Profile - upstream laneless model is now on by default
|
||||
* REMOVED: hyundai: consistent start from stop (commaai:openpilot#25672) - pending PR
|
||||
|
||||
sunnypilot - Version Latest (2022-09-06)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.06 - 0.8.17
|
||||
* NEW❗: Display useful metrics above the chevron that tracks the lead car
|
||||
* Under "SP - Visuals" menu
|
||||
* Only applicable to cars with openpilot longitudinal control
|
||||
* ADDED: hyundai: consistent start from stop (commaai:openpilot#25672) - pending PR
|
||||
* FIXED: Vienna speed limit interface now scales properly with the outer box
|
||||
* REMOVED: Hyundai long improvements (commaai:openpilot#25604) - closed PR
|
||||
|
||||
sunnypilot - Version Latest (2022-09-05)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.03 - 0.8.17
|
||||
* NEW❗: Speed Limit Control (SLC) interface integrated with upstream
|
||||
* NEW❗: Speed limit from active navigation is now prioritized for Speed Limit Control
|
||||
* NEW❗: MUTCD (U.S.) or Vienna (E.U.) speed limit interfaces can now be selected under "SP - Controls"
|
||||
|
||||
sunnypilot - Version Latest (2022-09-04)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.03 - 0.8.17
|
||||
* FIXED: Gap Adjust Cruise status now displays properly on screen
|
||||
* FIXED: mapd - missing index in list caused mapd to crash
|
||||
* REMOVED: Temporary removed Vision Turn Speed Control
|
||||
|
||||
sunnypilot - Version Latest (2022-09-03)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.09.03 - 0.8.17
|
||||
* ADDED: New border colors for different operation engagements
|
||||
* ADDED: UI: Show barrier when car detected in blind spot
|
||||
* Only applicable to cars that have BSM detection with openpilot
|
||||
* FIXED: Cruise Cancel button no longer display prompt if cruise not engaged
|
||||
* TWEAKED: Update changelogs on startup in Settings -> Software -> Version
|
||||
* REMOVED: Upload Raw Logs and Full Resolution Videos toggles
|
||||
|
||||
sunnypilot - Version Latest (2022-08-31)
|
||||
========================
|
||||
* UPDATED: Synced with commaai's master branch - 2022.08.31 - 0.8.17
|
||||
* ADDED: New border colors for different operation engagements
|
||||
* ADDED: UI: Show barrier when car detected in blind spot
|
||||
* Only applicable to cars that have BSM detection with openpilot
|
||||
* FIXED: Cruise Cancel button no longer display prompt if cruise not engaged
|
||||
* REMOVED: Upload Raw Logs and Full Resolution Videos toggles
|
||||
|
||||
sunnypilot - Version 0.8.16 (2022-07-16)
|
||||
========================
|
||||
* Sync with commaai's master branches
|
||||
* NEW❗: Add toggle to pause lateral actuation below 30 MPH / 50 KM/H
|
||||
* IMPROVED: Better controls mismatch handling
|
||||
* IMPROVED: Less frequent Low Memory alert
|
||||
* IMPROVED: Only allow lateral control when in forward gears
|
||||
* IMPROVED: Better alerts handling on gear changes
|
||||
|
||||
sunnypilot - Version 0.8.14-1.3 (2022-06-29)
|
||||
========================
|
||||
* Hyundai/Kia/Genesis
|
||||
* NEW❗: MADS: Add GAP/Distance button on the steering wheel to engage/disengage
|
||||
* To engage/disengage MADS: Hold the button for 0.5 second
|
||||
* NEW❗: Dynamic Lane Profile: Add toggle to enable "Laneless for Curves in Auto Lane"
|
||||
* HOTFIX🛠: Improve Torque lateral control and reduce ping pong for some Toyota cars
|
||||
* Torque control: higher low speed gains and better steering angle deadzone logic
|
||||
* Developer UI: Remove Distance Traveled, replace with Memory Usage %
|
||||
* This may have a potential to fix the Low Memory alert that may appear
|
||||
|
||||
sunnypilot - Version 0.8.14-1 (2022-06-27)
|
||||
========================
|
||||
* HOTFIX🛠: Honda, Toyota, Volkswagen now initialized correctly with Torque Lateral Live Tune
|
||||
|
||||
sunnypilot - Version 0.8.14-1 (2022-06-27)
|
||||
========================
|
||||
* NEW❗: Added toggle to enable updates for sunnypilot
|
||||
* HOTFIX🛠: Volkswagen car list now displays properly in Force Car Recognition menu
|
||||
* REVERTED: Honda - temporary removes CRUISE (MAIN) for MADS engagement
|
||||
* LKAS button continues to be used for MADS engagement/disengagement
|
||||
|
||||
sunnypilot - Version 0.8.14-1 (2022-06-26)
|
||||
========================
|
||||
Visit https://bit.ly/sunnyreadme for more details
|
||||
* sunnypilot 0.8.14 release - based on openpilot 0.8.14 devel
|
||||
* "0.8.14-prod-c3" branch only supports comma three
|
||||
* If you have a comma two, EON, or other devices than a comma three, visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
|
||||
* Mono-branch support
|
||||
* Honda/Acura
|
||||
* Hyundai/Kia/Genesis
|
||||
* Toyota/Lexus
|
||||
* Volkswagen MQB
|
||||
* Modified Assistive Driving Safety (MADS) Mode
|
||||
* NEW❗: CRUISE (MAIN) now engages MADS for all supported car makes
|
||||
* NEW❗: Added toggle to disable disengaging Automatic Lane Centering (ALC) on the brake pedal
|
||||
* Dynamic Lane Profile (DLP)
|
||||
* NEW❗: Gap Adjust Cruise (GAC)
|
||||
* openpilot longitudinal cars can now adjust between the lead car's following distance gap via 3 modes:
|
||||
* Steering Wheel (SW) | User Interface (UI) | Steering Wheel + User Interface (SW+UI)
|
||||
* NEW❗: Custom Camera & Path Offsets
|
||||
* NEW❗: Torque Lateral Control from openpilot 0.8.15 master (as of 2022-06-15)
|
||||
* NEW❗: Torque Lateral Control Live Tune Menu
|
||||
* NEW❗: Speed Limit Sign from openpilot 0.8.15 master (as of 2022-06-22)
|
||||
* NEW❗: Mapbox Speed Limit data will now be utilized in Speed Limit Control (SLC)
|
||||
* Speed limit data will be utilized in the following availability:
|
||||
* Mapbox (active navigation) -> OpenStreetMap -> Car Interface (Toyota's TSR)
|
||||
* Custom Stock Longitudinal Control
|
||||
* NEW❗: Volkswagen MQB
|
||||
* Honda
|
||||
* Hyundai/Kia/Genesis
|
||||
* NEW❗: Mapbox navigation support for non-Prime users
|
||||
* Visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
|
||||
* Hyundai/Kia/Genesis
|
||||
* NEW❗: Enhanced SCC (ESCC) Support
|
||||
* Requires hardware modification. Visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
|
||||
* NEW❗: Smart MDPS (SMDPS) Support - Auto-detection
|
||||
* Requires hardware modification and custom firmware for the SMDPS. Visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
|
||||
* Toyota/Lexus
|
||||
* NEW❗: Added toggle to enforce stock longitudinal control
|
||||
|
||||
sunnypilot - Version 0.8.12-4
|
||||
========================
|
||||
* NEW❗: Custom Stock Longitudinal Control by setting the target speed via openpilot's "MAX" speed thanks to multikyd!
|
||||
* Speed Limit Control
|
||||
* Vision-based Turn Control
|
||||
* Map-based Turn Control
|
||||
* NEW❗: HDA status integration with Custom Stock Longitudinal Control on applicable HKG cars only
|
||||
* NEW❗: Roll Compensation and SteerRatio fix from comma's 0.8.13
|
||||
* NEW❗: Dev UI to display different metrics on screen
|
||||
* Click on the "MAX" box on the top left of the openpilot display to toggle different metrics display
|
||||
* Lead car relative distance; Lead car relative speed; Actual steering degree; Desired steering degree; Engine RPM; Longitudinal acceleration; Lead car actual speed; EPS torque; Current altitude; Compass direction
|
||||
* NEW❗: Stand Still Timer to display time spent at a stop with M.A.D.S engaged (i.e., stop lights, stop signs, traffic congestions)
|
||||
* NEW❗: Current car speed text turns red when the car is braking
|
||||
* NEW❗: Export GPS tracks into GPX files and upload to OSM thanks to eFini!
|
||||
* NEW❗: Enable ACC and M.A.D.S with a single press of the RES+/SET- button
|
||||
* NEW❗: ACC +/-: Short=5, Long=1
|
||||
* Change the ACC +/- buttons behavior with cruise speed change in openpilot
|
||||
* Disabled (Stock): Short=1, Long=5
|
||||
* Enabled: Short=5, Long=1
|
||||
* NEW❗: Speed Limit Value Offset (not %)*
|
||||
* Set speed limit higher or lower than actual speed limit for a more personalized drive.
|
||||
* *To use this feature, turn off "Enable Speed Limit % Offset"*
|
||||
* NEW❗: Dedicated icon to show the status of M.A.D.S.
|
||||
* NEW❗: No Offroad Fix for non-official devices that cannot shut down after the car is turned off
|
||||
* NEW❗: Stop N' Go Resume Alternative
|
||||
* Offer alternative behavior to auto resume when stopped behind a lead car using stock SCC/ACC. This feature removes the repeating prompt chime when stopped and/or allows some cars to use auto resume (i.e., Genesis)
|
||||
* IMPROVED: Show the lead car icon in the car's dashboard when a lead car is detected by openpilot's camera vision
|
||||
* FIXED: MADS button unintentionally set MAX when using stock longitudinal control thanks to Spektor56!
|
||||
|
||||
sunnypilot - Version 0.8.12-3
|
||||
========================
|
||||
* NEW❗: Bypass "System Malfunction" alert toggle
|
||||
* Prevent openpilot from returning the "System Malfunction" alert that hinders the ability use openpilot
|
||||
* FIXED: Hyundai/Kia/Genesis Brake Hold Active now outputs the correct events on screen with M.A.D.S. engaged
|
||||
|
||||
sunnypilot - Version 0.8.12-2
|
||||
========================
|
||||
* NEW❗: Disable M.A.D.S. toggle to disable the beloved M.A.D.S. feature
|
||||
* Enable Stock openpilot engagement/disengagement
|
||||
* ADJUST: Initialize Driving Screen Off Brightness at 50%
|
||||
|
||||
sunnypilot - Version 0.8.12-1
|
||||
========================
|
||||
* sunnypilot 0.8.12 release - based on openpilot 0.8.12 devel
|
||||
* Dedicated Hyundai/Kia/Genesis branch support
|
||||
* NEW❗: OpenStreetMap integration thanks to the Move Fast team!
|
||||
* NEW❗: Vision-based Turn Control
|
||||
* NEW❗: Map-Data-based Turn Control
|
||||
* NEW❗: Speed Limit Control w/ optional Speed Limit Offset
|
||||
* NEW❗: OpenStreetMap integration debug UI
|
||||
* Only available to openpilot longitudinal enabled cars
|
||||
* NEW❗: Hands on Wheel Monitoring according to EU r079r4e regulation
|
||||
* NEW❗: Disable Onroad Uploads for data-limited Wi-Fi hotspots when using OpenStreetMap related features
|
||||
* NEW❗: Fast Boot (Prebuilt)
|
||||
* NEW❗: Auto Lane Change Timer
|
||||
* NEW❗: Screen Brightness Control (Global)
|
||||
* NEW❗: Driving Screen Off Timer
|
||||
* NEW❗: Driving Screen Off Brightness (%)
|
||||
* NEW❗: Max Time Offroad
|
||||
* Improved user feedback with M.A.D.S. operations thanks to Spektor56!
|
||||
* Lane Path
|
||||
* Green🟢 (Laneful), Red🔴 (Laneless): M.A.D.S. engaged
|
||||
* White⚪: M.A.D.S. suspended or disengaged
|
||||
* Black⚫: M.A.D.S. engaged, steering is being manually override by user
|
||||
* Screen border now only illuminates Green when SCC/ACC is engaged
|
||||
|
||||
sunnypilot - Version 0.8.10-1 (Unreleased)
|
||||
========================
|
||||
* sunnypilot 0.8.10 release - based on openpilot 0.8.10 `devel`
|
||||
* Add Toyota cars to Force Car Recognition
|
||||
|
||||
sunnypilot - Version 0.8.9-4
|
||||
========================
|
||||
* Hyundai: Fix Ioniq Hybrid signals
|
||||
|
||||
sunnypilot - Version 0.8.9-3
|
||||
========================
|
||||
* Update home screen brand and version structure
|
||||
|
||||
sunnypilot - Version 0.8.9-2
|
||||
========================
|
||||
* Added additional Sonata Hybrid Firmware Versions
|
||||
* Features
|
||||
* Modified Assistive Driving Safety (MADS) Mode
|
||||
* Dynamic Lane Profile (DLP)
|
||||
* Quiet Drive 🤫
|
||||
* Force Car Recognition (FCR)
|
||||
* PID Controller: add kd into the stock PID controller
|
||||
|
||||
sunnypilot - Version 0.8.9-1
|
||||
========================
|
||||
* First changelog!
|
||||
* Features
|
||||
* Modified Assistive Driving Safety (MADS) Mode
|
||||
* Dynamic Lane Profile (DLP)
|
||||
* Quiet Drive 🤫
|
||||
* Force Car Recognition (FCR)
|
||||
* PID Controller: add kd into the stock PID controller
|
||||
@@ -8,6 +8,22 @@ ENV PYTHONPATH ${OPENPILOT_PATH}:${PYTHONPATH}
|
||||
RUN mkdir -p ${OPENPILOT_PATH}
|
||||
WORKDIR ${OPENPILOT_PATH}
|
||||
|
||||
COPY . ${OPENPILOT_PATH}/
|
||||
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
|
||||
COPY ./common ${OPENPILOT_PATH}/common
|
||||
COPY ./opendbc ${OPENPILOT_PATH}/opendbc
|
||||
COPY ./cereal ${OPENPILOT_PATH}/cereal
|
||||
COPY ./panda ${OPENPILOT_PATH}/panda
|
||||
COPY ./selfdrive ${OPENPILOT_PATH}/selfdrive
|
||||
COPY ./system ${OPENPILOT_PATH}/system
|
||||
COPY ./body ${OPENPILOT_PATH}/body
|
||||
|
||||
RUN scons --cache-readonly -j$(nproc)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
FROM ubuntu:24.04
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends sudo tzdata locales ssh pulseaudio xvfb x11-xserver-utils gnome-screenshot && \
|
||||
apt-get install -y --no-install-recommends sudo tzdata locales ssh && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
|
||||
@@ -13,72 +13,27 @@ ENV LANGUAGE en_US:en
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
COPY tools/install_ubuntu_dependencies.sh /tmp/tools/
|
||||
RUN INSTALL_EXTRA_PACKAGES=no /tmp/tools/install_ubuntu_dependencies.sh && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* && \
|
||||
cd /usr/lib/gcc/arm-none-eabi/* && \
|
||||
rm -rf arm/ thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
|
||||
RUN cd /tmp && \
|
||||
tools/install_ubuntu_dependencies.sh && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
rm -rf /tmp/* && \
|
||||
# remove unused architectures from gcc for panda
|
||||
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
|
||||
rm -rf arm/ && \
|
||||
rm -rf thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
|
||||
|
||||
# Add OpenCL
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
alien \
|
||||
unzip \
|
||||
tar \
|
||||
curl \
|
||||
xz-utils \
|
||||
dbus \
|
||||
gcc-arm-none-eabi \
|
||||
tmux \
|
||||
vim \
|
||||
libx11-6 \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ENV POETRY_VIRTUALENVS_CREATE=false
|
||||
ENV PYENV_VERSION=3.11.4
|
||||
ENV PYENV_ROOT="/root/.pyenv"
|
||||
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
|
||||
|
||||
RUN mkdir -p /tmp/opencl-driver-intel && \
|
||||
cd /tmp/opencl-driver-intel && \
|
||||
wget https://github.com/intel/llvm/releases/download/2024-WW14/oclcpuexp-2024.17.3.0.09_rel.tar.gz && \
|
||||
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/oneapi-tbb-2021.12.0-lin.tgz && \
|
||||
mkdir -p /opt/intel/oclcpuexp_2024.17.3.0.09_rel && \
|
||||
cd /opt/intel/oclcpuexp_2024.17.3.0.09_rel && \
|
||||
tar -zxvf /tmp/opencl-driver-intel/oclcpuexp-2024.17.3.0.09_rel.tar.gz && \
|
||||
mkdir -p /etc/OpenCL/vendors && \
|
||||
echo /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64/libintelocl.so > /etc/OpenCL/vendors/intel_expcpu.icd && \
|
||||
cd /opt/intel && \
|
||||
tar -zxvf /tmp/opencl-driver-intel/oneapi-tbb-2021.12.0-lin.tgz && \
|
||||
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbb.so /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
|
||||
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbbmalloc.so /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
|
||||
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbb.so.12 /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
|
||||
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbbmalloc.so.2 /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
|
||||
mkdir -p /etc/ld.so.conf.d && \
|
||||
echo /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 > /etc/ld.so.conf.d/libintelopenclexp.conf && \
|
||||
ldconfig -f /etc/ld.so.conf.d/libintelopenclexp.conf && \
|
||||
cd / && \
|
||||
rm -rf /tmp/opencl-driver-intel
|
||||
COPY pyproject.toml poetry.lock .python-version /tmp/
|
||||
COPY tools/install_python_dependencies.sh /tmp/tools/
|
||||
|
||||
ENV NVIDIA_VISIBLE_DEVICES all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
|
||||
ENV QTWEBENGINE_DISABLE_SANDBOX 1
|
||||
|
||||
RUN dbus-uuidgen > /etc/machine-id
|
||||
|
||||
ARG USER=batman
|
||||
ARG USER_UID=1001
|
||||
RUN useradd -m -s /bin/bash -u $USER_UID $USER
|
||||
RUN usermod -aG sudo $USER
|
||||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
USER $USER
|
||||
|
||||
COPY --chown=$USER pyproject.toml uv.lock /tmp/
|
||||
COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/
|
||||
|
||||
ENV VIRTUAL_ENV=/home/$USER/.venv
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
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
|
||||
rm -rf /root/.cache && \
|
||||
pip uninstall -y poetry
|
||||
|
||||
USER root
|
||||
RUN sudo git config --global --add safe.directory /tmp/openpilot
|
||||
|
||||
37
Dockerfile.openpilot_base_cl
Normal file
37
Dockerfile.openpilot_base_cl
Normal file
@@ -0,0 +1,37 @@
|
||||
FROM ghcr.io/commaai/openpilot-base:latest
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends\
|
||||
apt-utils \
|
||||
alien \
|
||||
unzip \
|
||||
tar \
|
||||
curl \
|
||||
xz-utils \
|
||||
dbus \
|
||||
gcc-arm-none-eabi \
|
||||
tmux \
|
||||
vim \
|
||||
lsb-core \
|
||||
libx11-6 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Intel OpenCL driver
|
||||
ARG INTEL_DRIVER=l_opencl_p_18.1.0.015.tgz
|
||||
ARG INTEL_DRIVER_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/15532
|
||||
RUN mkdir -p /tmp/opencl-driver-intel
|
||||
WORKDIR /tmp/opencl-driver-intel
|
||||
RUN echo INTEL_DRIVER is $INTEL_DRIVER && \
|
||||
curl -O $INTEL_DRIVER_URL/$INTEL_DRIVER && \
|
||||
tar -xzf $INTEL_DRIVER && \
|
||||
for i in $(basename $INTEL_DRIVER .tgz)/rpm/*.rpm; do alien --to-deb $i; done && \
|
||||
dpkg -i *.deb && \
|
||||
rm -rf $INTEL_DRIVER $(basename $INTEL_DRIVER .tgz) *.deb && \
|
||||
mkdir -p /etc/OpenCL/vendors && \
|
||||
echo /opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin/libintelocl.so > /etc/OpenCL/vendors/intel.icd && \
|
||||
rm -rf /tmp/opencl-driver-intel
|
||||
ENV NVIDIA_VISIBLE_DEVICES all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
|
||||
ENV QTWEBENGINE_DISABLE_SANDBOX 1
|
||||
|
||||
RUN dbus-uuidgen > /etc/machine-id
|
||||
|
||||
77
HOW-TOS.md
77
HOW-TOS.md
@@ -1,77 +0,0 @@
|
||||
# How Tos
|
||||
This page is a repository of useful how-tos as a supplement for additional information.
|
||||
|
||||
Table of Contents
|
||||
=======================
|
||||
|
||||
* [Radar Tracks](#Radar-Tracks)
|
||||
* [Enable Radar Tracks](#-Enable-Radar-Tracks)
|
||||
* [Enable Mapbox Navigation](#-Enable-Mapbox-Navigation)
|
||||
|
||||
---
|
||||
|
||||
<details><summary><h3>📡 Radar Tracks</h3></summary>
|
||||
|
||||
Radar tracks can now be enabled manually on applicable cars through SSH thanks to [@greghogan](https://github.com/greghogan) and [@pd0wm](https://github.com/pd0wm).
|
||||
|
||||
Some Hyundai radars can be reconfigured to output (debug) radar points on bus 1.
|
||||
Reconfiguration is done over UDS by reading/writing to 0x0142 using the Read/Write Data By Identifier
|
||||
endpoints (0x22 & 0x2E). This script checks your radar firmware version against a list of known
|
||||
firmware versions. If you want to try on a new radar, make sure to note the default config value
|
||||
in case it is different from the other radars and you need to revert the changes.
|
||||
After changing the config the car should not show any faults when openpilot is not running.
|
||||
These config changes are persistent across car reboots. You need to run this script again
|
||||
to go back to the default values.
|
||||
|
||||
**USE AT YOUR OWN RISK!** Stock system safety features, like AEB and FCW, might be affected by these changes.
|
||||
|
||||
**How radar points can be used along with vision:**
|
||||
* Current OP long policy is identify with vision first, if vision sees a vehicle match it to a radar point. If vision sees nothing you get a false negative and no lead car detection. (Source: [Hubblesphere#7894 from comma.ai community Discord](https://discord.com/channels/469524606043160576/872899198738104330/872913890793635872))
|
||||
|
||||
### 🚨 Enable Radar Tracks
|
||||
|
||||
***(EXPERIMENTAL, as of January 1st, 2022)***
|
||||
|
||||
***(Only applicable to some Hyundai, Kia, and Genesis cars, as of January 1st, 2022)***
|
||||
|
||||
*(Base on version 0.8.12 [`devel`](https://github.com/commaai/openpilot/tree/devel))*
|
||||
|
||||
**USE AT YOUR OWN RISK!** Stock system safety features, like AEB and FCW, might be affected by these changes.
|
||||
|
||||
1. Ensure the car is at the `OFF` ignition position.
|
||||
2. Connect your compatible comma device (EON, C2, C3) to the car. comma device power should be ON.
|
||||
3. Use a laptop or applicable device to connect to your comma device via SSH. (Tips: Instructions to SSH in [HERE](https://github.com/commaai/openpilot/wiki/SSH))
|
||||
4. In the SSH terminal after successfully connected to your comma device, execute the following commands:
|
||||
1. `pkill -f openpilot`
|
||||
2. `python /data/openpilot/selfdrive/debug/hyundai_enable_radar_points.py`
|
||||
3. Follow the instructions in the script:
|
||||
* `Power on the vehicle keeping the engine off (press start button twice) then type OK to continue`.
|
||||
* If successful, the following message should appear: `[DONE]. Restart your vehicle and ensure there are no faults`.
|
||||
* If the script did not run successfully, reach out to the community in [Sunnyhaibin's Openpilot Discord Server](https://discord.gg/wRW3meAgtx) or `#hyundai-kia-genesis channel` on [commaai community Discord Server](https://discord.comma.ai) for assistance.
|
||||
4. Reboot your comma device:
|
||||
1. C3: `sudo reboot`
|
||||
2. C2 or EON: `reboot`
|
||||
5. Once your comma device is rebooted, start your car with engine on (with or without comma device connected). Ensure that there are no faults from the car. If there are faults, reach out to the community in [Sunnyhaibin's Openpilot Discord Server](https://discord.gg/wRW3meAgtx) or `#hyundai-kia-genesis channel` on [commaai community Discord Server](https://discord.comma.ai) for assistance.
|
||||
6. Go for a quick drive and drive behind a lead car with varied follow distance. Then, come back and allow the drive to upload its `rlogs` in [comma Connect](https://connect.comma.ai).
|
||||
7. With all `rlogs` uploaded, open the drive in Cabana from [comma Connect](https://connect.comma.ai). Load DBC -> `hyundai_kia_mando_front_radar.dbc`, then search `RADAR_TRACK_50x` (`x` could be anything), open any of them, and look at `LONG_DIST`.
|
||||
8. If the radar tracks data is relevant with the lead car you drove behind, you are done! Your car now have radar tracks enabled.
|
||||
</details>
|
||||
|
||||
<details><summary><h3>🗺 Enable Mapbox Navigation</h3></summary>
|
||||
|
||||
1) Create a free mapbox account. Account will ask for a credit card for verification. You will not be charged for the free tier.
|
||||
2) On the Dashboard, you will see a section called Access Tokens. Click `Create a Token`. Name it whatever you like. Set the scopes to allow everything for both Public and Secret. Copy both of these keys. **YOU WON'T BE ABLE TO ACCESS THE SECRET KEY AFTER THIS WINDOW.**
|
||||
3) Once rebooted, connect your C3 to a network with internet access and find the C3’s IP address.
|
||||
4) In a browser, navigate to that IP with **port 8082** (i.e 192.168.1.69:8082). You should be greeted with the Comma logo and a public key input field.
|
||||
5) Paste your Public token (pk.xx), click enter, paste your Secret key (sk.xx), click enter. You can now search for places. This page will be available at your devices’s IP address/port 8082 to search for destinations.
|
||||
6) To set Home and Work addresses, search for a place, select Home/Work from the dropdown and click Navigate. For non-Home/Work destinations, select Recent Places.<br>*At this time, it is not possible to search directly on the C3.*
|
||||
|
||||
**TIPS:**
|
||||
- If your C3 is showing a black screen that says “Map Loading”, performing a reboot via the UI should fix it.
|
||||
- If your phone can create a Hotspot, you are able to connect the C3 to your phone hotspot and use your phone browser to search for places.
|
||||
- In the Navigation panel on the C3, you can select Home, Work, and from a list of Recent Places you have navigated to without needing a browser (assuming the C3 is connected to the internet.)
|
||||
|
||||
**IMPORTANT NOTE:** Your C3 will require an active internet connection to download map data, generate driving directions, and ETA. Once map data and directions are downloaded, it *is* possible to use it offline, however nothing will update (such as new driving direction after a missed turn, updated ETA, map data further into your drive etc.)
|
||||
|
||||
***NAVIGATION NOTE:** At this time, mapbox does not support alphanumeric addresses (i.e W123N1234 Main St). There is currently no known workaround for this.*
|
||||
</details>
|
||||
392
Jenkinsfile
vendored
392
Jenkinsfile
vendored
@@ -1,23 +1,10 @@
|
||||
def retryWithDelay(int maxRetries, int delay, Closure body) {
|
||||
for (int i = 0; i < maxRetries; i++) {
|
||||
try {
|
||||
return body()
|
||||
} catch (Exception e) {
|
||||
sleep(delay)
|
||||
}
|
||||
}
|
||||
throw Exception("Failed after ${maxRetries} retries")
|
||||
}
|
||||
|
||||
def device(String ip, String step_label, String cmd) {
|
||||
def phone(String ip, String step_label, String cmd) {
|
||||
withCredentials([file(credentialsId: 'id_rsa', variable: 'key_file')]) {
|
||||
def ssh_cmd = """
|
||||
ssh -tt -o ConnectTimeout=5 -o ServerAliveInterval=5 -o ServerAliveCountMax=2 -o BatchMode=yes -o StrictHostKeyChecking=no -i ${key_file} 'comma@${ip}' /usr/bin/bash <<'END'
|
||||
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} 'comma@${ip}' /usr/bin/bash <<'END'
|
||||
|
||||
set -e
|
||||
|
||||
shopt -s huponexit # kill all child processes when the shell exits
|
||||
|
||||
export CI=1
|
||||
export PYTHONWARNINGS=error
|
||||
export LOGPRINT=debug
|
||||
@@ -27,9 +14,6 @@ export GIT_BRANCH=${env.GIT_BRANCH}
|
||||
export GIT_COMMIT=${env.GIT_COMMIT}
|
||||
export AZURE_TOKEN='${env.AZURE_TOKEN}'
|
||||
export MAPBOX_TOKEN='${env.MAPBOX_TOKEN}'
|
||||
# only use 1 thread for tici tests since most require HIL
|
||||
export PYTEST_ADDOPTS="-n 0"
|
||||
|
||||
|
||||
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
|
||||
|
||||
@@ -37,11 +21,6 @@ source ~/.bash_profile
|
||||
if [ -f /TICI ]; then
|
||||
source /etc/profile
|
||||
|
||||
rm -rf /tmp/tmp*
|
||||
rm -rf ~/.commacache
|
||||
rm -rf /dev/shm/*
|
||||
rm -rf /dev/tmp/tmp*
|
||||
|
||||
if ! systemctl is-active --quiet systemd-resolved; then
|
||||
echo "restarting resolved"
|
||||
sudo systemctl start systemd-resolved
|
||||
@@ -72,183 +51,226 @@ END"""
|
||||
}
|
||||
}
|
||||
|
||||
def deviceStage(String stageName, String deviceType, List extra_env, def steps) {
|
||||
stage(stageName) {
|
||||
if (currentBuild.result != null) {
|
||||
return
|
||||
}
|
||||
|
||||
def extra = extra_env.collect { "export ${it}" }.join('\n');
|
||||
def branch = env.BRANCH_NAME ?: 'master';
|
||||
|
||||
lock(resource: "", label: deviceType, inversePrecedence: true, variable: 'device_ip', quantity: 1, resourceSelectStrategy: 'random') {
|
||||
docker.image('ghcr.io/commaai/alpine-ssh').inside('--user=root') {
|
||||
timeout(time: 35, unit: 'MINUTES') {
|
||||
retry (3) {
|
||||
device(device_ip, "git checkout", extra + "\n" + readFile("selfdrive/test/setup_device_ci.sh"))
|
||||
}
|
||||
steps.each { item ->
|
||||
device(device_ip, item[0], item[1])
|
||||
}
|
||||
}
|
||||
def phone_steps(String device_type, steps) {
|
||||
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
||||
timeout(time: 20, unit: 'MINUTES') {
|
||||
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
|
||||
steps.each { item ->
|
||||
phone(device_ip, item[0], item[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def pcStage(String stageName, Closure body) {
|
||||
node {
|
||||
stage(stageName) {
|
||||
if (currentBuild.result != null) {
|
||||
return
|
||||
pipeline {
|
||||
agent none
|
||||
environment {
|
||||
CI = "1"
|
||||
PYTHONWARNINGS = "error"
|
||||
TEST_DIR = "/data/openpilot"
|
||||
SOURCE_DIR = "/data/openpilot_source/"
|
||||
AZURE_TOKEN = credentials('azure_token')
|
||||
MAPBOX_TOKEN = credentials('mapbox_token')
|
||||
}
|
||||
options {
|
||||
timeout(time: 3, unit: 'HOURS')
|
||||
disableConcurrentBuilds(abortPrevious: env.BRANCH_NAME != 'master')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('build release3-staging') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
when {
|
||||
branch 'devel-staging'
|
||||
}
|
||||
steps {
|
||||
phone_steps("tici-needs-can", [
|
||||
["build release3-staging & dashcam3-staging", "RELEASE_BRANCH=release3-staging DASHCAM_BRANCH=dashcam3-staging $SOURCE_DIR/release/build_release.sh"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
checkout scm
|
||||
|
||||
def dockerArgs = "--user=batman -v /tmp/comma_download_cache:/tmp/comma_download_cache -v /tmp/scons_cache:/tmp/scons_cache -e PYTHONPATH=${env.WORKSPACE} --cpus=8 --memory 16g -e PYTEST_ADDOPTS='-n8'";
|
||||
|
||||
def openpilot_base = retryWithDelay (3, 15) {
|
||||
return docker.build("openpilot-base:build-${env.GIT_COMMIT}", "-f Dockerfile.openpilot_base .")
|
||||
stage('build nightly') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
when {
|
||||
branch 'master-ci'
|
||||
}
|
||||
steps {
|
||||
phone_steps("tici-needs-can", [
|
||||
["build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/release/build_release.sh"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
lock(resource: "", label: 'pc', inversePrecedence: true, quantity: 1) {
|
||||
openpilot_base.inside(dockerArgs) {
|
||||
timeout(time: 20, unit: 'MINUTES') {
|
||||
try {
|
||||
retryWithDelay (3, 15) {
|
||||
sh "git config --global --add safe.directory '*'"
|
||||
sh "git submodule update --init --recursive"
|
||||
sh "git lfs pull"
|
||||
stage('openpilot tests') {
|
||||
when {
|
||||
not {
|
||||
anyOf {
|
||||
branch 'master-ci'; branch 'devel'; branch 'devel-staging';
|
||||
branch 'release3'; branch 'release3-staging'; branch 'dashcam3'; branch 'dashcam3-staging';
|
||||
branch 'testing-closet*'; branch 'hotfix-*'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parallel {
|
||||
|
||||
/*
|
||||
stage('simulator') {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile.sim_nvidia'
|
||||
dir 'tools/sim'
|
||||
args '--user=root'
|
||||
}
|
||||
body()
|
||||
} finally {
|
||||
sh "rm -rf ${env.WORKSPACE}/* || true"
|
||||
}
|
||||
steps {
|
||||
sh "git config --global --add safe.directory '*'"
|
||||
sh "git submodule update --init --recursive"
|
||||
sh "git lfs pull"
|
||||
lock(resource: "", label: "simulator", inversePrecedence: true, quantity: 1) {
|
||||
sh "${WORKSPACE}/tools/sim/build_container.sh"
|
||||
sh "DETACH=1 ${WORKSPACE}/tools/sim/start_carla.sh"
|
||||
sh "${WORKSPACE}/tools/sim/start_openpilot_docker.sh"
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
sh "docker kill carla_sim || true"
|
||||
sh "rm -rf ${WORKSPACE}/* || true"
|
||||
sh "rm -rf .* || true"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
stage('PC tests') {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile.openpilot_base'
|
||||
args '--user=root -v /tmp/comma_download_cache:/tmp/comma_download_cache'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh "git config --global --add safe.directory '*'"
|
||||
sh "git submodule update --init --depth=1 --recursive"
|
||||
sh "git lfs pull"
|
||||
// tests that our build system's dependencies are configured properly, needs a machine with lots of cores
|
||||
sh "scons --clean && scons --no-cache --random -j42"
|
||||
sh "INTERNAL_SEG_CNT=500 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt FILEREADER_CACHE=1 \
|
||||
pytest -n42 --dist=loadscope selfdrive/car/tests/test_models.py"
|
||||
sh "MAX_EXAMPLES=100 pytest -n42 selfdrive/car/tests/test_car_interfaces.py"
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
sh "rm -rf ${WORKSPACE}/* || true"
|
||||
sh "rm -rf .* || true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('tizi-tests') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("tizi", [
|
||||
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
||||
["test boardd loopback", "SINGLE_PANDA=1 pytest selfdrive/boardd/tests/test_boardd_loopback.py"],
|
||||
["test pandad", "pytest selfdrive/boardd/tests/test_pandad.py"],
|
||||
["test sensord", "cd system/sensord/tests && pytest test_sensord.py"],
|
||||
["test camerad", "pytest system/camerad/test/test_camerad.py"],
|
||||
["test exposure", "pytest system/camerad/test/test_exposure.py"],
|
||||
["test amp", "pytest system/hardware/tici/tests/test_amplifier.py"],
|
||||
["test hw", "pytest system/hardware/tici/tests/test_hardware.py"],
|
||||
["test rawgpsd", "pytest system/sensord/rawgps/test_rawgps.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('build') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
environment {
|
||||
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
|
||||
}
|
||||
steps {
|
||||
phone_steps("tici-needs-can", [
|
||||
["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR ./build_devel.sh"],
|
||||
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
||||
["check dirty", "release/check-dirty.sh"],
|
||||
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
|
||||
["time to onroad", "cd selfdrive/test/ && pytest test_time_to_onroad.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('loopback-tests') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("tici-loopback", [
|
||||
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
||||
["test boardd loopback", "pytest selfdrive/boardd/tests/test_boardd_loopback.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('HW + Unit Tests') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("tici-common", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["test pandad", "pytest selfdrive/boardd/tests/test_pandad.py"],
|
||||
["test power draw", "pytest system/hardware/tici/tests/test_power_draw.py"],
|
||||
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py"],
|
||||
["test pigeond", "pytest system/sensord/tests/test_pigeond.py"],
|
||||
["test manager", "pytest selfdrive/manager/test/test_manager.py"],
|
||||
["test nav", "pytest selfdrive/navd/tests/"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('camerad') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("tici-ar0231", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["test camerad", "pytest system/camerad/test/test_camerad.py"],
|
||||
["test exposure", "pytest system/camerad/test/test_exposure.py"],
|
||||
])
|
||||
phone_steps("tici-ox03c10", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["test camerad", "pytest system/camerad/test/test_camerad.py"],
|
||||
["test exposure", "pytest system/camerad/test/test_exposure.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('sensord') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("tici-lsmc", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["test sensord", "cd system/sensord/tests && pytest test_sensord.py"],
|
||||
])
|
||||
phone_steps("tici-bmx-lsm", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["test sensord", "cd system/sensord/tests && pytest test_sensord.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('replay') {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("tici-replay", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def setupCredentials() {
|
||||
withCredentials([
|
||||
string(credentialsId: 'azure_token', variable: 'AZURE_TOKEN'),
|
||||
string(credentialsId: 'mapbox_token', variable: 'MAPBOX_TOKEN')
|
||||
]) {
|
||||
env.AZURE_TOKEN = "${AZURE_TOKEN}"
|
||||
env.MAPBOX_TOKEN = "${MAPBOX_TOKEN}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
node {
|
||||
env.CI = "1"
|
||||
env.PYTHONWARNINGS = "error"
|
||||
env.TEST_DIR = "/data/openpilot"
|
||||
env.SOURCE_DIR = "/data/openpilot_source/"
|
||||
setupCredentials()
|
||||
|
||||
env.GIT_BRANCH = checkout(scm).GIT_BRANCH
|
||||
env.GIT_COMMIT = checkout(scm).GIT_COMMIT
|
||||
|
||||
def excludeBranches = ['master-ci', 'devel', 'devel-staging', 'release3', 'release3-staging',
|
||||
'testing-closet*', 'hotfix-*']
|
||||
def excludeRegex = excludeBranches.join('|').replaceAll('\\*', '.*')
|
||||
|
||||
if (env.BRANCH_NAME != 'master') {
|
||||
properties([
|
||||
disableConcurrentBuilds(abortPrevious: true)
|
||||
])
|
||||
}
|
||||
|
||||
try {
|
||||
if (env.BRANCH_NAME == 'devel-staging') {
|
||||
deviceStage("build release3-staging", "tici-needs-can", [], [
|
||||
["build release3-staging", "RELEASE_BRANCH=release3-staging $SOURCE_DIR/release/build_release.sh"],
|
||||
])
|
||||
}
|
||||
|
||||
if (env.BRANCH_NAME == 'master-ci') {
|
||||
deviceStage("build nightly", "tici-needs-can", [], [
|
||||
["build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/release/build_release.sh"],
|
||||
])
|
||||
}
|
||||
|
||||
if (!env.BRANCH_NAME.matches(excludeRegex)) {
|
||||
parallel (
|
||||
// tici tests
|
||||
'onroad tests': {
|
||||
deviceStage("onroad", "tici-needs-can", [], [
|
||||
// TODO: ideally, this test runs in master-ci, but it takes 5+m to build it
|
||||
//["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR $SOURCE_DIR/scripts/retry.sh ./build_devel.sh"],
|
||||
["build openpilot", "cd system/manager && ./build.py"],
|
||||
["check dirty", "release/check-dirty.sh"],
|
||||
["onroad tests", "pytest selfdrive/test/test_onroad.py -s"],
|
||||
["time to onroad", "pytest selfdrive/test/test_time_to_onroad.py"],
|
||||
])
|
||||
},
|
||||
'HW + Unit Tests': {
|
||||
deviceStage("tici-hardware", "tici-common", ["UNSAFE=1"], [
|
||||
["build", "cd system/manager && ./build.py"],
|
||||
["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py"],
|
||||
["test power draw", "pytest -s system/hardware/tici/tests/test_power_draw.py"],
|
||||
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py"],
|
||||
["test pigeond", "pytest system/ubloxd/tests/test_pigeond.py"],
|
||||
["test manager", "pytest system/manager/test/test_manager.py"],
|
||||
])
|
||||
},
|
||||
'loopback': {
|
||||
deviceStage("loopback", "tici-loopback", ["UNSAFE=1"], [
|
||||
["build openpilot", "cd system/manager && ./build.py"],
|
||||
["test pandad loopback", "pytest selfdrive/pandad/tests/test_pandad_loopback.py"],
|
||||
])
|
||||
},
|
||||
'camerad': {
|
||||
deviceStage("AR0231", "tici-ar0231", ["UNSAFE=1"], [
|
||||
["build", "cd system/manager && ./build.py"],
|
||||
["test camerad", "pytest system/camerad/test/test_camerad.py"],
|
||||
["test exposure", "pytest system/camerad/test/test_exposure.py"],
|
||||
])
|
||||
deviceStage("OX03C10", "tici-ox03c10", ["UNSAFE=1"], [
|
||||
["build", "cd system/manager && ./build.py"],
|
||||
["test camerad", "pytest system/camerad/test/test_camerad.py"],
|
||||
["test exposure", "pytest system/camerad/test/test_exposure.py"],
|
||||
])
|
||||
},
|
||||
'sensord': {
|
||||
deviceStage("LSM + MMC", "tici-lsmc", ["UNSAFE=1"], [
|
||||
["build", "cd system/manager && ./build.py"],
|
||||
["test sensord", "pytest system/sensord/tests/test_sensord.py"],
|
||||
])
|
||||
deviceStage("BMX + LSM", "tici-bmx-lsm", ["UNSAFE=1"], [
|
||||
["build", "cd system/manager && ./build.py"],
|
||||
["test sensord", "pytest system/sensord/tests/test_sensord.py"],
|
||||
])
|
||||
},
|
||||
'replay': {
|
||||
deviceStage("model-replay", "tici-replay", ["UNSAFE=1"], [
|
||||
["build", "cd system/manager && ./build.py"],
|
||||
["model replay", "selfdrive/test/process_replay/model_replay.py"],
|
||||
])
|
||||
},
|
||||
'tizi': {
|
||||
deviceStage("tizi", "tizi", ["UNSAFE=1"], [
|
||||
["build openpilot", "cd system/manager && ./build.py"],
|
||||
["test pandad loopback", "SINGLE_PANDA=1 pytest selfdrive/pandad/tests/test_pandad_loopback.py"],
|
||||
["test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"],
|
||||
["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py"],
|
||||
["test amp", "pytest system/hardware/tici/tests/test_amplifier.py"],
|
||||
["test hw", "pytest system/hardware/tici/tests/test_hardware.py"],
|
||||
["test qcomgpsd", "pytest system/qcomgpsd/tests/test_qcomgpsd.py"],
|
||||
])
|
||||
},
|
||||
|
||||
)
|
||||
}
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILED'
|
||||
throw e
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
21
LICENSE.md
21
LICENSE.md
@@ -1,21 +0,0 @@
|
||||
# Custom MIT License
|
||||
|
||||
Copyright (c) 2024, Haibin Wen, SUNNYPILOT LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to view and modify the Software, subject to the following conditions:
|
||||
|
||||
1. **Permission Required**: Permission Required for Commercial, For-Profit, or Closed Source Use: Use of the Software, in whole or in part, for any commercial purposes, for-profit projects, or in closed source projects requires explicit written permission from the original author(s).
|
||||
|
||||
2. **Redistribution**: Any redistribution of the Software, modified or unmodified, must retain this license notice and the following acknowledgment:
|
||||
"This software is licensed under a custom license requiring permission for use."
|
||||
|
||||
3. **Visibility**: Any project that uses the Software must visibly mention the following acknowledgment:
|
||||
"This project uses software from Haibin Wen and SUNNYPILOT LLC and is licensed under a custom license requiring permission for use."
|
||||
|
||||
4. **No Warranty**: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Contact sunnypilot Support <support@sunnypilot.ai> for permission requests.
|
||||
|
||||
---
|
||||
|
||||
Haibin Wen, SUNNYPILOT LLC
|
||||
516
README.md
Normal file → Executable file
516
README.md
Normal file → Executable file
@@ -1,460 +1,146 @@
|
||||

|
||||

|
||||
|
||||
Table of Contents
|
||||
=======================
|
||||
|
||||
* [Join our Discord](#-join-our-discord)
|
||||
* [What is sunnypilot?](#-what-is-sunnypilot)
|
||||
* [Running in a car](#-running-on-a-dedicated-device-in-a-car)
|
||||
* [Read Before Installing](#-read-before-installing)
|
||||
* [Prohibited Safety Modifications](#-prohibited-safety-modifications)
|
||||
* [Installation](#-installation)
|
||||
* [Highlight Features](#-highlight-features)
|
||||
* [Driving Enhancements](#-driving-enhancements)
|
||||
* [Branch Definitions](#-branch-definitions)
|
||||
* [Recommended Branches](#-recommended-branches)
|
||||
* [How-To's](#-How-Tos)
|
||||
* [Pull Requests](#-Pull-Requests)
|
||||
* [Special Thanks](#-special-thanks)
|
||||
* [User Data](#-user-data)
|
||||
* [What is openpilot?](#what-is-openpilot)
|
||||
* [Running in a car](#running-on-a-dedicated-device-in-a-car)
|
||||
* [Running on PC](#running-on-pc)
|
||||
* [Community and Contributing](#community-and-contributing)
|
||||
* [User Data and comma Account](#user-data-and-comma-account)
|
||||
* [Safety and Testing](#safety-and-testing)
|
||||
* [Directory Structure](#directory-structure)
|
||||
* [Licensing](#licensing)
|
||||
* [Donate](#-support-sunnypilot)
|
||||
|
||||
---
|
||||
|
||||
<details><summary><h3>💭 Join our Discord</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
Join the official sunnypilot Discord server to stay up to date with all the latest features and be a part of shaping the future of sunnypilot!
|
||||
* https://discord.gg/sunnypilot
|
||||
|
||||
 
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>🌞 What is sunnypilot?</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
[sunnypilot](https://github.com/sunnyhaibin/sunnypilot) is a fork of comma.ai's openpilot, an open source driver assistance system. sunnypilot offers the user a unique driving experience for over 250+ supported car makes and models with modified behaviors of driving assist engagements. sunnypilot complies with comma.ai's safety rules as accurately as possible.
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>🚘 Running on a dedicated device in a car</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
To use sunnypilot in a car, you need the following:
|
||||
* A supported device to run this software
|
||||
* a [comma three](https://comma.ai/shop/products/three), or
|
||||
* a comma two (only with older versions below 0.8.13)
|
||||
* This software
|
||||
* One of [the 250+ supported cars](https://github.com/commaai/openpilot/blob/master/docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, Ford and more. If your car is not supported but has adaptive cruise control and lane-keeping assist, it's likely able to run sunnypilot.
|
||||
* A [car harness](https://comma.ai/shop/products/car-harness) to connect to your car
|
||||
|
||||
Detailed instructions for [how to mount the device in a car](https://comma.ai/setup).
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>🚨 Read Before Installing</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
It is recommended to read this **entire page** before proceeding. This will ensure that you fully understand each added feature on sunnypilot, and you are selecting the right branch for your car to have the best driving experience.
|
||||
|
||||
This is a fork of [comma.ai's openpilot](https://github.com/commaai/openpilot). By installing this software, you accept all responsibility for anything that might occur while you use it. All contributors to sunnypilot are not liable. ❗<ins>**Use at your own risk.**</ins>❗
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>⛔ Prohibited Safety Modifications</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
All [official sunnypilot branches](https://github.com/sunnyhaibin/sunnypilot/branches) strictly adhere to [comma.ai's safety policy](https://github.com/commaai/openpilot/blob/master/docs/SAFETY.md). Any changes that go against this policy will result in your fork and your device being banned from both comma.ai and sunnypilot channels.
|
||||
|
||||
The following changes are a **VIOLATION** of this policy and **ARE NOT** included in any sunnypilot branches:
|
||||
* Driver Monitoring:
|
||||
* ❌ "Nerfing" or reducing monitoring parameters.
|
||||
* Panda safety:
|
||||
* ❌ No preventing disengaging of <ins>**LONGITUDINAL CONTROL**</ins> (acceleration/brake) on brake pedal press.
|
||||
* ❌ No auto re-engaging of <ins>**LONGITUDINAL CONTROL**</ins> (acceleration/brake) on brake pedal release.
|
||||
* ❌ No disengaging on ACC MAIN in OFF state.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<details><summary><h3>⚒ Installation</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
<details><summary>URL (Easy)</summary>
|
||||
|
||||
comma three
|
||||
What is openpilot?
|
||||
------
|
||||
|
||||
Please refer to [Recommended Branches](#-recommended-branches) to find your preferred/supported branch. This guide will assume you want to install the latest `release-c3` branch.
|
||||
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW), and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models, and model years](docs/CARS.md). In addition, while openpilot is engaged, a camera-based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration](docs/INTEGRATION.md) and [limitations](docs/LIMITATIONS.md).
|
||||
|
||||
* sunnypilot not installed or you installed a version before 0.8.17?
|
||||
1. [Factory reset/uninstall](https://github.com/commaai/openpilot/wiki/FAQ#how-can-i-reset-the-device) the previous software if you have another software/fork installed.
|
||||
2. After factory reset/uninstall and upon reboot, select `Custom Software` when given the option.
|
||||
3. Input the installation URL per [Recommended Branches](#-recommended-branches). Example: ```release-c3.sunnypilot.ai``` [^4] (note: `https://` is not requirement on the comma three)
|
||||
4. Complete the rest of the installation following the onscreen instructions.
|
||||
<table>
|
||||
<tr>
|
||||
<td><a href="https://youtu.be/NmBfgOanCyk" title="Video By Greer Viau"><img src="https://i.imgur.com/1w8c6d2.jpg"></a></td>
|
||||
<td><a href="https://youtu.be/VHKyqZ7t8Gw" title="Video By Logan LeGrand"><img src="https://i.imgur.com/LnBucik.jpg"></a></td>
|
||||
<td><a href="https://youtu.be/VxiR4iyBruo" title="Video By Charlie Kim"><img src="https://i.imgur.com/4Qoy48c.jpg"></a></td>
|
||||
<td><a href="https://youtu.be/-IkImTe1NYE" title="Video By Aragon"><img src="https://i.imgur.com/04VNzPf.jpg"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://youtu.be/iIUICQkdwFQ" title="Video By Logan LeGrand"><img src="https://i.imgur.com/b1LHQTy.jpg"></a></td>
|
||||
<td><a href="https://youtu.be/XOsa0FsVIsg" title="Video By PinoyDrives"><img src="https://i.imgur.com/6FG0Bd8.jpg"></a></td>
|
||||
<td><a href="https://youtu.be/bCwcJ98R_Xw" title="Video By JS"><img src="https://i.imgur.com/zO18CbW.jpg"></a></td>
|
||||
<td><a href="https://youtu.be/BQ0tF3MTyyc" title="Video By Tsai-Fi"><img src="https://i.imgur.com/eZzelq3.jpg"></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
* sunnypilot already installed and you installed a version after 0.8.17?
|
||||
1. On the comma three, go to `Settings` ▶️ `Software`.
|
||||
2. At the `Download` option, press `CHECK`. This will fetch the list of latest branches from sunnypilot.
|
||||
3. At the `Target Branch` option, press `SELECT` to open the Target Branch selector.
|
||||
4. Scroll to select the desired branch per [Recommended Branches](#-recommended-branches). Example: `release-c3`
|
||||
|
||||
| Branch | Installation URL |
|
||||
|:------------:|:--------------------------------:|
|
||||
| `release-c3` | https://release-c3.sunnypilot.ai |
|
||||
| `staging-c3` | https://staging-c3.sunnypilot.ai |
|
||||
| `dev-c3` | https://dev-c3.sunnypilot.ai |
|
||||
|
||||
Requires further assistance with software installation? Join the [sunnypilot Discord server](https://discord.sunnypilot.com) and message us in the `#installation-help` channel.
|
||||
|
||||
comma two
|
||||
Running on a dedicated device in a car
|
||||
------
|
||||
|
||||
1. [Factory reset/uninstall](https://github.com/commaai/openpilot/wiki/FAQ#how-can-i-reset-the-device) the previous software if you have another software/fork installed.
|
||||
2. After factory reset/uninstall and upon reboot, select `Custom Software` when given the option.
|
||||
3. Input the installation URL per [Recommended Branches](#-recommended-branches). Example: ```https://smiskol.com/fork/sunnyhaibin/0.8.12-4-prod```
|
||||
4. Complete the rest of the installation following the onscreen instructions.
|
||||
To use openpilot in a car, you need four things
|
||||
* A supported device to run this software: a [comma 3X](https://comma.ai/shop/comma-3x) or comma three.
|
||||
* This software. The setup procedure of the comma 3/3X allows the user to enter a URL for custom software.
|
||||
The URL, openpilot.comma.ai will install the release version of openpilot. To install openpilot master, you can use installer.comma.ai/commaai/master, and replacing commaai with another GitHub username can install a fork.
|
||||
* One of [the 250+ supported cars](docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, Ford and more. If your car is not supported but has adaptive cruise control and lane-keeping assist, it's likely able to run openpilot.
|
||||
* A [car harness](https://comma.ai/shop/products/car-harness) to connect to your car.
|
||||
|
||||
Requires further assistance with software installation? Join the [sunnypilot Discord server](https://discord.sunnypilot.com) and message us in the `#installation-help` channel.
|
||||
We have detailed instructions for [how to mount the device in a car](https://comma.ai/setup).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>SSH (More Versatile)</summary>
|
||||
<br>
|
||||
|
||||
Prerequisites: [How to SSH](https://github.com/commaai/openpilot/wiki/SSH)
|
||||
|
||||
If you are looking to install sunnypilot via SSH, run the following command in an SSH terminal after connecting to your device:
|
||||
|
||||
comma three:
|
||||
Running on PC
|
||||
------
|
||||
* [`release-c3`](https://github.com/sunnyhaibin/openpilot/tree/release-c3):
|
||||
|
||||
```
|
||||
cd /data; rm -rf ./openpilot; git clone -b release-c3 --recurse-submodules https://github.com/sunnyhaibin/sunnypilot.git openpilot; cd openpilot; sudo reboot
|
||||
```
|
||||
All openpilot services can run as usual on a PC without requiring special hardware or a car. You can also run openpilot on recorded or simulated data to develop or experiment with openpilot.
|
||||
|
||||
comma two:
|
||||
With openpilot's tools, you can plot logs, replay drives, and watch the full-res camera streams. See [the tools README](tools/README.md) for more information.
|
||||
|
||||
You can also run openpilot in simulation [with the CARLA simulator](tools/sim/README.md). This allows openpilot to drive around a virtual car on your Ubuntu machine. The whole setup should only take a few minutes but does require a decent GPU.
|
||||
|
||||
A PC running openpilot can also control your vehicle if it is connected to a [webcam](https://github.com/commaai/openpilot/tree/master/tools/webcam), a [black panda](https://comma.ai/shop/products/panda), and a [harness](https://comma.ai/shop/products/car-harness).
|
||||
|
||||
Community and Contributing
|
||||
------
|
||||
* [`0.8.12-prod-personal-hkg`](https://github.com/sunnyhaibin/openpilot/tree/0.8.12-prod-personal-hkg):
|
||||
|
||||
```
|
||||
cd /data; rm -rf ./openpilot; git clone -b 0.8.12-prod-personal-hkg --recurse-submodules https://github.com/sunnyhaibin/sunnypilot.git openpilot; cd openpilot; sudo reboot
|
||||
```
|
||||
openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot). Bug fixes and new car ports are encouraged. Check out [the contributing docs](docs/CONTRIBUTING.md).
|
||||
|
||||
After running the command to install the desired branch, your comma device should reboot.
|
||||
</details>
|
||||
Documentation related to openpilot development can be found on [docs.comma.ai](https://docs.comma.ai). Information about running openpilot (e.g. FAQ, fingerprinting, troubleshooting, custom forks, community hardware) should go on the [wiki](https://github.com/commaai/openpilot/wiki).
|
||||
|
||||
</details>
|
||||
You can add support for your car by following guides we have written for [Brand](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) and [Model](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel.
|
||||
|
||||
Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs#open-positions).
|
||||
|
||||
<details><summary><h3>🚗 Highlight Features</h3></summary>
|
||||
And [follow us on Twitter](https://twitter.com/comma_ai).
|
||||
|
||||
---
|
||||
User Data and comma Account
|
||||
------
|
||||
|
||||
### Quality of Life Enhancements
|
||||
- [**Modified Assistive Driving Safety (MADS)**](#modified-assistive-driving-safety-mads) - Automatic Lane Centering (ALC) / Lane Keep Assist System (LKAS) and Adaptive Cruise Control (ACC) / Smart Cruise Control (SCC) can be engaged independently of each other
|
||||
- [**Dynamic Lane Profile (DLP)**](#dynamic-lane-profile-dlp) - Dynamically switch lane profile (between Laneful and Laneless) based on lane recognition confidence
|
||||
- [**Enhanced Speed Control**](#enhanced-speed-control) - Automatically adjust cruise control speed using vision model, OpenStreetMap (OSM) data, and/or Speed Limit control (SLC) without user interaction
|
||||
* Vision-based Turn Speed Control (V-TSC) - lower speed when going around corners using vision model
|
||||
* Map-Data-based Turn Speed Control (M-TSC) - lower speed when going around corners using OSM data[^1]
|
||||
* Speed Limit Control (SLC) - Set speed limit based on map data or car interface (if applicable)
|
||||
* HKG only: Highway Driving Assist (HDA) status integration - Use cars native speed sign detection to set desired speed (on applicable HKG cars only)
|
||||
- [**Gap Adjust Cruise (GAC)**](#gap-adjust-cruise) - Allow `GAP`/`INTERVAL`/`DISTANCE` button on the steering wheel or on-screen button to adjust the follow distance from the lead car. See table below for options
|
||||
- [**Quiet Drive 🤫**](#-quiet-drive) - Toggle to mute all notification sounds (excluding driver safety warnings)
|
||||
- [**Auto Lane Change Timer**](#Auto-Lane-Change-Timer) - Set a timer to delay the auto lane change operation when the blinker is used. No nudge on the steering wheel is required to auto lane change if a timer is set
|
||||
- [**Force Car Recognition (FCR)**](#Force-Car-Recognition-) - Use a selector to force your car to be recognized by sunnypilot
|
||||
- [**Fix sunnypilot No Offroad**](#Fix-sunnypilot-No-Offroad) - Enforce sunnypilot to go offroad and turns off after shutting down the car. This feature fixes non-official devices running sunnypilot without comma power
|
||||
- [**Enable ACC+MADS with RES+/SET-**](#Enable-ACC+MADS-with-RES+/SET-) - Engage both ACC and MADS with a single press of RES+ or SET- button
|
||||
- [**Offline OSM Maps**](#Offline-OSM-Maps) - OSM database can now be downloaded locally for offline use[^2]. This enables offline SLC, V-TSC and M-TSC. Currently available for US South, US West, US Northeast, Florida, Taiwan, South Africa and New Zealand
|
||||
- [**Various Live Tuning**](#Various-Live-Tuning) - Ability to tailor your driving experience on the fly:
|
||||
* Enforce Torque Lateral Control - Use the newest [torque controller](https://blog.comma.ai/0815release/#torque-controller) for all vehicles.
|
||||
* Torque Lateral Control Live Tune - Ability to adjust the torque controller’s `FRICTION` and `LAT_ACCEL_FACTOR` values to suit your vehicle.
|
||||
* Torque Lateral Controller Self-Tune - Enable automatic turning for the Torque controller.
|
||||
By default, openpilot uploads the driving data to our servers. You can also access your data through [comma connect](https://connect.comma.ai/). We use your data to train better models and improve openpilot for everyone.
|
||||
|
||||
### Visual Enhancements
|
||||
* **M.A.D.S Status Icon** - Dedicated icon to display M.A.D.S. engagement status
|
||||
* Green🟢: M.A.D.S. engaged
|
||||
* White⚪: M.A.D.S. suspended or disengaged
|
||||
* **Lane Path Color** - Various lane path colors to display real-time Lane Model and M.A.D.S. engagement status
|
||||
* 0.8.14 and later:
|
||||
* Blue🔵: Laneful mode & M.A.D.S. engaged
|
||||
* Green🟢: Laneless mode & M.A.D.S. engaged
|
||||
* Yellow🟡: Experimental e2e & M.A.D.S. engaged
|
||||
* Pre 0.8.14:
|
||||
* Green🟢: Laneful mode & M.A.D.S. engaged
|
||||
* Red🔴: Laneless mode & M.A.D.S. engaged
|
||||
* White⚪: M.A.D.S. suspended or disengaged
|
||||
* Black⚫: M.A.D.S. engaged, steering is being manually overridden by user
|
||||
* **Developer (Dev) UI** - Display various real-time metrics on screen while driving
|
||||
* **Stand Still Timer** - Display time spent at a stop with M.A.D.S engaged (i.e., at traffic lights, stop signs, traffic congestions)
|
||||
* **Braking Status** - Current car speed text turns red when the car is braking by the driver or ACC/SCC
|
||||
openpilot is open source software: the user is free to disable data collection if they wish to do so.
|
||||
|
||||
### Operational Enhancements
|
||||
* **Fast Boot** - sunnypilot will fast boot by creating a Prebuilt file
|
||||
* **Disable Onroad Uploads** - Disable uploads completely when onroad. Necessary to avoid high data usage when connected to Wi-Fi hotspot
|
||||
* **Brightness Control (Global)** - Manually adjusts the global brightness of the screen
|
||||
* **Driving Screen Off Timer** - Turns off the device screen or reduces brightness to protect the screen after car starts
|
||||
* **Driving Screen Off Brightness (%)** - When using the Driving Screen Off feature, the brightness is reduced according to the automatic brightness ratio
|
||||
* **Max Time Offroad** - Device is automatically turned off after a set time when the engine is turned off (off-road) after driving (on-road)
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>🚗 Driving Enhancements</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
### Modified Assistive Driving Safety (MADS)
|
||||
The goal of Modified Assistive Driving Safety (MADS) is to enhance the user driving experience with modified behaviors of driving assist engagements. This feature complies with comma.ai's safety rules as accurately as possible with the following changes:
|
||||
* sunnypilot Automatic Lane Centering (ALC) and ACC/SCC can be engaged independently of each other
|
||||
* Dedicated button to toggle sunnypilot ALC:
|
||||
* `CRUISE (MAIN)` button: All supported cars on sunnypilot
|
||||
* `LFA` button: Newer HKG cars with `LFA` button
|
||||
* `LKAS` button: Honda, Toyota, Global Subaru
|
||||
* `SET-` button enables ACC/SCC
|
||||
* `CANCEL` button only disables ACC/SCC
|
||||
* `CRUISE (MAIN)` must be `ON` to use ACC/SCC
|
||||
* `CRUISE (MAIN)` button disables ACC/SCC completely when `OFF` **(strictly enforced in panda safety code)**
|
||||
|
||||
### Disengage Lateral ALC on Brake Press Mode toggle
|
||||
Dedicated toggle to handle Lateral state on brake pedal press and release:
|
||||
1. `ON`: `BRAKE pedal` press will pause Automatic Lane Centering; `BRAKE pedal` release will resume Automatic Lane Centering. Note: `BRAKE pedal` release will NOT resume ACC/SCC/Long control without explicit user engagement **(strictly enforced in panda safety code)**
|
||||
2. `OFF`: `BRAKE pedal` press will NOT pause Automatic Lane Centering; `BRAKE pedal` release will NOT resume ACC/SCC/Long control without explicit user engagement **(strictly enforced in panda safety code)**
|
||||
|
||||
### Miscellaneous
|
||||
* `TURN SIGNALS` (`Left` or `Right`) will pause Automatic Lane Centering if the vehicle speed is below the [threshold](https://github.com/commaai/openpilot/blob/master/selfdrive/controls/lib/desire_helper.py#L8) for Automatic Lane Change
|
||||
* Event audible alerts are more relaxed to match manufacturer's stock behavior
|
||||
* Critical events trigger disengagement of Automatic Lane Centering completely. The disengagement is enforced in sunnypilot and panda safety
|
||||
|
||||
### Dynamic Lane Profile (DLP)
|
||||
|
||||
Dynamic Lane Profile (DLP) aims to provide the best driving experience at staying within a lane confidently. Dynamic Lane Profile allows sunnypilot to dynamically switch between lane profiles based on lane recognition confidence level on road.
|
||||
|
||||
There are 3 modes to select on the onroad camera screen:
|
||||
* **Auto Lane**: sunnypilot dynamically chooses between `Laneline` or `Laneless` model
|
||||
* **Laneline**: sunnypilot uses Laneline model only.
|
||||
* **Laneless**: sunnypilot uses Laneless model only.
|
||||
|
||||
To use Dynamic Lane Profile, do the following:
|
||||
```
|
||||
1. sunnypilot Settings -> `SP - Controls` -> Enable Dynamic Lane Profile -> ON toggle
|
||||
2. Reboot.
|
||||
3. Before driving, on the onroad camera screen, toggle between the 3 modes by pressing on the button.
|
||||
4. Drive.
|
||||
```
|
||||
|
||||
### Enhanced Speed Control
|
||||
This fork now allows supported cars to dynamically adjust the longitudinal plan based on the fetched map data. Big thanks to the Move Fast team for the amazing implementation!
|
||||
|
||||
**Supported cars:**
|
||||
* sunnypilot Longitudinal Control capable
|
||||
* Stock Longitudinal Control
|
||||
* Hyundai/Kia/Genesis (non CAN-FD)
|
||||
* Honda Bosch
|
||||
* Volkswagen MQB
|
||||
|
||||
Certain features are only available with an active data connection, via:
|
||||
* [comma Prime](https://comma.ai/prime) - Intuitive service provided directly by comma, or
|
||||
* Personal Hotspot - From your mobile device, or a dedicated hotspot from a cellular carrier.
|
||||
|
||||
**Features:**
|
||||
* Vision-based Turn Speed Control (VTSC) - Use vision path predictions to estimate the appropriate speed to drive through turns ahead - i.e. slowing down for curves
|
||||
* Map-Data-based Turn Speed Control (MTSC) - Use curvature information from map data to define speed limits to take turns ahead - i.e. slowing down for curves[^1]
|
||||
* Speed Limit Control (SLC) - Use speed limit signs information from map data and car interface to automatically adapt cruise speed to road limits
|
||||
* HKG only: Highway Driving Assist (HDA) status integration - on applicable HKG cars only[^1]
|
||||
* Speed Limit Offset - When Speed Limit Control is enabled, set speed limit slightly higher than the actual speed limit for a more natural drive[^1]
|
||||
* Toggle Hands on Wheel Monitoring - Monitors and alerts the driver when their hands have not been on the steering wheel for an extended time
|
||||
|
||||
### Custom Stock Longitudinal Control
|
||||
While using stock Adaptive/Smart Cruise Control, Custom Stock Longitudinal Control in sunnypilot allows sunnypilot to manipulate and take over the set speed on the car's dashboard.
|
||||
|
||||
**Supported Cars:**
|
||||
* Hyundai/Kia/Genesis
|
||||
* CAN platform
|
||||
* CAN-FD platform with 0x1CF broadcasted in CAN traffic
|
||||
* Honda Bosch
|
||||
* Volkswagen MQB
|
||||
|
||||
**Instruction**
|
||||
|
||||
**📗 How to use Custom Longitudinal Control on sunnypilot **
|
||||
|
||||
When using Speed Limit, Vision, or Map based Turn control, you will be setting the "MAX" ACC speed on the sunnypilot display instead of the one in the dashboard. The car will then set the ACC setting in the dashboard to the targeted speed, but will never exceed the max speed set on the sunnypilot display. A quick press of the RES+ or SET- buttons will change this speed by 5 MPH or KM/H on the sunnypilot display, while a long deliberate press (about a 1/2 second press) changes it by 1 MPH or KM/H. DO NOT hold the RES+ or SET- buttons for longer that a 1 second. Either make quick or long deliberate presses only.
|
||||
|
||||
**‼ Where to look when setting ACC speed ‼**
|
||||
|
||||
Do not look at the dashboard when setting your ACC max speed. Instead, only look at the one on the sunnypilot display, "MAX". The reason you need to look at the sunnypilot display is because sunnypilot will be changing the one in the dashboard. It will be adjusting it as needed, never raising it above the one set on the sunnypilot display. ONLY look at the MAX speed on the sunnypilot display when setting the ACC speed instead of the dashboard!
|
||||
|
||||
(Courtesy instructions from John, author of jvePilot)
|
||||
|
||||
### Gap Adjust Cruise
|
||||
This fork now allows supported openpilot longitudinal cars to adjust the cruise gap between the car and the lead car.
|
||||
|
||||
**Supported cars:**
|
||||
* sunnypilot Longitudinal Control capable
|
||||
|
||||
🚨**PROCEED WITH EXTREME CAUTION AND BE READY TO MANUALLY TAKE OVER AT ALL TIMES**
|
||||
|
||||
There are 4 modes to select on the steering wheel and/or the onroad camera screen:
|
||||
* **Stock Gap**: Stock sunnypilot distance - 1.45 second profile
|
||||
* **Mild Gap**: Semi-aggressive distance - 1.25 second profile
|
||||
* 🚨**Aggro Gap**🚨: Aggressive distance - 1.0 second profile
|
||||
|
||||
**Availability**
|
||||
|
||||
| Car Make | Stock Gap | Mild Gap | Aggro Gap |
|
||||
|:-------------------:|:---------:|:--------:|:---------:|
|
||||
| Honda/Acura | ✅ | ✅ | ✅ |
|
||||
| Hyundai/Kia/Genesis | ✅ | ✅ | ✅ |
|
||||
| Toyota/Lexus | ✅ | ✅ | ✅ |
|
||||
| Volkswagen MQB/PQ | ✅ | ✅ | ✅ |
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<details><summary><h3>⚒ Branch Definitions</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
| Tag | Definition | Description |
|
||||
|:---------:|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `release` | Release branches | Include features that are **verified** by trusted testers and the community. Ready to use. ✅ |
|
||||
| `staging` | Staging branches | Include new features that are **tested** by trusted testers and the community. Stability may vary. ⚠ |
|
||||
| `dev` | Development branches | All features are gathered in respective versions. Reviewed and merged features will be committed to `dev`. Stability may vary. ⚠ |
|
||||
| `master` | Main branch | Syncs with [commaai's openpilot `master`](https://github.com/commaai/openpilot) upstream branch. Accepts all pull requests. Does not include all sunnypilot features. Stability may vary. ⚠ |
|
||||
|
||||
Example:
|
||||
* [`release-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/release-c3): Latest release branch for comma three that are verified by trusted testers and the community. Ready to use.
|
||||
* [`staging-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/staging-c3): Latest staging branch for comma three that are tested by trusted testers and the community. Verification required.
|
||||
* [`dev-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/dev-c3): Latest development branch for comma three that include all sunnypilot features. Testing required.
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>✅ Recommended Branches</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
| Branch | Definition | Compatible Device | Changelogs |
|
||||
|:------------------------------------------------------------------------------------|---------------------------------------------------------|-------------------|--------------------------------------------------------------------------------------------|
|
||||
| [`release-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/release-c3) | • Latest release/stable branch | comma three | [`CHANGELOGS.md`](https://github.com/sunnyhaibin/sunnypilot/blob/release-c3/CHANGELOGS.md) |
|
||||
| [`staging-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/staging-c3) | • Latest staging branch | comma three | [`CHANGELOGS.md`](https://github.com/sunnyhaibin/sunnypilot/blob/staging-c3/CHANGELOGS.md) |
|
||||
| [`dev-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/dev-c3) | • Latest development branch with experimental features | comma three | [`CHANGELOGS.md`](https://github.com/sunnyhaibin/sunnypilot/blob/dev-c3/CHANGELOGS.md) |
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>📗 How To's</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
How-To instructions can be found in [HOW-TOS.md](https://github.com/sunnyhaibin/openpilot/blob/(!)README/HOW-TOS.md).
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<details><summary><h3>🎆 Pull Requests</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
We welcome both pull requests and issues on GitHub. Bug fixes are encouraged.
|
||||
|
||||
Pull requests should be against the most current `master` branch.
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>🏆 Special Thanks</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
* [spektor56](https://github.com/spektor56/openpilot)
|
||||
* [rav4kumar](https://github.com/rav4kumar/openpilot)
|
||||
* [mob9221](https://github.com/mob9221/opendbc)
|
||||
* [briantran33](https://github.com/briantran33/openpilot)
|
||||
* [Aragon7777](https://github.com/aragon7777/openpilot)
|
||||
* [sshane](https://github.com/sshane/openpilot-installer-generator)
|
||||
* [jung](https://github.com/chanhojung/openpilot)
|
||||
* [dri94](https://github.com/dri94/openpilot)
|
||||
* [FrogAi](https://github.com/frogAi/FrogPilot/)
|
||||
* [twilsonco](https://github.com/twilsonco/openpilot)
|
||||
* [martinl](https://github.com/martinl/openpilot)
|
||||
* [multikyd](https://github.com/openpilotkr)
|
||||
* [Move Fast GmbH](https://github.com/move-fast/openpilot)
|
||||
* [dragonpilot](https://github.com/dragonpilot-community/dragonpilot)
|
||||
* [neokii](https://github.com/neokii/openpilot)
|
||||
* [AlexandreSato](https://github.com/AlexandreSato/openpilot)
|
||||
* [Moodkiller](https://github.com/moodkiller)
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><h3>📊 User Data</h3></summary>
|
||||
|
||||
---
|
||||
|
||||
By default, sunnypilot uploads the driving data to comma servers. You can also access your data through [comma connect](https://connect.comma.ai/).
|
||||
|
||||
sunnypilot is open source software. The user is free to disable data collection if they wish to do so.
|
||||
|
||||
sunnypilot logs the road-facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
|
||||
openpilot logs the road-facing cameras, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
|
||||
The driver-facing camera is only logged if you explicitly opt-in in settings. The microphone is not recorded.
|
||||
|
||||
By using this software, you understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
|
||||
By using openpilot, you agree to [our Privacy Policy](https://comma.ai/privacy). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
|
||||
|
||||
</details>
|
||||
Safety and Testing
|
||||
----
|
||||
|
||||
<details><summary><h3>Licensing</h3></summary>
|
||||
* openpilot observes ISO26262 guidelines, see [SAFETY.md](docs/SAFETY.md) for more details.
|
||||
* openpilot has software-in-the-loop [tests](.github/workflows/selfdrive_tests.yaml) that run on every commit.
|
||||
* The code enforcing the safety model lives in panda and is written in C, see [code rigor](https://github.com/commaai/panda#code-rigor) for more details.
|
||||
* panda has software-in-the-loop [safety tests](https://github.com/commaai/panda/tree/master/tests/safety).
|
||||
* Internally, we have a hardware-in-the-loop Jenkins test suite that builds and unit tests the various processes.
|
||||
* panda has additional hardware-in-the-loop [tests](https://github.com/commaai/panda/blob/master/Jenkinsfile).
|
||||
* We run the latest openpilot in a testing closet containing 10 comma devices continuously replaying routes.
|
||||
|
||||
Directory Structure
|
||||
------
|
||||
.
|
||||
├── cereal # The messaging spec and libs used for all logs
|
||||
├── common # Library like functionality we've developed here
|
||||
├── docs # Documentation
|
||||
├── opendbc # Files showing how to interpret data from cars
|
||||
├── panda # Code used to communicate on CAN
|
||||
├── third_party # External libraries
|
||||
└── system # Generic services
|
||||
├── camerad # Driver to capture images from the camera sensors
|
||||
├── clocksd # Broadcasts current time
|
||||
├── hardware # Hardware abstraction classes
|
||||
├── logcatd # systemd journal as a service
|
||||
├── loggerd # Logger and uploader of car data
|
||||
├── proclogd # Logs information from /proc
|
||||
├── sensord # IMU interface code
|
||||
└── ubloxd # u-blox GNSS module interface code
|
||||
└── selfdrive # Code needed to drive the car
|
||||
├── assets # Fonts, images, and sounds for UI
|
||||
├── athena # Allows communication with the app
|
||||
├── boardd # Daemon to talk to the board
|
||||
├── car # Car specific code to read states and control actuators
|
||||
├── controls # Planning and controls
|
||||
├── debug # Tools to help you debug and do car ports
|
||||
├── locationd # Precise localization and vehicle parameter estimation
|
||||
├── manager # Daemon that starts/stops all other daemons as needed
|
||||
├── modeld # Driving and monitoring model runners
|
||||
├── monitoring # Daemon to determine driver attention
|
||||
├── navd # Turn-by-turn navigation
|
||||
├── test # Unit tests, system tests, and a car simulator
|
||||
└── ui # The UI
|
||||
|
||||
Licensing
|
||||
------
|
||||
|
||||
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
|
||||
|
||||
Any user of this software shall indemnify and hold harmless comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys’ fees and costs) which arise out of, relate to or result from any use of this software by user.
|
||||
Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys’ fees and costs) which arise out of, relate to or result from any use of this software by user.
|
||||
|
||||
**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT.
|
||||
YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS.
|
||||
NO WARRANTY EXPRESSED OR IMPLIED.**
|
||||
|
||||
</details>
|
||||
|
||||
<h3>💰 Support sunnypilot</h3>
|
||||
|
||||
---
|
||||
|
||||
If you find any of the features useful, consider becoming a [patron on Patreon](https://www.patreon.com/sunnyhaibin) or a [sponsor on GitHub](https://github.com/sponsors/sunnyhaibin) to support future feature development and improvements.
|
||||
<img src="https://d1qb2nb5cznatu.cloudfront.net/startups/i/1061157-bc7e9bf3b246ece7322e6ffe653f6af8-medium_jpg.jpg?buster=1458363130" width="75"></img> <img src="https://cdn-images-1.medium.com/max/1600/1*C87EjxGeMPrkTuVRVWVg4w.png" width="225"></img>
|
||||
|
||||
|
||||
By becoming a patron/sponsor, you will gain access to exclusive content, early access to new features, and the opportunity to directly influence the project's development.
|
||||
|
||||
<h3>Patreon</h3>
|
||||
|
||||
<a href="https://www.patreon.com/sunnyhaibin">
|
||||
<img src="https://user-images.githubusercontent.com/47793918/244128051-bc7e913e-a196-4455-926e-23aec9a4bd3b.png" alt="Become a Patron" width="300" style="max-width: 100%; height: auto;">
|
||||
</a>
|
||||
<br>
|
||||
|
||||
<h3>GitHub Sponsor</h3>
|
||||
|
||||
<a href="https://github.com/sponsors/sunnyhaibin">
|
||||
<img src="https://user-images.githubusercontent.com/47793918/244135584-9800acbd-69fd-4b2b-bec9-e5fa2d85c817.png" alt="Become a Sponsor" width="300" style="max-width: 100%; height: auto;">
|
||||
</a>
|
||||
<br>
|
||||
|
||||
<h3>PayPal</h3>
|
||||
|
||||
<a href="https://paypal.me/sunnyhaibin0850" target="_blank">
|
||||
<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="PayPal this" title="PayPal - The safer, easier way to pay online!" border="0" />
|
||||
</a>
|
||||
<br></br>
|
||||
|
||||
Your continuous love and support are greatly appreciated! Enjoy 🥰
|
||||
|
||||
<span>-</span> Jason, Founder of sunnypilot
|
||||
|
||||
[^1]:Requires data connection if not using Offline Maps data
|
||||
[^2]:At least 50 GB of storage space is required. If you have the 32 GB version of comma three, upgrading with a compatible 250 GB or 1 TB SSD is strongly recommended
|
||||
[^4]:Shortened URL for convenience. Full URL is ```smiskol.com/fork/sunnyhaibin/release-c3```
|
||||
[](https://github.com/commaai/openpilot/actions)
|
||||
[](https://codecov.io/gh/commaai/openpilot)
|
||||
|
||||
61
RELEASES.md
61
RELEASES.md
@@ -1,59 +1,8 @@
|
||||
Version 0.9.8 (2024-XX-XX)
|
||||
Version 0.9.5 (202X-XX-XX)
|
||||
========================
|
||||
* Added toggle to enable driver monitoring even when openpilot is not engaged
|
||||
|
||||
Version 0.9.7 (2024-06-13)
|
||||
========================
|
||||
* New driving model
|
||||
* Inputs the past curvature for smoother and more accurate lateral control
|
||||
* Simplified neural network architecture in the model's last layers
|
||||
* Minor fixes to desire augmentation and weight decay
|
||||
* New driver monitoring model
|
||||
* Improved end-to-end bit for phone detection
|
||||
* Adjust driving personality with the follow distance button
|
||||
* Support for hybrid variants of supported Ford models
|
||||
* Fingerprinting without the OBD-II port on all cars
|
||||
* Improved fuzzy fingerprinting for Ford and Volkswagen
|
||||
|
||||
Version 0.9.6 (2024-02-27)
|
||||
========================
|
||||
* New driving model
|
||||
* Vision model trained on more data
|
||||
* Improved driving performance
|
||||
* Directly outputs curvature for lateral control
|
||||
* New driver monitoring model
|
||||
* Trained on larger dataset
|
||||
* Model path UI
|
||||
* Shows where driving model wants to be
|
||||
* Shows what model is seeing more clearly, but more jittery
|
||||
* AGNOS 9
|
||||
* comma body streaming and controls over WebRTC
|
||||
* Improved fuzzy fingerprinting for many makes and models
|
||||
* Alpha longitudinal support for new Toyota models
|
||||
* Chevrolet Equinox 2019-22 support thanks to JasonJShuler and nworb-cire!
|
||||
* Dodge Durango 2020-21 support
|
||||
* Hyundai Staria 2023 support thanks to sunnyhaibin!
|
||||
* Kia Niro Plug-in Hybrid 2022 support thanks to sunnyhaibin!
|
||||
* Lexus LC 2024 support thanks to nelsonjchen!
|
||||
* Toyota RAV4 2023-24 support
|
||||
* Toyota RAV4 Hybrid 2023-24 support
|
||||
|
||||
Version 0.9.5 (2023-11-17)
|
||||
========================
|
||||
* New driving model
|
||||
* Improved navigate on openpilot performance using navigation instructions as an additional model input
|
||||
* Do lateral planning inside the model
|
||||
* New vision transformer architecture
|
||||
* Cadillac Escalade ESV 2019 support thanks to twilsonco!
|
||||
* Hyundai Azera 2022 support thanks to sunnyhaibin!
|
||||
* Hyundai Azera Hybrid 2020 support thanks to chanhojung and haram-KONA!
|
||||
* Hyundai Custin 2023 support thanks to sunnyhaibin and Saber422!
|
||||
* Hyundai Ioniq 6 2023 support thanks to sunnyhaibin and alamo3!
|
||||
* Hyundai Ioniq 6 2023 support thanks to sunnyhaibin, alamo3, and sshane!
|
||||
* Hyundai Kona Electric 2023 (Korean version) support thanks to sunnyhaibin and haram-KONA!
|
||||
* Kia K8 Hybrid (with HDA II) 2023 support thanks to sunnyhaibin!
|
||||
* Kia Optima Hybrid 2019 support
|
||||
* Kia Sorento Hybrid 2023 support thanks to sunnyhaibin!
|
||||
* Lexus GS F 2016 support thanks to snyperifle!
|
||||
* Lexus IS 2023 support thanks to L3R5!
|
||||
|
||||
Version 0.9.4 (2023-07-27)
|
||||
@@ -643,7 +592,7 @@ Version 0.5.13 (2019-05-31)
|
||||
* Reduce CPU utilization by 20% and improve stability
|
||||
* Temporarily remove mapd functionalities to improve stability
|
||||
* Add openpilot record-only mode for unsupported cars
|
||||
* Synchronize controlsd to pandad to reduce latency
|
||||
* Synchronize controlsd to boardd to reduce latency
|
||||
* Remove panda support for Subaru giraffe
|
||||
|
||||
Version 0.5.12 (2019-05-16)
|
||||
@@ -979,7 +928,7 @@ Version 0.2.8 (2017-02-27)
|
||||
Version 0.2.7 (2017-02-08)
|
||||
===========================
|
||||
* Better performance and pictures at night
|
||||
* Fix ptr alignment issue in pandad
|
||||
* Fix ptr alignment issue in boardd
|
||||
* Fix brake error light, fix crash if too cold
|
||||
|
||||
Version 0.2.6 (2017-01-31)
|
||||
@@ -1011,7 +960,7 @@ Version 0.2.2 (2017-01-10)
|
||||
Version 0.2.1 (2016-12-14)
|
||||
===========================
|
||||
* Performance improvements, removal of more numpy
|
||||
* Fix pandad process priority
|
||||
* Fix boardd process priority
|
||||
* Make counter timer reset on use of steering wheel
|
||||
|
||||
Version 0.2 (2016-12-12)
|
||||
|
||||
172
SConstruct
172
SConstruct
@@ -9,18 +9,11 @@ import SCons.Errors
|
||||
|
||||
SCons.Warnings.warningAsException(True)
|
||||
|
||||
# pending upstream fix - https://github.com/SCons/scons/issues/4461
|
||||
#SetOption('warn', 'all')
|
||||
|
||||
TICI = os.path.isfile('/TICI')
|
||||
AGNOS = TICI
|
||||
UBUNTU_FOCAL = int(subprocess.check_output('[ -f /etc/os-release ] && . /etc/os-release && [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ] && echo 1 || echo 0', shell=True, encoding='utf-8').rstrip())
|
||||
Export('UBUNTU_FOCAL')
|
||||
|
||||
Decider('MD5-timestamp')
|
||||
|
||||
SetOption('num_jobs', int(os.cpu_count()/2))
|
||||
|
||||
AddOption('--kaitai',
|
||||
action='store_true',
|
||||
help='Regenerate kaitai struct parsers')
|
||||
@@ -33,10 +26,6 @@ AddOption('--ubsan',
|
||||
action='store_true',
|
||||
help='turn on UBSan')
|
||||
|
||||
AddOption('--coverage',
|
||||
action='store_true',
|
||||
help='build with test coverage options')
|
||||
|
||||
AddOption('--clazy',
|
||||
action='store_true',
|
||||
help='build with clazy')
|
||||
@@ -45,12 +34,6 @@ AddOption('--compile_db',
|
||||
action='store_true',
|
||||
help='build clang compilation database')
|
||||
|
||||
AddOption('--ccflags',
|
||||
action='store',
|
||||
type='string',
|
||||
default='',
|
||||
help='pass arbitrary flags over the command line')
|
||||
|
||||
AddOption('--snpe',
|
||||
action='store_true',
|
||||
help='use SNPE on PC')
|
||||
@@ -69,15 +52,9 @@ AddOption('--pc-thneed',
|
||||
AddOption('--minimal',
|
||||
action='store_false',
|
||||
dest='extras',
|
||||
default=os.path.exists(File('#.lfsconfig').abspath), # minimal by default on release branch (where there's no LFS)
|
||||
default=os.path.islink(Dir('#laika/').abspath),
|
||||
help='the minimum build to run openpilot. no tests, tools, etc.')
|
||||
|
||||
AddOption('--stock-ui',
|
||||
action='store_true',
|
||||
dest='stock_ui',
|
||||
default=False,
|
||||
help='Build stock UI instead of sunnypilot UI')
|
||||
|
||||
## Architecture name breakdown (arch)
|
||||
## - larch64: linux tici aarch64
|
||||
## - aarch64: linux pc aarch64
|
||||
@@ -104,12 +81,15 @@ lenv = {
|
||||
rpath = lenv["LD_LIBRARY_PATH"].copy()
|
||||
|
||||
if arch == "larch64":
|
||||
lenv["LD_LIBRARY_PATH"] += ['/data/data/com.termux/files/usr/lib']
|
||||
|
||||
cpppath = [
|
||||
"#third_party/opencl/include",
|
||||
]
|
||||
|
||||
libpath = [
|
||||
"/usr/local/lib",
|
||||
"/usr/lib",
|
||||
"/system/vendor/lib64",
|
||||
f"#third_party/acados/{arch}/lib",
|
||||
]
|
||||
@@ -126,7 +106,10 @@ else:
|
||||
cflags = []
|
||||
cxxflags = []
|
||||
cpppath = []
|
||||
rpath += []
|
||||
rpath += [
|
||||
Dir("#cereal").abspath,
|
||||
Dir("#common").abspath
|
||||
]
|
||||
|
||||
# MacOS
|
||||
if arch == "Darwin":
|
||||
@@ -150,6 +133,9 @@ else:
|
||||
libpath = [
|
||||
f"#third_party/acados/{arch}/lib",
|
||||
f"#third_party/libyuv/{arch}/lib",
|
||||
f"#third_party/mapbox-gl-native-qt/{arch}",
|
||||
"#cereal",
|
||||
"#common",
|
||||
"/usr/lib",
|
||||
"/usr/local/lib",
|
||||
]
|
||||
@@ -177,16 +163,9 @@ if arch != "Darwin":
|
||||
ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"]
|
||||
|
||||
# Enable swaglog include in submodules
|
||||
cflags += ['-DSWAGLOG="\\"common/swaglog.h\\""']
|
||||
cxxflags += ['-DSWAGLOG="\\"common/swaglog.h\\""']
|
||||
|
||||
if not GetOption('stock_ui'):
|
||||
cflags += ["-DSUNNYPILOT"]
|
||||
cxxflags += ["-DSUNNYPILOT"]
|
||||
|
||||
ccflags_option = GetOption('ccflags')
|
||||
if ccflags_option:
|
||||
ccflags += ccflags_option.split(' ')
|
||||
|
||||
env = Environment(
|
||||
ENV=lenv,
|
||||
CCFLAGS=[
|
||||
@@ -203,7 +182,6 @@ env = Environment(
|
||||
"-Wno-c99-designator",
|
||||
"-Wno-reorder-init-list",
|
||||
"-Wno-error=unused-but-set-variable",
|
||||
"-Wno-vla-cxx-extension",
|
||||
] + cflags + ccflags,
|
||||
|
||||
CPPPATH=cpppath + [
|
||||
@@ -216,12 +194,11 @@ env = Environment(
|
||||
"#third_party/json11",
|
||||
"#third_party/linux/include",
|
||||
"#third_party/snpe/include",
|
||||
"#third_party/mapbox-gl-native-qt/include",
|
||||
"#third_party/qrcode",
|
||||
"#third_party",
|
||||
"#cereal",
|
||||
"#msgq",
|
||||
"#opendbc/can",
|
||||
"#third_party/maplibre-native-qt/include",
|
||||
f"#third_party/maplibre-native-qt/{arch}/include"
|
||||
],
|
||||
|
||||
CC='clang',
|
||||
@@ -233,17 +210,15 @@ env = Environment(
|
||||
CFLAGS=["-std=gnu11"] + cflags,
|
||||
CXXFLAGS=["-std=c++1z"] + cxxflags,
|
||||
LIBPATH=libpath + [
|
||||
"#msgq_repo",
|
||||
"#cereal",
|
||||
"#third_party",
|
||||
"#selfdrive/pandad",
|
||||
"#opendbc/can",
|
||||
"#selfdrive/boardd",
|
||||
"#common",
|
||||
"#rednose/helpers",
|
||||
],
|
||||
CYTHONCFILESUFFIX=".cpp",
|
||||
COMPILATIONDB_USE_ABSPATH=True,
|
||||
REDNOSE_ROOT="#",
|
||||
tools=["default", "cython", "compilation_db", "rednose_filter"],
|
||||
toolpath=["#site_scons/site_tools", "#rednose_repo/site_scons/site_tools"],
|
||||
tools=["default", "cython", "compilation_db"],
|
||||
)
|
||||
|
||||
if arch == "Darwin":
|
||||
@@ -255,8 +230,7 @@ if GetOption('compile_db'):
|
||||
env.CompilationDatabase('compile_commands.json')
|
||||
|
||||
# Setup cache dir
|
||||
default_cache_dir = '/data/scons_cache' if AGNOS else '/tmp/scons_cache'
|
||||
cache_dir = ARGUMENTS.get('cache_dir', default_cache_dir)
|
||||
cache_dir = '/data/scons_cache' if AGNOS else '/tmp/scons_cache'
|
||||
CacheDir(cache_dir)
|
||||
Clean(["."], cache_dir)
|
||||
|
||||
@@ -270,6 +244,18 @@ def progress_function(node):
|
||||
if os.environ.get('SCONS_PROGRESS'):
|
||||
Progress(progress_function, interval=node_interval)
|
||||
|
||||
SHARED = False
|
||||
|
||||
# TODO: this can probably be removed
|
||||
def abspath(x):
|
||||
if arch == 'aarch64':
|
||||
pth = os.path.join("/data/pythonpath", x[0].path)
|
||||
env.Depends(pth, x)
|
||||
return File(pth)
|
||||
else:
|
||||
# rpath works elsewhere
|
||||
return x[0].path.rsplit("/", 1)[1][:-3]
|
||||
|
||||
# Cython build environment
|
||||
py_include = sysconfig.get_paths()['include']
|
||||
envCython = env.Clone()
|
||||
@@ -283,8 +269,7 @@ if arch == "Darwin":
|
||||
else:
|
||||
envCython["LINKFLAGS"] = ["-pthread", "-shared"]
|
||||
|
||||
np_version = SCons.Script.Value(np.__version__)
|
||||
Export('envCython', 'np_version')
|
||||
Export('envCython')
|
||||
|
||||
# Qt build environment
|
||||
qt_env = env.Clone()
|
||||
@@ -307,11 +292,8 @@ else:
|
||||
qt_env['QTDIR'] = qt_install_prefix
|
||||
qt_dirs = [
|
||||
f"{qt_install_headers}",
|
||||
f"{qt_install_headers}/QtGui/5.12.8/QtGui",
|
||||
]
|
||||
|
||||
qt_gui_path = os.path.join(qt_install_headers, "QtGui")
|
||||
qt_gui_dirs = [d for d in os.listdir(qt_gui_path) if os.path.isdir(os.path.join(qt_gui_path, d))]
|
||||
qt_dirs += [f"{qt_install_headers}/QtGui/{qt_gui_dirs[0]}/QtGui", ] if qt_gui_dirs else []
|
||||
qt_dirs += [f"{qt_install_headers}/Qt{m}" for m in qt_modules]
|
||||
|
||||
qt_libs = [f"Qt5{m}" for m in qt_modules]
|
||||
@@ -328,7 +310,7 @@ try:
|
||||
except SCons.Errors.UserError:
|
||||
qt_env.Tool('qt')
|
||||
|
||||
qt_env['CPPPATH'] += qt_dirs + ["#third_party/qrcode"]
|
||||
qt_env['CPPPATH'] += qt_dirs + ["#selfdrive/ui/qt/"]
|
||||
qt_flags = [
|
||||
"-D_REENTRANT",
|
||||
"-DQT_NO_DEBUG",
|
||||
@@ -341,8 +323,7 @@ qt_flags = [
|
||||
"-DQT_MESSAGELOGCONTEXT",
|
||||
]
|
||||
qt_env['CXXFLAGS'] += qt_flags
|
||||
qt_env['LIBPATH'] += ['#selfdrive/ui', f"#third_party/maplibre-native-qt/{arch}/lib"]
|
||||
qt_env['RPATH'] += [Dir(f"#third_party/maplibre-native-qt/{arch}/lib").srcnode().abspath]
|
||||
qt_env['LIBPATH'] += ['#selfdrive/ui']
|
||||
qt_env['LIBS'] = qt_libs
|
||||
|
||||
if GetOption("clazy"):
|
||||
@@ -356,58 +337,97 @@ if GetOption("clazy"):
|
||||
qt_env['ENV']['CLAZY_IGNORE_DIRS'] = qt_dirs[0]
|
||||
qt_env['ENV']['CLAZY_CHECKS'] = ','.join(checks)
|
||||
|
||||
Export('env', 'qt_env', 'arch', 'real_arch')
|
||||
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED')
|
||||
|
||||
# Build common module
|
||||
SConscript(['common/SConscript'])
|
||||
Import('_common', '_gpucommon')
|
||||
|
||||
common = [_common, 'json11']
|
||||
gpucommon = [_gpucommon]
|
||||
if SHARED:
|
||||
common, gpucommon = abspath(common), abspath(gpucommon)
|
||||
else:
|
||||
common = [_common, 'json11']
|
||||
gpucommon = [_gpucommon]
|
||||
|
||||
Export('common', 'gpucommon')
|
||||
|
||||
# Build messaging (cereal + msgq + socketmaster + their dependencies)
|
||||
SConscript(['msgq_repo/SConscript'])
|
||||
# cereal and messaging are shared with the system
|
||||
SConscript(['cereal/SConscript'])
|
||||
Import('socketmaster', 'msgq')
|
||||
messaging = [socketmaster, msgq, 'zmq', 'capnp', 'kj',]
|
||||
Export('messaging')
|
||||
if SHARED:
|
||||
cereal = abspath([File('cereal/libcereal_shared.so')])
|
||||
messaging = abspath([File('cereal/libmessaging_shared.so')])
|
||||
else:
|
||||
cereal = [File('#cereal/libcereal.a')]
|
||||
messaging = [File('#cereal/libmessaging.a')]
|
||||
visionipc = [File('#cereal/libvisionipc.a')]
|
||||
messaging_python = [File('#cereal/messaging/messaging_pyx.so')]
|
||||
|
||||
Export('cereal', 'messaging', 'messaging_python', 'visionipc')
|
||||
|
||||
# Build other submodules
|
||||
SConscript([
|
||||
'opendbc/can/SConscript',
|
||||
'panda/SConscript',
|
||||
])
|
||||
# Build rednose library and ekf models
|
||||
|
||||
# Build rednose library
|
||||
rednose_deps = [
|
||||
"#selfdrive/locationd/models/constants.py",
|
||||
"#selfdrive/locationd/models/gnss_helpers.py",
|
||||
]
|
||||
|
||||
rednose_config = {
|
||||
'generated_folder': '#selfdrive/locationd/models/generated',
|
||||
'to_build': {
|
||||
'gnss': ('#selfdrive/locationd/models/gnss_kf.py', True, [], rednose_deps),
|
||||
'live': ('#selfdrive/locationd/models/live_kf.py', True, ['live_kf_constants.h'], rednose_deps),
|
||||
'car': ('#selfdrive/locationd/models/car_kf.py', True, [], rednose_deps),
|
||||
},
|
||||
}
|
||||
|
||||
if arch != "larch64":
|
||||
rednose_config['to_build'].update({
|
||||
'loc_4': ('#selfdrive/locationd/models/loc_kf.py', True, [], rednose_deps),
|
||||
'lane': ('#selfdrive/locationd/models/lane_kf.py', True, [], rednose_deps),
|
||||
'pos_computer_4': ('#rednose/helpers/lst_sq_computer.py', False, [], []),
|
||||
'pos_computer_5': ('#rednose/helpers/lst_sq_computer.py', False, [], []),
|
||||
'feature_handler_5': ('#rednose/helpers/feature_handler.py', False, [], []),
|
||||
})
|
||||
|
||||
Export('rednose_config')
|
||||
SConscript(['rednose/SConscript'])
|
||||
|
||||
# Build system services
|
||||
SConscript([
|
||||
'system/clocksd/SConscript',
|
||||
'system/proclogd/SConscript',
|
||||
'system/ubloxd/SConscript',
|
||||
'system/loggerd/SConscript',
|
||||
])
|
||||
if arch != "Darwin":
|
||||
SConscript([
|
||||
'system/camerad/SConscript',
|
||||
'system/sensord/SConscript',
|
||||
'system/logcatd/SConscript',
|
||||
])
|
||||
|
||||
if arch == "larch64":
|
||||
SConscript(['system/camerad/SConscript'])
|
||||
|
||||
# Build openpilot
|
||||
|
||||
# build submodules
|
||||
SConscript([
|
||||
'body/board/SConscript',
|
||||
'cereal/SConscript',
|
||||
'opendbc/can/SConscript',
|
||||
'panda/SConscript',
|
||||
])
|
||||
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
||||
SConscript(['selfdrive/SConscript'])
|
||||
SConscript(['selfdrive/boardd/SConscript'])
|
||||
SConscript(['selfdrive/controls/lib/lateral_mpc_lib/SConscript'])
|
||||
SConscript(['selfdrive/controls/lib/longitudinal_mpc_lib/SConscript'])
|
||||
SConscript(['selfdrive/locationd/SConscript'])
|
||||
SConscript(['selfdrive/navd/SConscript'])
|
||||
SConscript(['selfdrive/modeld/SConscript'])
|
||||
SConscript(['selfdrive/ui/SConscript'])
|
||||
|
||||
if Dir('#tools/cabana/').exists() and GetOption('extras'):
|
||||
if arch in ['x86_64', 'aarch64', 'Darwin'] and Dir('#tools/cabana/').exists() and GetOption('extras'):
|
||||
SConscript(['tools/replay/SConscript'])
|
||||
if arch != "larch64":
|
||||
SConscript(['tools/cabana/SConscript'])
|
||||
SConscript(['tools/cabana/SConscript'])
|
||||
|
||||
external_sconscript = GetOption('external_sconscript')
|
||||
if external_sconscript:
|
||||
|
||||
1
body
Submodule
1
body
Submodule
Submodule body added at 6ff44357a3
1
cereal
Submodule
1
cereal
Submodule
Submodule cereal added at 82bca3a971
@@ -1,51 +0,0 @@
|
||||
# What is cereal?
|
||||
|
||||
cereal is the messaging system for openpilot. It uses [msgq](https://github.com/commaai/msgq) as a pub/sub backend, and [Cap'n proto](https://capnproto.org/capnp-tool.html) for serialization of the structs.
|
||||
|
||||
|
||||
## Messaging Spec
|
||||
|
||||
You'll find the message types in [log.capnp](log.capnp). It uses [Cap'n proto](https://capnproto.org/capnp-tool.html) and defines one struct called `Event`.
|
||||
|
||||
All `Events` have a `logMonoTime` and a `valid`. Then a big union defines the packet type.
|
||||
|
||||
### Best Practices
|
||||
|
||||
- **All fields must describe quantities in SI units**, unless otherwise specified in the field name.
|
||||
- In the context of the message they are in, field names should be completely unambiguous.
|
||||
- All values should be easy to plot and be human-readable with minimal parsing.
|
||||
|
||||
### Maintaining backwards-compatibility
|
||||
|
||||
When making changes to the messaging spec you want to maintain backwards-compatibility, such that old logs can
|
||||
be parsed with a new version of cereal. Adding structs and adding members to structs is generally safe, most other
|
||||
things are not. Read more details [here](https://capnproto.org/language.html).
|
||||
|
||||
### Custom forks
|
||||
|
||||
Forks of [openpilot](https://github.com/commaai/openpilot) might want to add things to the messaging
|
||||
spec, however this could conflict with future changes made in mainline cereal/openpilot. Rebasing against mainline openpilot
|
||||
then means breaking backwards-compatibility with all old logs of your fork. So we added reserved events in
|
||||
[custom.capnp](custom.capnp) that we will leave empty in mainline cereal/openpilot. **If you only modify those, you can ensure your
|
||||
fork will remain backwards-compatible with all versions of mainline openpilot and your fork.**
|
||||
|
||||
Example
|
||||
---
|
||||
```python
|
||||
import cereal.messaging as messaging
|
||||
|
||||
# in subscriber
|
||||
sm = messaging.SubMaster(['sensorEvents'])
|
||||
while 1:
|
||||
sm.update()
|
||||
print(sm['sensorEvents'])
|
||||
|
||||
```
|
||||
|
||||
```python
|
||||
# in publisher
|
||||
pm = messaging.PubMaster(['sensorEvents'])
|
||||
dat = messaging.new_message('sensorEvents', size=1)
|
||||
dat.sensorEvents[0] = {"gyro": {"v": [0.1, -0.1, 0.1]}}
|
||||
pm.send('sensorEvents', dat)
|
||||
```
|
||||
@@ -1,31 +0,0 @@
|
||||
Import('env', 'envCython', 'arch', 'common', 'msgq')
|
||||
|
||||
import shutil
|
||||
|
||||
cereal_dir = Dir('.')
|
||||
gen_dir = Dir('gen')
|
||||
other_dir = Dir('#msgq')
|
||||
|
||||
# Build cereal
|
||||
schema_files = ['log.capnp', 'car.capnp', 'legacy.capnp', 'custom.capnp']
|
||||
env.Command(["gen/c/include/c++.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS")
|
||||
env.Command([f'gen/cpp/{s}.c++' for s in schema_files] + [f'gen/cpp/{s}.h' for s in schema_files],
|
||||
schema_files,
|
||||
f"capnpc --src-prefix={cereal_dir.path} $SOURCES -o c++:{gen_dir.path}/cpp/")
|
||||
|
||||
# TODO: remove non shared cereal and messaging
|
||||
cereal_objects = env.SharedObject([f'gen/cpp/{s}.c++' for s in schema_files])
|
||||
|
||||
cereal = env.Library('cereal', cereal_objects)
|
||||
env.SharedLibrary('cereal_shared', cereal_objects)
|
||||
|
||||
# Build messaging
|
||||
|
||||
services_h = env.Command(['services.h'], ['services.py'], 'python3 ' + cereal_dir.path + '/services.py > $TARGET')
|
||||
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[msgq, 'zmq', common])
|
||||
|
||||
|
||||
socketmaster = env.SharedObject(['messaging/socketmaster.cc'])
|
||||
socketmaster = env.Library('socketmaster', socketmaster)
|
||||
|
||||
Export('cereal', 'socketmaster')
|
||||
@@ -1,9 +0,0 @@
|
||||
import os
|
||||
import capnp
|
||||
|
||||
CEREAL_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
capnp.remove_import_hook()
|
||||
|
||||
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
|
||||
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
|
||||
custom = capnp.load(os.path.join(CEREAL_PATH, "custom.capnp"))
|
||||
761
cereal/car.capnp
761
cereal/car.capnp
@@ -1,761 +0,0 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
@0x8e2af1e708af8b8d;
|
||||
|
||||
# ******* events causing controls state machine transition *******
|
||||
|
||||
struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
name @0 :EventName;
|
||||
|
||||
# event types
|
||||
enable @1 :Bool;
|
||||
noEntry @2 :Bool;
|
||||
warning @3 :Bool; # alerts presented only when enabled or soft disabling
|
||||
userDisable @4 :Bool;
|
||||
softDisable @5 :Bool;
|
||||
immediateDisable @6 :Bool;
|
||||
preEnable @7 :Bool;
|
||||
permanent @8 :Bool; # alerts presented regardless of openpilot state
|
||||
overrideLateral @10 :Bool;
|
||||
overrideLongitudinal @9 :Bool;
|
||||
|
||||
enum EventName @0xbaa8c5d505f727de {
|
||||
canError @0;
|
||||
steerUnavailable @1;
|
||||
wrongGear @4;
|
||||
doorOpen @5;
|
||||
seatbeltNotLatched @6;
|
||||
espDisabled @7;
|
||||
wrongCarMode @8;
|
||||
steerTempUnavailable @9;
|
||||
reverseGear @10;
|
||||
buttonCancel @11;
|
||||
buttonEnable @12;
|
||||
pedalPressed @13; # exits active state
|
||||
preEnableStandstill @73; # added during pre-enable state with brake
|
||||
gasPressedOverride @108; # added when user is pressing gas with no disengage on gas
|
||||
steerOverride @114;
|
||||
cruiseDisabled @14;
|
||||
speedTooLow @17;
|
||||
outOfSpace @18;
|
||||
overheat @19;
|
||||
calibrationIncomplete @20;
|
||||
calibrationInvalid @21;
|
||||
calibrationRecalibrating @117;
|
||||
controlsMismatch @22;
|
||||
pcmEnable @23;
|
||||
pcmDisable @24;
|
||||
radarFault @26;
|
||||
brakeHold @28;
|
||||
parkBrake @29;
|
||||
manualRestart @30;
|
||||
lowSpeedLockout @31;
|
||||
joystickDebug @34;
|
||||
steerTempUnavailableSilent @35;
|
||||
resumeRequired @36;
|
||||
preDriverDistracted @37;
|
||||
promptDriverDistracted @38;
|
||||
driverDistracted @39;
|
||||
preDriverUnresponsive @43;
|
||||
promptDriverUnresponsive @44;
|
||||
driverUnresponsive @45;
|
||||
belowSteerSpeed @46;
|
||||
lowBattery @48;
|
||||
accFaulted @51;
|
||||
sensorDataInvalid @52;
|
||||
commIssue @53;
|
||||
commIssueAvgFreq @109;
|
||||
tooDistracted @54;
|
||||
posenetInvalid @55;
|
||||
soundsUnavailable @56;
|
||||
preLaneChangeLeft @57;
|
||||
preLaneChangeRight @58;
|
||||
laneChange @59;
|
||||
lowMemory @63;
|
||||
stockAeb @64;
|
||||
ldw @65;
|
||||
carUnrecognized @66;
|
||||
invalidLkasSetting @69;
|
||||
speedTooHigh @70;
|
||||
laneChangeBlocked @71;
|
||||
relayMalfunction @72;
|
||||
stockFcw @74;
|
||||
startup @75;
|
||||
startupNoCar @76;
|
||||
startupNoControl @77;
|
||||
startupMaster @78;
|
||||
startupNoFw @104;
|
||||
fcw @79;
|
||||
steerSaturated @80;
|
||||
belowEngageSpeed @84;
|
||||
noGps @85;
|
||||
wrongCruiseMode @87;
|
||||
modeldLagging @89;
|
||||
deviceFalling @90;
|
||||
fanMalfunction @91;
|
||||
cameraMalfunction @92;
|
||||
cameraFrameRate @110;
|
||||
processNotRunning @95;
|
||||
dashcamMode @96;
|
||||
controlsInitializing @98;
|
||||
usbError @99;
|
||||
roadCameraError @100;
|
||||
driverCameraError @101;
|
||||
wideRoadCameraError @102;
|
||||
highCpuUsage @105;
|
||||
cruiseMismatch @106;
|
||||
lkasDisabled @107;
|
||||
canBusMissing @111;
|
||||
controlsdLagging @112;
|
||||
resumeBlocked @113;
|
||||
steerTimeLimit @115;
|
||||
vehicleSensorsInvalid @116;
|
||||
locationdTemporaryError @103;
|
||||
locationdPermanentError @118;
|
||||
paramsdTemporaryError @50;
|
||||
paramsdPermanentError @119;
|
||||
actuatorsApiUnavailable @120;
|
||||
espActive @121;
|
||||
manualSteeringRequired @122;
|
||||
manualLongitudinalRequired @123;
|
||||
silentPedalPressed @124;
|
||||
silentButtonEnable @125;
|
||||
silentBrakeHold @126;
|
||||
silentWrongGear @127;
|
||||
spReverseGear @128;
|
||||
preKeepHandsOnWheel @129;
|
||||
promptKeepHandsOnWheel @130;
|
||||
keepHandsOnWheel @131;
|
||||
speedLimitActive @132;
|
||||
speedLimitValueChange @133;
|
||||
e2eLongStop @134;
|
||||
e2eLongStart @135;
|
||||
controlsMismatchLong @136;
|
||||
cruiseEngageBlocked @137;
|
||||
laneChangeRoadEdge @138;
|
||||
speedLimitPreActive @139;
|
||||
speedLimitConfirmed @140;
|
||||
torqueNNLoad @141;
|
||||
hyundaiRadarTracksAvailable @142;
|
||||
spAutoBrakeHold @143;
|
||||
|
||||
radarCanErrorDEPRECATED @15;
|
||||
communityFeatureDisallowedDEPRECATED @62;
|
||||
radarCommIssueDEPRECATED @67;
|
||||
driverMonitorLowAccDEPRECATED @68;
|
||||
gasUnavailableDEPRECATED @3;
|
||||
dataNeededDEPRECATED @16;
|
||||
modelCommIssueDEPRECATED @27;
|
||||
ipasOverrideDEPRECATED @33;
|
||||
geofenceDEPRECATED @40;
|
||||
driverMonitorOnDEPRECATED @41;
|
||||
driverMonitorOffDEPRECATED @42;
|
||||
calibrationProgressDEPRECATED @47;
|
||||
invalidGiraffeHondaDEPRECATED @49;
|
||||
invalidGiraffeToyotaDEPRECATED @60;
|
||||
internetConnectivityNeededDEPRECATED @61;
|
||||
whitePandaUnsupportedDEPRECATED @81;
|
||||
commIssueWarningDEPRECATED @83;
|
||||
focusRecoverActiveDEPRECATED @86;
|
||||
neosUpdateRequiredDEPRECATED @88;
|
||||
modelLagWarningDEPRECATED @93;
|
||||
startupOneplusDEPRECATED @82;
|
||||
startupFuzzyFingerprintDEPRECATED @97;
|
||||
noTargetDEPRECATED @25;
|
||||
brakeUnavailableDEPRECATED @2;
|
||||
plannerErrorDEPRECATED @32;
|
||||
gpsMalfunctionDEPRECATED @94;
|
||||
}
|
||||
}
|
||||
|
||||
# ******* main car state @ 100hz *******
|
||||
# all speeds in m/s
|
||||
|
||||
struct CarState {
|
||||
events @13 :List(CarEvent);
|
||||
|
||||
# CAN health
|
||||
canValid @26 :Bool; # invalid counter/checksums
|
||||
canTimeout @40 :Bool; # CAN bus dropped out
|
||||
canErrorCounter @48 :UInt32;
|
||||
|
||||
# car speed
|
||||
vEgo @1 :Float32; # best estimate of speed
|
||||
aEgo @16 :Float32; # best estimate of acceleration
|
||||
vEgoRaw @17 :Float32; # unfiltered speed from CAN sensors
|
||||
vEgoCluster @44 :Float32; # best estimate of speed shown on car's instrument cluster, used for UI
|
||||
|
||||
yawRate @22 :Float32; # best estimate of yaw rate
|
||||
standstill @18 :Bool;
|
||||
wheelSpeeds @2 :WheelSpeeds;
|
||||
|
||||
# gas pedal, 0.0-1.0
|
||||
gas @3 :Float32; # this is user pedal only
|
||||
gasPressed @4 :Bool; # this is user pedal only
|
||||
|
||||
engineRpm @46 :Float32;
|
||||
|
||||
# brake pedal, 0.0-1.0
|
||||
brake @5 :Float32; # this is user pedal only
|
||||
brakePressed @6 :Bool; # this is user pedal only
|
||||
regenBraking @45 :Bool; # this is user pedal only
|
||||
parkingBrake @39 :Bool;
|
||||
brakeHoldActive @38 :Bool;
|
||||
|
||||
# steering wheel
|
||||
steeringAngleDeg @7 :Float32;
|
||||
steeringAngleOffsetDeg @37 :Float32; # Offset betweens sensors in case there multiple
|
||||
steeringRateDeg @15 :Float32;
|
||||
steeringTorque @8 :Float32; # TODO: standardize units
|
||||
steeringTorqueEps @27 :Float32; # TODO: standardize units
|
||||
steeringPressed @9 :Bool; # if the user is using the steering wheel
|
||||
steerFaultTemporary @35 :Bool; # temporary EPS fault
|
||||
steerFaultPermanent @36 :Bool; # permanent EPS fault
|
||||
stockAeb @30 :Bool;
|
||||
stockFcw @31 :Bool;
|
||||
espDisabled @32 :Bool;
|
||||
accFaulted @42 :Bool;
|
||||
carFaultedNonCritical @47 :Bool; # some ECU is faulted, but car remains controllable
|
||||
espActive @51 :Bool;
|
||||
|
||||
# cruise state
|
||||
cruiseState @10 :CruiseState;
|
||||
|
||||
# gear
|
||||
gearShifter @14 :GearShifter;
|
||||
|
||||
# button presses
|
||||
buttonEvents @11 :List(ButtonEvent);
|
||||
leftBlinker @20 :Bool;
|
||||
rightBlinker @21 :Bool;
|
||||
genericToggle @23 :Bool;
|
||||
|
||||
# lock info
|
||||
doorOpen @24 :Bool;
|
||||
seatbeltUnlatched @25 :Bool;
|
||||
|
||||
# clutch (manual transmission only)
|
||||
clutchPressed @28 :Bool;
|
||||
|
||||
madsEnabled @52 :Bool;
|
||||
leftBlinkerOn @53 :Bool;
|
||||
rightBlinkerOn @54 :Bool;
|
||||
disengageByBrake @55 :Bool;
|
||||
belowLaneChangeSpeed @56 :Bool;
|
||||
accEnabled @57 :Bool;
|
||||
latActive @58 :Bool;
|
||||
gapAdjustCruiseTr @59 :Int32;
|
||||
endToEndLong @60 :Bool;
|
||||
customStockLong @61 :CustomStockLong;
|
||||
|
||||
struct CustomStockLong {
|
||||
cruiseButton @0 :Int16;
|
||||
finalSpeedKph @1 :Float32;
|
||||
vCruiseKphPrevDEPRECATED @2 :Float32;
|
||||
targetSpeed @3 :Float32;
|
||||
vSetDis @4 :Float32;
|
||||
speedDiff @5 :Float32;
|
||||
buttonType @6 :Int16;
|
||||
}
|
||||
|
||||
# blindspot sensors
|
||||
leftBlindspot @33 :Bool; # Is there something blocking the left lane change
|
||||
rightBlindspot @34 :Bool; # Is there something blocking the right lane change
|
||||
|
||||
fuelGauge @41 :Float32; # battery or fuel tank level from 0.0 to 1.0
|
||||
charging @43 :Bool;
|
||||
|
||||
# process meta
|
||||
cumLagMs @50 :Float32;
|
||||
|
||||
struct WheelSpeeds {
|
||||
# optional wheel speeds
|
||||
fl @0 :Float32;
|
||||
fr @1 :Float32;
|
||||
rl @2 :Float32;
|
||||
rr @3 :Float32;
|
||||
}
|
||||
|
||||
struct CruiseState {
|
||||
enabled @0 :Bool;
|
||||
speed @1 :Float32;
|
||||
speedCluster @6 :Float32; # Set speed as shown on instrument cluster
|
||||
available @2 :Bool;
|
||||
speedOffset @3 :Float32;
|
||||
standstill @4 :Bool;
|
||||
nonAdaptive @5 :Bool;
|
||||
speedLimit @7 :Float32;
|
||||
}
|
||||
|
||||
enum GearShifter {
|
||||
unknown @0;
|
||||
park @1;
|
||||
drive @2;
|
||||
neutral @3;
|
||||
reverse @4;
|
||||
sport @5;
|
||||
low @6;
|
||||
brake @7;
|
||||
eco @8;
|
||||
manumatic @9;
|
||||
}
|
||||
|
||||
# send on change
|
||||
struct ButtonEvent {
|
||||
pressed @0 :Bool;
|
||||
type @1 :Type;
|
||||
|
||||
enum Type {
|
||||
unknown @0;
|
||||
leftBlinker @1;
|
||||
rightBlinker @2;
|
||||
accelCruise @3;
|
||||
decelCruise @4;
|
||||
cancel @5;
|
||||
altButton1 @6;
|
||||
altButton2 @7;
|
||||
altButton3 @8;
|
||||
setCruise @9;
|
||||
resumeCruise @10;
|
||||
gapAdjustCruise @11;
|
||||
}
|
||||
}
|
||||
|
||||
# deprecated
|
||||
errorsDEPRECATED @0 :List(CarEvent.EventName);
|
||||
brakeLightsDEPRECATED @19 :Bool;
|
||||
steeringRateLimitedDEPRECATED @29 :Bool;
|
||||
canMonoTimesDEPRECATED @12: List(UInt64);
|
||||
canRcvTimeoutDEPRECATED @49 :Bool;
|
||||
}
|
||||
|
||||
# ******* radar state @ 20hz *******
|
||||
|
||||
struct RadarData @0x888ad6581cf0aacb {
|
||||
errors @0 :List(Error);
|
||||
points @1 :List(RadarPoint);
|
||||
|
||||
enum Error {
|
||||
canError @0;
|
||||
fault @1;
|
||||
wrongConfig @2;
|
||||
}
|
||||
|
||||
# similar to LiveTracks
|
||||
# is one timestamp valid for all? I think so
|
||||
struct RadarPoint {
|
||||
trackId @0 :UInt64; # no trackId reuse
|
||||
|
||||
# these 3 are the minimum required
|
||||
dRel @1 :Float32; # m from the front bumper of the car
|
||||
yRel @2 :Float32; # m
|
||||
vRel @3 :Float32; # m/s
|
||||
|
||||
# these are optional and valid if they are not NaN
|
||||
aRel @4 :Float32; # m/s^2
|
||||
yvRel @5 :Float32; # m/s
|
||||
|
||||
# some radars flag measurements VS estimates
|
||||
measured @6 :Bool;
|
||||
}
|
||||
|
||||
# deprecated
|
||||
canMonoTimesDEPRECATED @2 :List(UInt64);
|
||||
}
|
||||
|
||||
# ******* car controls @ 100hz *******
|
||||
|
||||
struct CarControl {
|
||||
# must be true for any actuator commands to work
|
||||
enabled @0 :Bool;
|
||||
latActive @11: Bool;
|
||||
longActive @12: Bool;
|
||||
vCruise @17 :Float32; # actual set speed
|
||||
|
||||
# Actuator commands as computed by controlsd
|
||||
actuators @6 :Actuators;
|
||||
|
||||
# moved to CarOutput
|
||||
actuatorsOutputDEPRECATED @10 :Actuators;
|
||||
|
||||
leftBlinker @15: Bool;
|
||||
rightBlinker @16: Bool;
|
||||
|
||||
orientationNED @13 :List(Float32);
|
||||
angularVelocity @14 :List(Float32);
|
||||
|
||||
cruiseControl @4 :CruiseControl;
|
||||
hudControl @5 :HUDControl;
|
||||
|
||||
struct Actuators {
|
||||
# range from 0.0 - 1.0
|
||||
gas @0: Float32;
|
||||
brake @1: Float32;
|
||||
# range from -1.0 - 1.0
|
||||
steer @2: Float32;
|
||||
# value sent over can to the car
|
||||
steerOutputCan @8: Float32;
|
||||
steeringAngleDeg @3: Float32;
|
||||
|
||||
curvature @7: Float32;
|
||||
|
||||
speed @6: Float32; # m/s
|
||||
accel @4: Float32; # m/s^2
|
||||
longControlState @5: LongControlState;
|
||||
|
||||
enum LongControlState @0xe40f3a917d908282{
|
||||
off @0;
|
||||
pid @1;
|
||||
stopping @2;
|
||||
starting @3;
|
||||
}
|
||||
}
|
||||
|
||||
struct CruiseControl {
|
||||
cancel @0: Bool;
|
||||
resume @1: Bool;
|
||||
override @4: Bool;
|
||||
speedOverrideDEPRECATED @2: Float32;
|
||||
accelOverrideDEPRECATED @3: Float32;
|
||||
}
|
||||
|
||||
struct HUDControl {
|
||||
speedVisible @0: Bool;
|
||||
setSpeed @1: Float32;
|
||||
lanesVisible @2: Bool;
|
||||
leadVisible @3: Bool;
|
||||
visualAlert @4: VisualAlert;
|
||||
audibleAlert @5: AudibleAlert;
|
||||
rightLaneVisible @6: Bool;
|
||||
leftLaneVisible @7: Bool;
|
||||
rightLaneDepart @8: Bool;
|
||||
leftLaneDepart @9: Bool;
|
||||
leadDistanceBars @10: Int8; # 1-3: 1 is closest, 3 is farthest. some ports may utilize 2-4 bars instead
|
||||
|
||||
enum VisualAlert {
|
||||
# these are the choices from the Honda
|
||||
# map as good as you can for your car
|
||||
none @0;
|
||||
fcw @1;
|
||||
steerRequired @2;
|
||||
brakePressed @3;
|
||||
wrongGear @4;
|
||||
seatbeltUnbuckled @5;
|
||||
speedTooHigh @6;
|
||||
ldw @7;
|
||||
}
|
||||
|
||||
enum AudibleAlert {
|
||||
none @0;
|
||||
|
||||
engage @1;
|
||||
disengage @2;
|
||||
refuse @3;
|
||||
|
||||
warningSoft @4;
|
||||
warningImmediate @5;
|
||||
|
||||
prompt @6;
|
||||
promptRepeat @7;
|
||||
promptDistracted @8;
|
||||
promptStarting @9;
|
||||
promptSingleLow @10;
|
||||
promptSingleHigh @11;
|
||||
}
|
||||
}
|
||||
|
||||
gasDEPRECATED @1 :Float32;
|
||||
brakeDEPRECATED @2 :Float32;
|
||||
steeringTorqueDEPRECATED @3 :Float32;
|
||||
activeDEPRECATED @7 :Bool;
|
||||
rollDEPRECATED @8 :Float32;
|
||||
pitchDEPRECATED @9 :Float32;
|
||||
}
|
||||
|
||||
struct CarOutput {
|
||||
# Any car specific rate limits or quirks applied by
|
||||
# the CarController are reflected in actuatorsOutput
|
||||
# and matches what is sent to the car
|
||||
actuatorsOutput @0 :CarControl.Actuators;
|
||||
}
|
||||
|
||||
# ****** car param ******
|
||||
|
||||
struct CarParams {
|
||||
carName @0 :Text;
|
||||
carFingerprint @1 :Text;
|
||||
fuzzyFingerprint @55 :Bool;
|
||||
|
||||
notCar @66 :Bool; # flag for non-car robotics platforms
|
||||
|
||||
pcmCruise @3 :Bool; # is openpilot's state tied to the PCM's cruise state?
|
||||
enableDsu @5 :Bool; # driving support unit
|
||||
enableBsm @56 :Bool; # blind spot monitoring
|
||||
flags @64 :UInt32; # flags for car specific quirks
|
||||
experimentalLongitudinalAvailable @71 :Bool;
|
||||
pcmCruiseSpeed @74 :Bool; # is openpilot's state tied to the PCM's cruise speed?
|
||||
customStockLongAvailable @75 :Bool;
|
||||
spFlags @76 :UInt32; # flags for car specific quirks in sunnypilot
|
||||
|
||||
minEnableSpeed @7 :Float32;
|
||||
minSteerSpeed @8 :Float32;
|
||||
safetyConfigs @62 :List(SafetyConfig);
|
||||
alternativeExperience @65 :Int16; # panda flag for features like no disengage on gas
|
||||
|
||||
# Car docs fields
|
||||
maxLateralAccel @68 :Float32;
|
||||
autoResumeSng @69 :Bool; # describes whether car can resume from a stop automatically
|
||||
|
||||
# things about the car in the manual
|
||||
mass @17 :Float32; # [kg] curb weight: all fluids no cargo
|
||||
wheelbase @18 :Float32; # [m] distance from rear axle to front axle
|
||||
centerToFront @19 :Float32; # [m] distance from center of mass to front axle
|
||||
steerRatio @20 :Float32; # [] ratio of steering wheel angle to front wheel angle
|
||||
steerRatioRear @21 :Float32; # [] ratio of steering wheel angle to rear wheel angle (usually 0)
|
||||
|
||||
# things we can derive
|
||||
rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia
|
||||
tireStiffnessFactor @72 :Float32; # scaling factor used in calculating tireStiffness[Front,Rear]
|
||||
tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff
|
||||
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff
|
||||
|
||||
longitudinalTuning @25 :LongitudinalPIDTuning;
|
||||
lateralParams @48 :LateralParams;
|
||||
lateralTuning :union {
|
||||
pid @26 :LateralPIDTuning;
|
||||
indiDEPRECATED @27 :LateralINDITuning;
|
||||
lqrDEPRECATED @40 :LateralLQRTuning;
|
||||
torque @67 :LateralTorqueTuning;
|
||||
}
|
||||
|
||||
steerLimitAlert @28 :Bool;
|
||||
steerLimitTimer @47 :Float32; # time before steerLimitAlert is issued
|
||||
|
||||
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
|
||||
vEgoStarting @59 :Float32; # Speed at which the car goes into starting state
|
||||
stoppingControl @31 :Bool; # Does the car allow full control even at lows speeds when stopping
|
||||
steerControlType @34 :SteerControlType;
|
||||
radarUnavailable @35 :Bool; # True when radar objects aren't visible on CAN or aren't parsed out
|
||||
stopAccel @60 :Float32; # Required acceleration to keep vehicle stationary
|
||||
stoppingDecelRate @52 :Float32; # m/s^2/s while trying to stop
|
||||
startAccel @32 :Float32; # Required acceleration to get car moving
|
||||
startingState @70 :Bool; # Does this car make use of special starting state
|
||||
|
||||
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
|
||||
longitudinalActuatorDelay @58 :Float32; # Gas/Brake actuator delay in seconds
|
||||
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
|
||||
carVin @38 :Text; # VIN number queried during fingerprinting
|
||||
dashcamOnly @41: Bool;
|
||||
passive @73: Bool; # is openpilot in control?
|
||||
transmissionType @43 :TransmissionType;
|
||||
carFw @44 :List(CarFw);
|
||||
|
||||
radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
|
||||
fingerprintSource @49: FingerprintSource;
|
||||
networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network
|
||||
|
||||
wheelSpeedFactor @63 :Float32; # Multiplier on wheels speeds to computer actual speeds
|
||||
|
||||
struct SafetyConfig {
|
||||
safetyModel @0 :SafetyModel;
|
||||
safetyParam @3 :UInt16;
|
||||
safetyParamDEPRECATED @1 :Int16;
|
||||
safetyParam2DEPRECATED @2 :UInt32;
|
||||
}
|
||||
|
||||
struct LateralParams {
|
||||
torqueBP @0 :List(Int32);
|
||||
torqueV @1 :List(Int32);
|
||||
}
|
||||
|
||||
struct LateralPIDTuning {
|
||||
kpBP @0 :List(Float32);
|
||||
kpV @1 :List(Float32);
|
||||
kiBP @2 :List(Float32);
|
||||
kiV @3 :List(Float32);
|
||||
kf @4 :Float32;
|
||||
}
|
||||
|
||||
struct LateralTorqueTuning {
|
||||
useSteeringAngle @0 :Bool;
|
||||
kp @1 :Float32;
|
||||
ki @2 :Float32;
|
||||
friction @3 :Float32;
|
||||
kf @4 :Float32;
|
||||
steeringAngleDeadzoneDeg @5 :Float32;
|
||||
latAccelFactor @6 :Float32;
|
||||
latAccelOffset @7 :Float32;
|
||||
nnModelName @8 :Text;
|
||||
nnModelFuzzyMatch @9 :Bool;
|
||||
}
|
||||
|
||||
struct LongitudinalPIDTuning {
|
||||
kpBP @0 :List(Float32);
|
||||
kpV @1 :List(Float32);
|
||||
kiBP @2 :List(Float32);
|
||||
kiV @3 :List(Float32);
|
||||
kf @6 :Float32;
|
||||
deadzoneBPDEPRECATED @4 :List(Float32);
|
||||
deadzoneVDEPRECATED @5 :List(Float32);
|
||||
}
|
||||
|
||||
struct LateralINDITuning {
|
||||
outerLoopGainBP @4 :List(Float32);
|
||||
outerLoopGainV @5 :List(Float32);
|
||||
innerLoopGainBP @6 :List(Float32);
|
||||
innerLoopGainV @7 :List(Float32);
|
||||
timeConstantBP @8 :List(Float32);
|
||||
timeConstantV @9 :List(Float32);
|
||||
actuatorEffectivenessBP @10 :List(Float32);
|
||||
actuatorEffectivenessV @11 :List(Float32);
|
||||
|
||||
outerLoopGainDEPRECATED @0 :Float32;
|
||||
innerLoopGainDEPRECATED @1 :Float32;
|
||||
timeConstantDEPRECATED @2 :Float32;
|
||||
actuatorEffectivenessDEPRECATED @3 :Float32;
|
||||
}
|
||||
|
||||
struct LateralLQRTuning {
|
||||
scale @0 :Float32;
|
||||
ki @1 :Float32;
|
||||
dcGain @2 :Float32;
|
||||
|
||||
# State space system
|
||||
a @3 :List(Float32);
|
||||
b @4 :List(Float32);
|
||||
c @5 :List(Float32);
|
||||
|
||||
k @6 :List(Float32); # LQR gain
|
||||
l @7 :List(Float32); # Kalman gain
|
||||
}
|
||||
|
||||
enum SafetyModel {
|
||||
silent @0;
|
||||
hondaNidec @1;
|
||||
toyota @2;
|
||||
elm327 @3;
|
||||
gm @4;
|
||||
hondaBoschGiraffe @5;
|
||||
ford @6;
|
||||
cadillac @7;
|
||||
hyundai @8;
|
||||
chrysler @9;
|
||||
tesla @10;
|
||||
subaru @11;
|
||||
gmPassive @12;
|
||||
mazda @13;
|
||||
nissan @14;
|
||||
volkswagen @15;
|
||||
toyotaIpas @16;
|
||||
allOutput @17;
|
||||
gmAscm @18;
|
||||
noOutput @19; # like silent but without silent CAN TXs
|
||||
hondaBosch @20;
|
||||
volkswagenPq @21;
|
||||
subaruPreglobal @22; # pre-Global platform
|
||||
hyundaiLegacy @23;
|
||||
hyundaiCommunity @24;
|
||||
volkswagenMlb @25;
|
||||
hongqi @26;
|
||||
body @27;
|
||||
hyundaiCanfd @28;
|
||||
volkswagenMqbEvo @29;
|
||||
chryslerCusw @30;
|
||||
psa @31;
|
||||
}
|
||||
|
||||
enum SteerControlType {
|
||||
torque @0;
|
||||
angle @1;
|
||||
|
||||
curvatureDEPRECATED @2;
|
||||
}
|
||||
|
||||
enum TransmissionType {
|
||||
unknown @0;
|
||||
automatic @1; # Traditional auto, including DSG
|
||||
manual @2; # True "stick shift" only
|
||||
direct @3; # Electric vehicle or other direct drive
|
||||
cvt @4;
|
||||
}
|
||||
|
||||
struct CarFw {
|
||||
ecu @0 :Ecu;
|
||||
fwVersion @1 :Data;
|
||||
address @2 :UInt32;
|
||||
subAddress @3 :UInt8;
|
||||
responseAddress @4 :UInt32;
|
||||
request @5 :List(Data);
|
||||
brand @6 :Text;
|
||||
bus @7 :UInt8;
|
||||
logging @8 :Bool;
|
||||
obdMultiplexing @9 :Bool;
|
||||
}
|
||||
|
||||
enum Ecu {
|
||||
eps @0;
|
||||
abs @1;
|
||||
fwdRadar @2;
|
||||
fwdCamera @3;
|
||||
engine @4;
|
||||
unknown @5;
|
||||
transmission @8; # Transmission Control Module
|
||||
hybrid @18; # hybrid control unit, e.g. Chrysler's HCP, Honda's IMA Control Unit, Toyota's hybrid control computer
|
||||
srs @9; # airbag
|
||||
gateway @10; # can gateway
|
||||
hud @11; # heads up display
|
||||
combinationMeter @12; # instrument cluster
|
||||
electricBrakeBooster @15;
|
||||
shiftByWire @16;
|
||||
adas @19;
|
||||
cornerRadar @21;
|
||||
hvac @20;
|
||||
parkingAdas @7; # parking assist system ECU, e.g. Toyota's IPAS, Hyundai's RSPA, etc.
|
||||
epb @22; # electronic parking brake
|
||||
telematics @23;
|
||||
body @24; # body control module
|
||||
|
||||
# Toyota only
|
||||
dsu @6;
|
||||
|
||||
# Honda only
|
||||
vsa @13; # Vehicle Stability Assist
|
||||
programmedFuelInjection @14;
|
||||
|
||||
debug @17;
|
||||
}
|
||||
|
||||
enum FingerprintSource {
|
||||
can @0;
|
||||
fw @1;
|
||||
fixed @2;
|
||||
}
|
||||
|
||||
enum NetworkLocation {
|
||||
fwdCamera @0; # Standard/default integration at LKAS camera
|
||||
gateway @1; # Integration at vehicle's CAN gateway
|
||||
}
|
||||
|
||||
enableGasInterceptorDEPRECATED @2 :Bool;
|
||||
enableCameraDEPRECATED @4 :Bool;
|
||||
enableApgsDEPRECATED @6 :Bool;
|
||||
steerRateCostDEPRECATED @33 :Float32;
|
||||
isPandaBlackDEPRECATED @39 :Bool;
|
||||
hasStockCameraDEPRECATED @57 :Bool;
|
||||
safetyParamDEPRECATED @10 :Int16;
|
||||
safetyModelDEPRECATED @9 :SafetyModel;
|
||||
safetyModelPassiveDEPRECATED @42 :SafetyModel = silent;
|
||||
minSpeedCanDEPRECATED @51 :Float32;
|
||||
communityFeatureDEPRECATED @46: Bool;
|
||||
startingAccelRateDEPRECATED @53 :Float32;
|
||||
steerMaxBPDEPRECATED @11 :List(Float32);
|
||||
steerMaxVDEPRECATED @12 :List(Float32);
|
||||
gasMaxBPDEPRECATED @13 :List(Float32);
|
||||
gasMaxVDEPRECATED @14 :List(Float32);
|
||||
brakeMaxBPDEPRECATED @15 :List(Float32);
|
||||
brakeMaxVDEPRECATED @16 :List(Float32);
|
||||
directAccelControlDEPRECATED @30 :Bool;
|
||||
maxSteeringAngleDegDEPRECATED @54 :Float32;
|
||||
longitudinalActuatorDelayLowerBoundDEPRECATEDDEPRECATED @61 :Float32;
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Car = import "car.capnp";
|
||||
|
||||
@0xb526ba661d550a59;
|
||||
|
||||
# custom.capnp: a home for empty structs reserved for custom forks
|
||||
# These structs are guaranteed to remain reserved and empty in mainline
|
||||
# cereal, so use these if you want custom events in your fork.
|
||||
|
||||
# you can rename the struct, but don't change the identifier
|
||||
|
||||
enum LongitudinalPersonalitySP {
|
||||
aggressive @0;
|
||||
moderate @1;
|
||||
standard @2;
|
||||
relaxed @3;
|
||||
overtake @4;
|
||||
}
|
||||
|
||||
enum AccelerationPersonality {
|
||||
sport @0;
|
||||
normal @1;
|
||||
eco @2;
|
||||
stock @3;
|
||||
}
|
||||
|
||||
enum ModelGeneration {
|
||||
default @0;
|
||||
one @1;
|
||||
two @2;
|
||||
three @3;
|
||||
four @4;
|
||||
five @5;
|
||||
}
|
||||
|
||||
enum MpcSource {
|
||||
acc @0;
|
||||
blended @1;
|
||||
}
|
||||
|
||||
struct ControlsStateSP @0x81c2f05a394cf4af {
|
||||
lateralState @0 :Text;
|
||||
personality @8 :LongitudinalPersonalitySP;
|
||||
dynamicPersonality @9 :Bool;
|
||||
accelPersonality @10 :AccelerationPersonality;
|
||||
overtakingAccelerationAssist @11 :Bool;
|
||||
|
||||
lateralControlState :union {
|
||||
indiState @1 :LateralINDIState;
|
||||
pidState @2 :LateralPIDState;
|
||||
angleState @3 :LateralAngleState;
|
||||
debugState @4 :LateralDebugState;
|
||||
torqueState @5 :LateralTorqueState;
|
||||
curvatureState @6 :LateralCurvatureState;
|
||||
|
||||
lqrStateDEPRECATED @7 :LateralLQRState;
|
||||
}
|
||||
|
||||
struct LateralINDIState {
|
||||
}
|
||||
|
||||
struct LateralPIDState {
|
||||
}
|
||||
|
||||
struct LateralAngleState {
|
||||
}
|
||||
|
||||
struct LateralDebugState {
|
||||
}
|
||||
|
||||
struct LateralTorqueState {
|
||||
nnLog @0 :List(Float32);
|
||||
}
|
||||
|
||||
struct LateralCurvatureState {
|
||||
}
|
||||
|
||||
struct LateralLQRState {
|
||||
}
|
||||
}
|
||||
|
||||
struct LongitudinalPlanSP @0xaedffd8f31e7b55d {
|
||||
visionTurnControllerState @0 :VisionTurnControllerState;
|
||||
visionTurnSpeed @1 :Float32;
|
||||
visionCurrentLatAcc @16 :Float32;
|
||||
visionMaxPredLatAcc @17 :Float32;
|
||||
|
||||
speedLimitControlState @2 :SpeedLimitControlState;
|
||||
speedLimit @3 :Float32;
|
||||
speedLimitOffset @4 :Float32;
|
||||
distToSpeedLimit @5 :Float32;
|
||||
isMapSpeedLimit @6 :Bool;
|
||||
speedLimitPercOffset @11 :Bool;
|
||||
speedLimitValueOffset @12 :Float32;
|
||||
desiredTF @13 :Float32;
|
||||
notSpeedLimit @14 :Int16;
|
||||
e2eX @15 :List(Float32);
|
||||
e2eBlendedDEPRECATED @18 :Text;
|
||||
e2eStatus @22 :Bool;
|
||||
mpcSource @23 :MpcSource;
|
||||
dynamicExperimentalControl @24 :Bool;
|
||||
|
||||
distToTurn @7 :Float32;
|
||||
turnSpeed @8 :Float32;
|
||||
turnSpeedControlState @9 :SpeedLimitControlState;
|
||||
turnSign @10 :Int16;
|
||||
|
||||
events @19 :List(Car.CarEvent);
|
||||
longitudinalPlanSource @20 :LongitudinalPlanSource;
|
||||
|
||||
personalityDEPRECATED @21 :LongitudinalPersonalitySP;
|
||||
|
||||
enum SpeedLimitControlState {
|
||||
inactive @0; # No speed limit set or not enabled by parameter.
|
||||
tempInactive @1; # User wants to ignore speed limit until it changes.
|
||||
adapting @2; # Reducing speed to match new speed limit.
|
||||
active @3; # Cruising at speed limit.
|
||||
preActive @4;
|
||||
}
|
||||
|
||||
enum VisionTurnControllerState {
|
||||
disabled @0; # No predicted substantial turn on vision range or feature disabled.
|
||||
entering @1; # A substantial turn is predicted ahead, adapting speed to turn comfort levels.
|
||||
turning @2; # Actively turning. Managing acceleration to provide a roll on turn feeling.
|
||||
leaving @3; # Road ahead straightens. Start to allow positive acceleration.
|
||||
}
|
||||
|
||||
enum LongitudinalPlanSource {
|
||||
cruise @0;
|
||||
lead0 @1;
|
||||
lead1 @2;
|
||||
lead2 @3;
|
||||
e2e @4;
|
||||
turn @5;
|
||||
limit @6;
|
||||
turnlimit @7;
|
||||
}
|
||||
}
|
||||
|
||||
struct LateralPlanSP @0xf35cc4560bbf6ec2 {
|
||||
laneWidth @0 :Float32;
|
||||
lProb @1 :Float32;
|
||||
rProb @2 :Float32;
|
||||
|
||||
dProb @3 :Float32;
|
||||
|
||||
dynamicLaneProfile @4 :Int8;
|
||||
standstillElapsed @5 :Float32;
|
||||
dynamicLaneProfileStatus @9 :Bool;
|
||||
|
||||
dPathWLinesXDEPRECATED @6 :List(Float32);
|
||||
dPathWLinesYDEPRECATED @7 :List(Float32);
|
||||
laneChangePrevDEPRECATED @8 :Bool;
|
||||
laneChangeEdgeBlockDEPRECATED @10 :Bool;
|
||||
}
|
||||
|
||||
struct DriverMonitoringStateSP @0xda96579883444c35 {
|
||||
handsOnWheelState @0 :HandsOnWheelState;
|
||||
notModified @1 :Float32;
|
||||
|
||||
enum HandsOnWheelState {
|
||||
none @0; # hand on wheel monitoring inactive
|
||||
ok @1; # driver has hands on steering wheel
|
||||
minor @2; # hands off steering wheel for acceptable period
|
||||
warning @3; # hands off steering wheel for warning period
|
||||
critical @4; # # hands off steering wheel for critical period
|
||||
terminal @5; # # hands off steering wheel for terminal period
|
||||
}
|
||||
}
|
||||
|
||||
struct LiveMapDataSP @0x80ae746ee2596b11 {
|
||||
speedLimitValid @0 :Bool;
|
||||
speedLimit @1 :Float32;
|
||||
speedLimitAheadValid @2 :Bool;
|
||||
speedLimitAhead @3 :Float32;
|
||||
speedLimitAheadDistance @4 :Float32;
|
||||
turnSpeedLimitValid @5 :Bool;
|
||||
turnSpeedLimit @6 :Float32;
|
||||
turnSpeedLimitEndDistance @7 :Float32;
|
||||
turnSpeedLimitSign @8 :Int16;
|
||||
turnSpeedLimitsAhead @9 :List(Float32);
|
||||
turnSpeedLimitsAheadDistances @10 :List(Float32);
|
||||
turnSpeedLimitsAheadSigns @11 :List(Int16);
|
||||
lastGpsTimestamp @12 :Int64; # Milliseconds since January 1, 1970.
|
||||
currentRoadName @13 :Text;
|
||||
lastGpsLatitude @14 :Float64;
|
||||
lastGpsLongitude @15 :Float64;
|
||||
lastGpsSpeed @16 :Float32;
|
||||
lastGpsBearingDeg @17 :Float32;
|
||||
lastGpsAccuracy @18 :Float32;
|
||||
lastGpsBearingAccuracyDeg @19 :Float32;
|
||||
dataType @20 :DataType;
|
||||
|
||||
enum DataType {
|
||||
default @0;
|
||||
offline @1;
|
||||
online @2;
|
||||
}
|
||||
}
|
||||
|
||||
struct E2eLongStateSP @0xa5cd762cd951a455 {
|
||||
status @0 :UInt16;
|
||||
}
|
||||
|
||||
struct ModelDataV2SP @0xf98d843bfd7004a3 {
|
||||
laneChangePrev @0 :Bool;
|
||||
laneChangeEdgeBlock @1 :Bool;
|
||||
customModel @2 :Bool;
|
||||
modelGeneration @3 :ModelGeneration;
|
||||
modelCapabilities @4 :UInt32;
|
||||
}
|
||||
|
||||
struct CustomReserved7 @0xb86e6369214c01c8 {
|
||||
}
|
||||
|
||||
struct CustomReserved8 @0xf416ec09499d9d19 {
|
||||
}
|
||||
|
||||
struct CustomReserved9 @0xa1680744031fdb2d {
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xbdf87d7bb8304e81;
|
||||
$namespace("capnp::annotations");
|
||||
|
||||
annotation namespace(file): Text;
|
||||
annotation name(field, enumerant, struct, enum, interface, method, param, group, union): Text;
|
||||
@@ -1,574 +0,0 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
@0x80ef1ec4889c2a63;
|
||||
|
||||
# legacy.capnp: a home for deprecated structs
|
||||
|
||||
struct LogRotate @0x9811e1f38f62f2d1 {
|
||||
segmentNum @0 :Int32;
|
||||
path @1 :Text;
|
||||
}
|
||||
|
||||
struct LiveUI @0xc08240f996aefced {
|
||||
rearViewCam @0 :Bool;
|
||||
alertText1 @1 :Text;
|
||||
alertText2 @2 :Text;
|
||||
awarenessStatus @3 :Float32;
|
||||
}
|
||||
|
||||
struct UiLayoutState @0x88dcce08ad29dda0 {
|
||||
activeApp @0 :App;
|
||||
sidebarCollapsed @1 :Bool;
|
||||
mapEnabled @2 :Bool;
|
||||
mockEngaged @3 :Bool;
|
||||
|
||||
enum App @0x9917470acf94d285 {
|
||||
home @0;
|
||||
music @1;
|
||||
nav @2;
|
||||
settings @3;
|
||||
none @4;
|
||||
}
|
||||
}
|
||||
|
||||
struct OrbslamCorrection @0x8afd33dc9b35e1aa {
|
||||
correctionMonoTime @0 :UInt64;
|
||||
prePositionECEF @1 :List(Float64);
|
||||
postPositionECEF @2 :List(Float64);
|
||||
prePoseQuatECEF @3 :List(Float32);
|
||||
postPoseQuatECEF @4 :List(Float32);
|
||||
numInliers @5 :UInt32;
|
||||
}
|
||||
|
||||
struct EthernetPacket @0xa99a9d5b33cf5859 {
|
||||
pkt @0 :Data;
|
||||
ts @1 :Float32;
|
||||
}
|
||||
|
||||
struct CellInfo @0xcff7566681c277ce {
|
||||
timestamp @0 :UInt64;
|
||||
repr @1 :Text; # android toString() for now
|
||||
}
|
||||
|
||||
struct WifiScan @0xd4df5a192382ba0b {
|
||||
bssid @0 :Text;
|
||||
ssid @1 :Text;
|
||||
capabilities @2 :Text;
|
||||
frequency @3 :Int32;
|
||||
level @4 :Int32;
|
||||
timestamp @5 :Int64;
|
||||
|
||||
centerFreq0 @6 :Int32;
|
||||
centerFreq1 @7 :Int32;
|
||||
channelWidth @8 :ChannelWidth;
|
||||
operatorFriendlyName @9 :Text;
|
||||
venueName @10 :Text;
|
||||
is80211mcResponder @11 :Bool;
|
||||
passpoint @12 :Bool;
|
||||
|
||||
distanceCm @13 :Int32;
|
||||
distanceSdCm @14 :Int32;
|
||||
|
||||
enum ChannelWidth @0xcb6a279f015f6b51 {
|
||||
w20Mhz @0;
|
||||
w40Mhz @1;
|
||||
w80Mhz @2;
|
||||
w160Mhz @3;
|
||||
w80Plus80Mhz @4;
|
||||
}
|
||||
}
|
||||
|
||||
struct LiveEventData @0x94b7baa90c5c321e {
|
||||
name @0 :Text;
|
||||
value @1 :Int32;
|
||||
}
|
||||
|
||||
struct ModelData @0xb8aad62cffef28a9 {
|
||||
frameId @0 :UInt32;
|
||||
frameAge @12 :UInt32;
|
||||
frameDropPerc @13 :Float32;
|
||||
timestampEof @9 :UInt64;
|
||||
modelExecutionTime @14 :Float32;
|
||||
gpuExecutionTime @16 :Float32;
|
||||
rawPred @15 :Data;
|
||||
|
||||
path @1 :PathData;
|
||||
leftLane @2 :PathData;
|
||||
rightLane @3 :PathData;
|
||||
lead @4 :LeadData;
|
||||
freePath @6 :List(Float32);
|
||||
|
||||
settings @5 :ModelSettings;
|
||||
leadFuture @7 :LeadData;
|
||||
speed @8 :List(Float32);
|
||||
meta @10 :MetaData;
|
||||
longitudinal @11 :LongitudinalData;
|
||||
|
||||
struct PathData @0x8817eeea389e9f08 {
|
||||
points @0 :List(Float32);
|
||||
prob @1 :Float32;
|
||||
std @2 :Float32;
|
||||
stds @3 :List(Float32);
|
||||
poly @4 :List(Float32);
|
||||
validLen @5 :Float32;
|
||||
}
|
||||
|
||||
struct LeadData @0xd1c9bef96d26fa91 {
|
||||
dist @0 :Float32;
|
||||
prob @1 :Float32;
|
||||
std @2 :Float32;
|
||||
relVel @3 :Float32;
|
||||
relVelStd @4 :Float32;
|
||||
relY @5 :Float32;
|
||||
relYStd @6 :Float32;
|
||||
relA @7 :Float32;
|
||||
relAStd @8 :Float32;
|
||||
}
|
||||
|
||||
struct ModelSettings @0xa26e3710efd3e914 {
|
||||
bigBoxX @0 :UInt16;
|
||||
bigBoxY @1 :UInt16;
|
||||
bigBoxWidth @2 :UInt16;
|
||||
bigBoxHeight @3 :UInt16;
|
||||
boxProjection @4 :List(Float32);
|
||||
yuvCorrection @5 :List(Float32);
|
||||
inputTransform @6 :List(Float32);
|
||||
}
|
||||
|
||||
struct MetaData @0x9744f25fb60f2bf8 {
|
||||
engagedProb @0 :Float32;
|
||||
desirePrediction @1 :List(Float32);
|
||||
brakeDisengageProb @2 :Float32;
|
||||
gasDisengageProb @3 :Float32;
|
||||
steerOverrideProb @4 :Float32;
|
||||
desireState @5 :List(Float32);
|
||||
}
|
||||
|
||||
struct LongitudinalData @0xf98f999c6a071122 {
|
||||
distances @2 :List(Float32);
|
||||
speeds @0 :List(Float32);
|
||||
accelerations @1 :List(Float32);
|
||||
}
|
||||
}
|
||||
|
||||
struct ECEFPoint @0xc25bbbd524983447 {
|
||||
x @0 :Float64;
|
||||
y @1 :Float64;
|
||||
z @2 :Float64;
|
||||
}
|
||||
|
||||
struct ECEFPointDEPRECATED @0xe10e21168db0c7f7 {
|
||||
x @0 :Float32;
|
||||
y @1 :Float32;
|
||||
z @2 :Float32;
|
||||
}
|
||||
|
||||
struct GPSPlannerPoints @0xab54c59699f8f9f3 {
|
||||
curPosDEPRECATED @0 :ECEFPointDEPRECATED;
|
||||
pointsDEPRECATED @1 :List(ECEFPointDEPRECATED);
|
||||
curPos @6 :ECEFPoint;
|
||||
points @7 :List(ECEFPoint);
|
||||
valid @2 :Bool;
|
||||
trackName @3 :Text;
|
||||
speedLimit @4 :Float32;
|
||||
accelTarget @5 :Float32;
|
||||
}
|
||||
|
||||
struct GPSPlannerPlan @0xf5ad1d90cdc1dd6b {
|
||||
valid @0 :Bool;
|
||||
poly @1 :List(Float32);
|
||||
trackName @2 :Text;
|
||||
speed @3 :Float32;
|
||||
acceleration @4 :Float32;
|
||||
pointsDEPRECATED @5 :List(ECEFPointDEPRECATED);
|
||||
points @6 :List(ECEFPoint);
|
||||
xLookahead @7 :Float32;
|
||||
}
|
||||
|
||||
struct UiNavigationEvent @0x90c8426c3eaddd3b {
|
||||
type @0: Type;
|
||||
status @1: Status;
|
||||
distanceTo @2: Float32;
|
||||
endRoadPointDEPRECATED @3: ECEFPointDEPRECATED;
|
||||
endRoadPoint @4: ECEFPoint;
|
||||
|
||||
enum Type @0xe8db07dcf8fcea05 {
|
||||
none @0;
|
||||
laneChangeLeft @1;
|
||||
laneChangeRight @2;
|
||||
mergeLeft @3;
|
||||
mergeRight @4;
|
||||
turnLeft @5;
|
||||
turnRight @6;
|
||||
}
|
||||
|
||||
enum Status @0xb9aa88c75ef99a1f {
|
||||
none @0;
|
||||
passive @1;
|
||||
approaching @2;
|
||||
active @3;
|
||||
}
|
||||
}
|
||||
|
||||
struct LiveLocationData @0xb99b2bc7a57e8128 {
|
||||
status @0 :UInt8;
|
||||
|
||||
# 3D fix
|
||||
lat @1 :Float64;
|
||||
lon @2 :Float64;
|
||||
alt @3 :Float32; # m
|
||||
|
||||
# speed
|
||||
speed @4 :Float32; # m/s
|
||||
|
||||
# NED velocity components
|
||||
vNED @5 :List(Float32);
|
||||
|
||||
# roll, pitch, heading (x,y,z)
|
||||
roll @6 :Float32; # WRT to center of earth?
|
||||
pitch @7 :Float32; # WRT to center of earth?
|
||||
heading @8 :Float32; # WRT to north?
|
||||
|
||||
# what are these?
|
||||
wanderAngle @9 :Float32;
|
||||
trackAngle @10 :Float32;
|
||||
|
||||
# car frame -- https://upload.wikimedia.org/wikipedia/commons/f/f5/RPY_angles_of_cars.png
|
||||
|
||||
# gyro, in car frame, deg/s
|
||||
gyro @11 :List(Float32);
|
||||
|
||||
# accel, in car frame, m/s^2
|
||||
accel @12 :List(Float32);
|
||||
|
||||
accuracy @13 :Accuracy;
|
||||
|
||||
source @14 :SensorSource;
|
||||
# if we are fixing a location in the past
|
||||
fixMonoTime @15 :UInt64;
|
||||
|
||||
gpsWeek @16 :Int32;
|
||||
timeOfWeek @17 :Float64;
|
||||
|
||||
positionECEF @18 :List(Float64);
|
||||
poseQuatECEF @19 :List(Float32);
|
||||
pitchCalibration @20 :Float32;
|
||||
yawCalibration @21 :Float32;
|
||||
imuFrame @22 :List(Float32);
|
||||
|
||||
struct Accuracy @0x943dc4625473b03f {
|
||||
pNEDError @0 :List(Float32);
|
||||
vNEDError @1 :List(Float32);
|
||||
rollError @2 :Float32;
|
||||
pitchError @3 :Float32;
|
||||
headingError @4 :Float32;
|
||||
ellipsoidSemiMajorError @5 :Float32;
|
||||
ellipsoidSemiMinorError @6 :Float32;
|
||||
ellipsoidOrientationError @7 :Float32;
|
||||
}
|
||||
|
||||
enum SensorSource @0xc871d3cc252af657 {
|
||||
applanix @0;
|
||||
kalman @1;
|
||||
orbslam @2;
|
||||
timing @3;
|
||||
dummy @4;
|
||||
}
|
||||
}
|
||||
|
||||
struct OrbOdometry @0xd7700859ed1f5b76 {
|
||||
# timing first
|
||||
startMonoTime @0 :UInt64;
|
||||
endMonoTime @1 :UInt64;
|
||||
|
||||
# fundamental matrix and error
|
||||
f @2: List(Float64);
|
||||
err @3: Float64;
|
||||
|
||||
# number of inlier points
|
||||
inliers @4: Int32;
|
||||
|
||||
# for debug only
|
||||
# indexed by endMonoTime features
|
||||
# value is startMonoTime feature match
|
||||
# -1 if no match
|
||||
matches @5: List(Int16);
|
||||
}
|
||||
|
||||
struct OrbFeatures @0xcd60164a8a0159ef {
|
||||
timestampEof @0 :UInt64;
|
||||
# transposed arrays of normalized image coordinates
|
||||
# len(xs) == len(ys) == len(descriptors) * 32
|
||||
xs @1 :List(Float32);
|
||||
ys @2 :List(Float32);
|
||||
descriptors @3 :Data;
|
||||
octaves @4 :List(Int8);
|
||||
|
||||
# match index to last OrbFeatures
|
||||
# -1 if no match
|
||||
timestampLastEof @5 :UInt64;
|
||||
matches @6: List(Int16);
|
||||
}
|
||||
|
||||
struct OrbFeaturesSummary @0xd500d30c5803fa4f {
|
||||
timestampEof @0 :UInt64;
|
||||
timestampLastEof @1 :UInt64;
|
||||
|
||||
featureCount @2 :UInt16;
|
||||
matchCount @3 :UInt16;
|
||||
computeNs @4 :UInt64;
|
||||
}
|
||||
|
||||
struct OrbKeyFrame @0xc8233c0345e27e24 {
|
||||
# this is a globally unique id for the KeyFrame
|
||||
id @0: UInt64;
|
||||
|
||||
# this is the location of the KeyFrame
|
||||
pos @1: ECEFPoint;
|
||||
|
||||
# these are the features in the world
|
||||
# len(dpos) == len(descriptors) * 32
|
||||
dpos @2 :List(ECEFPoint);
|
||||
descriptors @3 :Data;
|
||||
}
|
||||
|
||||
struct KalmanOdometry @0x92e21bb7ea38793a {
|
||||
trans @0 :List(Float32); # m/s in device frame
|
||||
rot @1 :List(Float32); # rad/s in device frame
|
||||
transStd @2 :List(Float32); # std m/s in device frame
|
||||
rotStd @3 :List(Float32); # std rad/s in device frame
|
||||
}
|
||||
|
||||
struct OrbObservation @0x9b326d4e436afec7 {
|
||||
observationMonoTime @0 :UInt64;
|
||||
normalizedCoordinates @1 :List(Float32);
|
||||
locationECEF @2 :List(Float64);
|
||||
matchDistance @3: UInt32;
|
||||
}
|
||||
|
||||
struct CalibrationFeatures @0x8fdfadb254ea867a {
|
||||
frameId @0 :UInt32;
|
||||
|
||||
p0 @1 :List(Float32);
|
||||
p1 @2 :List(Float32);
|
||||
status @3 :List(Int8);
|
||||
}
|
||||
|
||||
struct NavStatus @0xbd8822120928120c {
|
||||
isNavigating @0 :Bool;
|
||||
currentAddress @1 :Address;
|
||||
|
||||
struct Address @0xce7cd672cacc7814 {
|
||||
title @0 :Text;
|
||||
lat @1 :Float64;
|
||||
lng @2 :Float64;
|
||||
house @3 :Text;
|
||||
address @4 :Text;
|
||||
street @5 :Text;
|
||||
city @6 :Text;
|
||||
state @7 :Text;
|
||||
country @8 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
struct NavUpdate @0xdb98be6565516acb {
|
||||
isNavigating @0 :Bool;
|
||||
curSegment @1 :Int32;
|
||||
segments @2 :List(Segment);
|
||||
|
||||
struct LatLng @0x9eaef9187cadbb9b {
|
||||
lat @0 :Float64;
|
||||
lng @1 :Float64;
|
||||
}
|
||||
|
||||
struct Segment @0xa5b39b4fc4d7da3f {
|
||||
from @0 :LatLng;
|
||||
to @1 :LatLng;
|
||||
updateTime @2 :Int32;
|
||||
distance @3 :Int32;
|
||||
crossTime @4 :Int32;
|
||||
exitNo @5 :Int32;
|
||||
instruction @6 :Instruction;
|
||||
|
||||
parts @7 :List(LatLng);
|
||||
|
||||
enum Instruction @0xc5417a637451246f {
|
||||
turnLeft @0;
|
||||
turnRight @1;
|
||||
keepLeft @2;
|
||||
keepRight @3;
|
||||
straight @4;
|
||||
roundaboutExitNumber @5;
|
||||
roundaboutExit @6;
|
||||
roundaboutTurnLeft @7;
|
||||
unkn8 @8;
|
||||
roundaboutStraight @9;
|
||||
unkn10 @10;
|
||||
roundaboutTurnRight @11;
|
||||
unkn12 @12;
|
||||
roundaboutUturn @13;
|
||||
unkn14 @14;
|
||||
arrive @15;
|
||||
exitLeft @16;
|
||||
exitRight @17;
|
||||
unkn18 @18;
|
||||
uturn @19;
|
||||
# ...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TrafficEvent @0xacfa74a094e62626 {
|
||||
type @0 :Type;
|
||||
distance @1 :Float32;
|
||||
action @2 :Action;
|
||||
resuming @3 :Bool;
|
||||
|
||||
enum Type @0xd85d75253435bf4b {
|
||||
stopSign @0;
|
||||
lightRed @1;
|
||||
lightYellow @2;
|
||||
lightGreen @3;
|
||||
stopLight @4;
|
||||
}
|
||||
|
||||
enum Action @0xa6f6ce72165ccb49 {
|
||||
none @0;
|
||||
yield @1;
|
||||
stop @2;
|
||||
resumeReady @3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct AndroidGnss @0xdfdf30d03fc485bd {
|
||||
union {
|
||||
measurements @0 :Measurements;
|
||||
navigationMessage @1 :NavigationMessage;
|
||||
}
|
||||
|
||||
struct Measurements @0xa20710d4f428d6cd {
|
||||
clock @0 :Clock;
|
||||
measurements @1 :List(Measurement);
|
||||
|
||||
struct Clock @0xa0e27b453a38f450 {
|
||||
timeNanos @0 :Int64;
|
||||
hardwareClockDiscontinuityCount @1 :Int32;
|
||||
|
||||
hasTimeUncertaintyNanos @2 :Bool;
|
||||
timeUncertaintyNanos @3 :Float64;
|
||||
|
||||
hasLeapSecond @4 :Bool;
|
||||
leapSecond @5 :Int32;
|
||||
|
||||
hasFullBiasNanos @6 :Bool;
|
||||
fullBiasNanos @7 :Int64;
|
||||
|
||||
hasBiasNanos @8 :Bool;
|
||||
biasNanos @9 :Float64;
|
||||
|
||||
hasBiasUncertaintyNanos @10 :Bool;
|
||||
biasUncertaintyNanos @11 :Float64;
|
||||
|
||||
hasDriftNanosPerSecond @12 :Bool;
|
||||
driftNanosPerSecond @13 :Float64;
|
||||
|
||||
hasDriftUncertaintyNanosPerSecond @14 :Bool;
|
||||
driftUncertaintyNanosPerSecond @15 :Float64;
|
||||
}
|
||||
|
||||
struct Measurement @0xd949bf717d77614d {
|
||||
svId @0 :Int32;
|
||||
constellation @1 :Constellation;
|
||||
|
||||
timeOffsetNanos @2 :Float64;
|
||||
state @3 :Int32;
|
||||
receivedSvTimeNanos @4 :Int64;
|
||||
receivedSvTimeUncertaintyNanos @5 :Int64;
|
||||
cn0DbHz @6 :Float64;
|
||||
pseudorangeRateMetersPerSecond @7 :Float64;
|
||||
pseudorangeRateUncertaintyMetersPerSecond @8 :Float64;
|
||||
accumulatedDeltaRangeState @9 :Int32;
|
||||
accumulatedDeltaRangeMeters @10 :Float64;
|
||||
accumulatedDeltaRangeUncertaintyMeters @11 :Float64;
|
||||
|
||||
hasCarrierFrequencyHz @12 :Bool;
|
||||
carrierFrequencyHz @13 :Float32;
|
||||
hasCarrierCycles @14 :Bool;
|
||||
carrierCycles @15 :Int64;
|
||||
hasCarrierPhase @16 :Bool;
|
||||
carrierPhase @17 :Float64;
|
||||
hasCarrierPhaseUncertainty @18 :Bool;
|
||||
carrierPhaseUncertainty @19 :Float64;
|
||||
hasSnrInDb @20 :Bool;
|
||||
snrInDb @21 :Float64;
|
||||
|
||||
multipathIndicator @22 :MultipathIndicator;
|
||||
|
||||
enum Constellation @0x9ef1f3ff0deb5ffb {
|
||||
unknown @0;
|
||||
gps @1;
|
||||
sbas @2;
|
||||
glonass @3;
|
||||
qzss @4;
|
||||
beidou @5;
|
||||
galileo @6;
|
||||
}
|
||||
|
||||
enum State @0xcbb9490adce12d72 {
|
||||
unknown @0;
|
||||
codeLock @1;
|
||||
bitSync @2;
|
||||
subframeSync @3;
|
||||
towDecoded @4;
|
||||
msecAmbiguous @5;
|
||||
symbolSync @6;
|
||||
gloStringSync @7;
|
||||
gloTodDecoded @8;
|
||||
bdsD2BitSync @9;
|
||||
bdsD2SubframeSync @10;
|
||||
galE1bcCodeLock @11;
|
||||
galE1c2ndCodeLock @12;
|
||||
galE1bPageSync @13;
|
||||
sbasSync @14;
|
||||
}
|
||||
|
||||
enum MultipathIndicator @0xc04e7b6231d4caa8 {
|
||||
unknown @0;
|
||||
detected @1;
|
||||
notDetected @2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct NavigationMessage @0xe2517b083095fd4e {
|
||||
type @0 :Int32;
|
||||
svId @1 :Int32;
|
||||
messageId @2 :Int32;
|
||||
submessageId @3 :Int32;
|
||||
data @4 :Data;
|
||||
status @5 :Status;
|
||||
|
||||
enum Status @0xec1ff7996b35366f {
|
||||
unknown @0;
|
||||
parityPassed @1;
|
||||
parityRebuilt @2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct LidarPts @0xe3d6685d4e9d8f7a {
|
||||
r @0 :List(UInt16); # uint16 m*500.0
|
||||
theta @1 :List(UInt16); # uint16 deg*100.0
|
||||
reflect @2 :List(UInt8); # uint8 0-255
|
||||
|
||||
# For storing out of file.
|
||||
idx @3 :UInt64;
|
||||
|
||||
# For storing in file
|
||||
pkt @4 :Data;
|
||||
}
|
||||
|
||||
|
||||
2437
cereal/log.capnp
2437
cereal/log.capnp
File diff suppressed because it is too large
Load Diff
@@ -1,49 +0,0 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
@0xa086df597ef5d7a0;
|
||||
|
||||
# Geometry
|
||||
struct Point {
|
||||
x @0: Float64;
|
||||
y @1: Float64;
|
||||
z @2: Float64;
|
||||
}
|
||||
|
||||
struct PolyLine {
|
||||
points @0: List(Point);
|
||||
}
|
||||
|
||||
# Map features
|
||||
struct Lane {
|
||||
id @0 :Text;
|
||||
|
||||
leftBoundary @1 :LaneBoundary;
|
||||
rightBoundary @2 :LaneBoundary;
|
||||
|
||||
leftAdjacentId @3 :Text;
|
||||
rightAdjacentId @4 :Text;
|
||||
|
||||
inboundIds @5 :List(Text);
|
||||
outboundIds @6 :List(Text);
|
||||
|
||||
struct LaneBoundary {
|
||||
polyLine @0 :PolyLine;
|
||||
startHeading @1 :Float32; # WRT north
|
||||
}
|
||||
}
|
||||
|
||||
# Map tiles
|
||||
struct TileSummary {
|
||||
version @0 :Text;
|
||||
updatedAt @1 :UInt64; # Millis since epoch
|
||||
|
||||
level @2 :UInt8;
|
||||
x @3 :UInt16;
|
||||
y @4 :UInt16;
|
||||
}
|
||||
|
||||
struct MapTile {
|
||||
summary @0 :TileSummary;
|
||||
lanes @1 :List(Lane);
|
||||
}
|
||||
@@ -1,257 +0,0 @@
|
||||
# must be built with scons
|
||||
from msgq.ipc_pyx import Context, Poller, SubSocket, PubSocket, SocketEventHandle, toggle_fake_events, \
|
||||
set_fake_prefix, get_fake_prefix, delete_fake_prefix, wait_for_one_event
|
||||
from msgq.ipc_pyx import MultiplePublishersError, IpcError
|
||||
from msgq import fake_event_handle, pub_sock, sub_sock, drain_sock_raw
|
||||
import msgq
|
||||
|
||||
import os
|
||||
import capnp
|
||||
import time
|
||||
|
||||
from typing import Optional, List, Union, Dict, Deque
|
||||
from collections import deque
|
||||
|
||||
from cereal import log
|
||||
from cereal.services import SERVICE_LIST
|
||||
|
||||
NO_TRAVERSAL_LIMIT = 2**64-1
|
||||
|
||||
|
||||
def reset_context():
|
||||
msgq.context = Context()
|
||||
|
||||
|
||||
def log_from_bytes(dat: bytes, struct: capnp.lib.capnp._StructModule = log.Event) -> capnp.lib.capnp._DynamicStructReader:
|
||||
with struct.from_bytes(dat, traversal_limit_in_words=NO_TRAVERSAL_LIMIT) as msg:
|
||||
return msg
|
||||
|
||||
|
||||
def new_message(service: Optional[str], size: Optional[int] = None, **kwargs) -> capnp.lib.capnp._DynamicStructBuilder:
|
||||
args = {
|
||||
'valid': False,
|
||||
'logMonoTime': int(time.monotonic() * 1e9),
|
||||
**kwargs
|
||||
}
|
||||
dat = log.Event.new_message(**args)
|
||||
if service is not None:
|
||||
if size is None:
|
||||
dat.init(service)
|
||||
else:
|
||||
dat.init(service, size)
|
||||
return dat
|
||||
|
||||
|
||||
def drain_sock(sock: SubSocket, wait_for_one: bool = False) -> List[capnp.lib.capnp._DynamicStructReader]:
|
||||
"""Receive all message currently available on the queue"""
|
||||
msgs = drain_sock_raw(sock, wait_for_one=wait_for_one)
|
||||
return [log_from_bytes(m) for m in msgs]
|
||||
|
||||
|
||||
# TODO: print when we drop packets?
|
||||
def recv_sock(sock: SubSocket, wait: bool = False) -> Optional[capnp.lib.capnp._DynamicStructReader]:
|
||||
"""Same as drain sock, but only returns latest message. Consider using conflate instead."""
|
||||
dat = None
|
||||
|
||||
while 1:
|
||||
if wait and dat is None:
|
||||
recv = sock.receive()
|
||||
else:
|
||||
recv = sock.receive(non_blocking=True)
|
||||
|
||||
if recv is None: # Timeout hit
|
||||
break
|
||||
|
||||
dat = recv
|
||||
|
||||
if dat is not None:
|
||||
dat = log_from_bytes(dat)
|
||||
|
||||
return dat
|
||||
|
||||
|
||||
def recv_one(sock: SubSocket) -> Optional[capnp.lib.capnp._DynamicStructReader]:
|
||||
dat = sock.receive()
|
||||
if dat is not None:
|
||||
dat = log_from_bytes(dat)
|
||||
return dat
|
||||
|
||||
|
||||
def recv_one_or_none(sock: SubSocket) -> Optional[capnp.lib.capnp._DynamicStructReader]:
|
||||
dat = sock.receive(non_blocking=True)
|
||||
if dat is not None:
|
||||
dat = log_from_bytes(dat)
|
||||
return dat
|
||||
|
||||
|
||||
def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader:
|
||||
"""Keep receiving until we get a message"""
|
||||
while True:
|
||||
dat = sock.receive()
|
||||
if dat is not None:
|
||||
return log_from_bytes(dat)
|
||||
|
||||
|
||||
class SubMaster:
|
||||
def __init__(self, services: List[str], poll: Optional[str] = None,
|
||||
ignore_alive: Optional[List[str]] = None, ignore_avg_freq: Optional[List[str]] = None,
|
||||
ignore_valid: Optional[List[str]] = None, addr: str = "127.0.0.1", frequency: Optional[float] = None):
|
||||
self.frame = -1
|
||||
self.seen = {s: False for s in services}
|
||||
self.updated = {s: False for s in services}
|
||||
self.recv_time = {s: 0. for s in services}
|
||||
self.recv_frame = {s: 0 for s in services}
|
||||
self.alive = {s: False for s in services}
|
||||
self.freq_ok = {s: False for s in services}
|
||||
self.recv_dts: Dict[str, Deque[float]] = {}
|
||||
self.sock = {}
|
||||
self.data = {}
|
||||
self.valid = {}
|
||||
self.logMonoTime = {}
|
||||
|
||||
self.max_freq = {}
|
||||
self.min_freq = {}
|
||||
|
||||
self.poller = Poller()
|
||||
polled_services = set([poll, ] if poll is not None else services)
|
||||
self.non_polled_services = set(services) - polled_services
|
||||
|
||||
self.ignore_average_freq = [] if ignore_avg_freq is None else ignore_avg_freq
|
||||
self.ignore_alive = [] if ignore_alive is None else ignore_alive
|
||||
self.ignore_valid = [] if ignore_valid is None else ignore_valid
|
||||
|
||||
self.simulation = bool(int(os.getenv("SIMULATION", "0")))
|
||||
|
||||
# if freq and poll aren't specified, assume the max to be conservative
|
||||
assert frequency is None or poll is None, "Do not specify 'frequency' - frequency of the polled service will be used."
|
||||
self.update_freq = frequency or max([SERVICE_LIST[s].frequency for s in polled_services])
|
||||
|
||||
for s in services:
|
||||
p = self.poller if s not in self.non_polled_services else None
|
||||
self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True)
|
||||
|
||||
try:
|
||||
data = new_message(s)
|
||||
except capnp.lib.capnp.KjException:
|
||||
data = new_message(s, 0) # lists
|
||||
|
||||
self.data[s] = getattr(data.as_reader(), s)
|
||||
self.logMonoTime[s] = 0
|
||||
self.valid[s] = True # FIXME: this should default to False
|
||||
|
||||
freq = max(min([SERVICE_LIST[s].frequency, self.update_freq]), 1.)
|
||||
if s == poll:
|
||||
max_freq = freq
|
||||
min_freq = freq
|
||||
else:
|
||||
max_freq = min(freq, self.update_freq)
|
||||
if SERVICE_LIST[s].frequency >= 2*self.update_freq:
|
||||
min_freq = self.update_freq
|
||||
elif self.update_freq >= 2*SERVICE_LIST[s].frequency:
|
||||
min_freq = freq
|
||||
else:
|
||||
min_freq = min(freq, freq / 2.)
|
||||
self.max_freq[s] = max_freq*1.2
|
||||
self.min_freq[s] = min_freq*0.8
|
||||
self.recv_dts[s] = deque(maxlen=int(10*freq))
|
||||
|
||||
def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader:
|
||||
return self.data[s]
|
||||
|
||||
def _check_avg_freq(self, s: str) -> bool:
|
||||
return SERVICE_LIST[s].frequency > 0.99 and (s not in self.ignore_average_freq) and (s not in self.ignore_alive)
|
||||
|
||||
def update(self, timeout: int = 100) -> None:
|
||||
msgs = []
|
||||
for sock in self.poller.poll(timeout):
|
||||
msgs.append(recv_one_or_none(sock))
|
||||
|
||||
# non-blocking receive for non-polled sockets
|
||||
for s in self.non_polled_services:
|
||||
msgs.append(recv_one_or_none(self.sock[s]))
|
||||
self.update_msgs(time.monotonic(), msgs)
|
||||
|
||||
def update_msgs(self, cur_time: float, msgs: List[capnp.lib.capnp._DynamicStructReader]) -> None:
|
||||
self.frame += 1
|
||||
self.updated = dict.fromkeys(self.updated, False)
|
||||
for msg in msgs:
|
||||
if msg is None:
|
||||
continue
|
||||
|
||||
s = msg.which()
|
||||
self.seen[s] = True
|
||||
self.updated[s] = True
|
||||
|
||||
if self.recv_time[s] > 1e-5:
|
||||
self.recv_dts[s].append(cur_time - self.recv_time[s])
|
||||
self.recv_time[s] = cur_time
|
||||
self.recv_frame[s] = self.frame
|
||||
self.data[s] = getattr(msg, s)
|
||||
self.logMonoTime[s] = msg.logMonoTime
|
||||
self.valid[s] = msg.valid
|
||||
|
||||
for s in self.data:
|
||||
if SERVICE_LIST[s].frequency > 1e-5 and not self.simulation:
|
||||
# alive if delay is within 10x the expected frequency
|
||||
self.alive[s] = (cur_time - self.recv_time[s]) < (10. / SERVICE_LIST[s].frequency)
|
||||
|
||||
# check average frequency; slow to fall, quick to recover
|
||||
dts = self.recv_dts[s]
|
||||
assert dts.maxlen is not None
|
||||
recent_dts = list(dts)[-int(dts.maxlen / 10):]
|
||||
try:
|
||||
avg_freq = 1 / (sum(dts) / len(dts))
|
||||
avg_freq_recent = 1 / (sum(recent_dts) / len(recent_dts))
|
||||
except ZeroDivisionError:
|
||||
avg_freq = 0
|
||||
avg_freq_recent = 0
|
||||
|
||||
avg_freq_ok = self.min_freq[s] <= avg_freq <= self.max_freq[s]
|
||||
recent_freq_ok = self.min_freq[s] <= avg_freq_recent <= self.max_freq[s]
|
||||
self.freq_ok[s] = avg_freq_ok or recent_freq_ok
|
||||
else:
|
||||
self.freq_ok[s] = True
|
||||
if self.simulation:
|
||||
self.alive[s] = self.seen[s] # alive is defined as seen when simulation flag set
|
||||
else:
|
||||
self.alive[s] = True
|
||||
|
||||
def all_alive(self, service_list: Optional[List[str]] = None) -> bool:
|
||||
if service_list is None:
|
||||
service_list = list(self.sock.keys())
|
||||
return all(self.alive[s] for s in service_list if s not in self.ignore_alive)
|
||||
|
||||
def all_freq_ok(self, service_list: Optional[List[str]] = None) -> bool:
|
||||
if service_list is None:
|
||||
service_list = list(self.sock.keys())
|
||||
return all(self.freq_ok[s] for s in service_list if self._check_avg_freq(s))
|
||||
|
||||
def all_valid(self, service_list: Optional[List[str]] = None) -> bool:
|
||||
if service_list is None:
|
||||
service_list = list(self.sock.keys())
|
||||
return all(self.valid[s] for s in service_list if s not in self.ignore_valid)
|
||||
|
||||
def all_checks(self, service_list: Optional[List[str]] = None) -> bool:
|
||||
return self.all_alive(service_list) and self.all_freq_ok(service_list) and self.all_valid(service_list)
|
||||
|
||||
|
||||
class PubMaster:
|
||||
def __init__(self, services: List[str]):
|
||||
self.sock = {}
|
||||
for s in services:
|
||||
self.sock[s] = pub_sock(s)
|
||||
|
||||
def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) -> None:
|
||||
if not isinstance(dat, bytes):
|
||||
dat = dat.to_bytes()
|
||||
self.sock[s].send(dat)
|
||||
|
||||
def wait_for_readers_to_update(self, s: str, timeout: int, dt: float = 0.05) -> bool:
|
||||
for _ in range(int(timeout*(1./dt))):
|
||||
if self.sock[s].all_readers_updated():
|
||||
return True
|
||||
time.sleep(dt)
|
||||
return False
|
||||
|
||||
def all_readers_updated(self, s: str) -> bool:
|
||||
return self.sock[s].all_readers_updated() # type: ignore
|
||||
@@ -1,92 +0,0 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <csignal>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
typedef void (*sighandler_t)(int sig);
|
||||
|
||||
#include "cereal/services.h"
|
||||
#include "msgq/impl_msgq.h"
|
||||
#include "msgq/impl_zmq.h"
|
||||
|
||||
std::atomic<bool> do_exit = false;
|
||||
static void set_do_exit(int sig) {
|
||||
do_exit = true;
|
||||
}
|
||||
|
||||
void sigpipe_handler(int sig) {
|
||||
assert(sig == SIGPIPE);
|
||||
std::cout << "SIGPIPE received" << std::endl;
|
||||
}
|
||||
|
||||
static std::vector<std::string> get_services(std::string whitelist_str, bool zmq_to_msgq) {
|
||||
std::vector<std::string> service_list;
|
||||
for (const auto& it : services) {
|
||||
std::string name = it.second.name;
|
||||
bool in_whitelist = whitelist_str.find(name) != std::string::npos;
|
||||
if (name == "plusFrame" || name == "uiLayoutState" || (zmq_to_msgq && !in_whitelist)) {
|
||||
continue;
|
||||
}
|
||||
service_list.push_back(name);
|
||||
}
|
||||
return service_list;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
signal(SIGPIPE, (sighandler_t)sigpipe_handler);
|
||||
signal(SIGINT, (sighandler_t)set_do_exit);
|
||||
signal(SIGTERM, (sighandler_t)set_do_exit);
|
||||
|
||||
bool zmq_to_msgq = argc > 2;
|
||||
std::string ip = zmq_to_msgq ? argv[1] : "127.0.0.1";
|
||||
std::string whitelist_str = zmq_to_msgq ? std::string(argv[2]) : "";
|
||||
|
||||
Poller *poller;
|
||||
Context *pub_context;
|
||||
Context *sub_context;
|
||||
if (zmq_to_msgq) { // republishes zmq debugging messages as msgq
|
||||
poller = new ZMQPoller();
|
||||
pub_context = new MSGQContext();
|
||||
sub_context = new ZMQContext();
|
||||
} else {
|
||||
poller = new MSGQPoller();
|
||||
pub_context = new ZMQContext();
|
||||
sub_context = new MSGQContext();
|
||||
}
|
||||
|
||||
std::map<SubSocket*, PubSocket*> sub2pub;
|
||||
for (auto endpoint : get_services(whitelist_str, zmq_to_msgq)) {
|
||||
PubSocket * pub_sock;
|
||||
SubSocket * sub_sock;
|
||||
if (zmq_to_msgq) {
|
||||
pub_sock = new MSGQPubSocket();
|
||||
sub_sock = new ZMQSubSocket();
|
||||
} else {
|
||||
pub_sock = new ZMQPubSocket();
|
||||
sub_sock = new MSGQSubSocket();
|
||||
}
|
||||
pub_sock->connect(pub_context, endpoint);
|
||||
sub_sock->connect(sub_context, endpoint, ip, false);
|
||||
|
||||
poller->registerSocket(sub_sock);
|
||||
sub2pub[sub_sock] = pub_sock;
|
||||
}
|
||||
|
||||
while (!do_exit) {
|
||||
for (auto sub_sock : poller->poll(100)) {
|
||||
Message * msg = sub_sock->receive();
|
||||
if (msg == NULL) continue;
|
||||
int ret;
|
||||
do {
|
||||
ret = sub2pub[sub_sock]->sendMessage(msg);
|
||||
} while (ret == -1 && errno == EINTR && !do_exit);
|
||||
assert(ret >= 0 || do_exit);
|
||||
delete msg;
|
||||
|
||||
if (do_exit) break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
#include <capnp/serialize.h>
|
||||
|
||||
#include "cereal/gen/cpp/log.capnp.h"
|
||||
#include "common/timing.h"
|
||||
#include "msgq/ipc.h"
|
||||
|
||||
class SubMaster {
|
||||
public:
|
||||
SubMaster(const std::vector<const char *> &service_list, const std::vector<const char *> &poll = {},
|
||||
const char *address = nullptr, const std::vector<const char *> &ignore_alive = {});
|
||||
void update(int timeout = 1000);
|
||||
void update_msgs(uint64_t current_time, const std::vector<std::pair<std::string, cereal::Event::Reader>> &messages);
|
||||
inline bool allAlive(const std::vector<const char *> &service_list = {}) { return all_(service_list, false, true); }
|
||||
inline bool allValid(const std::vector<const char *> &service_list = {}) { return all_(service_list, true, false); }
|
||||
inline bool allAliveAndValid(const std::vector<const char *> &service_list = {}) { return all_(service_list, true, true); }
|
||||
void drain();
|
||||
~SubMaster();
|
||||
|
||||
uint64_t frame = 0;
|
||||
bool updated(const char *name) const;
|
||||
bool alive(const char *name) const;
|
||||
bool valid(const char *name) const;
|
||||
uint64_t rcv_frame(const char *name) const;
|
||||
uint64_t rcv_time(const char *name) const;
|
||||
cereal::Event::Reader &operator[](const char *name) const;
|
||||
|
||||
private:
|
||||
bool all_(const std::vector<const char *> &service_list, bool valid, bool alive);
|
||||
Poller *poller_ = nullptr;
|
||||
struct SubMessage;
|
||||
std::map<SubSocket *, SubMessage *> messages_;
|
||||
std::map<std::string, SubMessage *> services_;
|
||||
};
|
||||
|
||||
class MessageBuilder : public capnp::MallocMessageBuilder {
|
||||
public:
|
||||
MessageBuilder() = default;
|
||||
|
||||
cereal::Event::Builder initEvent(bool valid = true) {
|
||||
cereal::Event::Builder event = initRoot<cereal::Event>();
|
||||
event.setLogMonoTime(nanos_since_boot());
|
||||
event.setValid(valid);
|
||||
return event;
|
||||
}
|
||||
|
||||
kj::ArrayPtr<capnp::byte> toBytes() {
|
||||
heapArray_ = capnp::messageToFlatArray(*this);
|
||||
return heapArray_.asBytes();
|
||||
}
|
||||
|
||||
size_t getSerializedSize() {
|
||||
return capnp::computeSerializedSizeInWords(*this) * sizeof(capnp::word);
|
||||
}
|
||||
|
||||
int serializeToBuffer(unsigned char *buffer, size_t buffer_size) {
|
||||
size_t serialized_size = getSerializedSize();
|
||||
if (serialized_size > buffer_size) { return -1; }
|
||||
kj::ArrayOutputStream out(kj::ArrayPtr<capnp::byte>(buffer, buffer_size));
|
||||
capnp::writeMessage(out, *this);
|
||||
return serialized_size;
|
||||
}
|
||||
|
||||
private:
|
||||
kj::Array<capnp::word> heapArray_;
|
||||
};
|
||||
|
||||
class PubMaster {
|
||||
public:
|
||||
PubMaster(const std::vector<const char *> &service_list);
|
||||
inline int send(const char *name, capnp::byte *data, size_t size) { return sockets_.at(name)->send((char *)data, size); }
|
||||
int send(const char *name, MessageBuilder &msg);
|
||||
~PubMaster();
|
||||
|
||||
private:
|
||||
std::map<std::string, PubSocket *> sockets_;
|
||||
};
|
||||
|
||||
class AlignedBuffer {
|
||||
public:
|
||||
kj::ArrayPtr<const capnp::word> align(const char *data, const size_t size) {
|
||||
words_size = size / sizeof(capnp::word) + 1;
|
||||
if (aligned_buf.size() < words_size) {
|
||||
aligned_buf = kj::heapArray<capnp::word>(words_size < 512 ? 512 : words_size);
|
||||
}
|
||||
memcpy(aligned_buf.begin(), data, size);
|
||||
return aligned_buf.slice(0, words_size);
|
||||
}
|
||||
inline kj::ArrayPtr<const capnp::word> align(Message *m) {
|
||||
return align(m->getData(), m->getSize());
|
||||
}
|
||||
private:
|
||||
kj::Array<capnp::word> aligned_buf;
|
||||
size_t words_size;
|
||||
};
|
||||
@@ -1,203 +0,0 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
|
||||
#include "cereal/services.h"
|
||||
#include "cereal/messaging/messaging.h"
|
||||
|
||||
const bool SIMULATION = (getenv("SIMULATION") != nullptr) && (std::string(getenv("SIMULATION")) == "1");
|
||||
|
||||
static inline bool inList(const std::vector<const char *> &list, const char *value) {
|
||||
for (auto &v : list) {
|
||||
if (strcmp(value, v) == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class MessageContext {
|
||||
public:
|
||||
MessageContext() : ctx_(nullptr) {}
|
||||
~MessageContext() { delete ctx_; }
|
||||
inline Context *context() {
|
||||
std::call_once(init_flag, [=]() { ctx_ = Context::create(); });
|
||||
return ctx_;
|
||||
}
|
||||
private:
|
||||
Context *ctx_;
|
||||
std::once_flag init_flag;
|
||||
};
|
||||
|
||||
MessageContext message_context;
|
||||
|
||||
struct SubMaster::SubMessage {
|
||||
std::string name;
|
||||
SubSocket *socket = nullptr;
|
||||
int freq = 0;
|
||||
bool updated = false, alive = false, valid = true, ignore_alive;
|
||||
uint64_t rcv_time = 0, rcv_frame = 0;
|
||||
void *allocated_msg_reader = nullptr;
|
||||
bool is_polled = false;
|
||||
capnp::FlatArrayMessageReader *msg_reader = nullptr;
|
||||
AlignedBuffer aligned_buf;
|
||||
cereal::Event::Reader event;
|
||||
};
|
||||
|
||||
SubMaster::SubMaster(const std::vector<const char *> &service_list, const std::vector<const char *> &poll,
|
||||
const char *address, const std::vector<const char *> &ignore_alive) {
|
||||
poller_ = Poller::create();
|
||||
for (auto name : service_list) {
|
||||
assert(services.count(std::string(name)) > 0);
|
||||
|
||||
service serv = services.at(std::string(name));
|
||||
SubSocket *socket = SubSocket::create(message_context.context(), name, address ? address : "127.0.0.1", true);
|
||||
assert(socket != 0);
|
||||
bool is_polled = inList(poll, name) || poll.empty();
|
||||
if (is_polled) poller_->registerSocket(socket);
|
||||
SubMessage *m = new SubMessage{
|
||||
.name = name,
|
||||
.socket = socket,
|
||||
.freq = serv.frequency,
|
||||
.ignore_alive = inList(ignore_alive, name),
|
||||
.allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader)),
|
||||
.is_polled = is_polled};
|
||||
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader({});
|
||||
messages_[socket] = m;
|
||||
services_[name] = m;
|
||||
}
|
||||
}
|
||||
|
||||
void SubMaster::update(int timeout) {
|
||||
for (auto &kv : messages_) kv.second->updated = false;
|
||||
|
||||
auto sockets = poller_->poll(timeout);
|
||||
|
||||
// add non-polled sockets for non-blocking receive
|
||||
for (auto &kv : messages_) {
|
||||
SubMessage *m = kv.second;
|
||||
SubSocket *s = kv.first;
|
||||
if (!m->is_polled) sockets.push_back(s);
|
||||
}
|
||||
|
||||
uint64_t current_time = nanos_since_boot();
|
||||
|
||||
std::vector<std::pair<std::string, cereal::Event::Reader>> messages;
|
||||
|
||||
for (auto s : sockets) {
|
||||
Message *msg = s->receive(true);
|
||||
if (msg == nullptr) continue;
|
||||
|
||||
SubMessage *m = messages_.at(s);
|
||||
|
||||
m->msg_reader->~FlatArrayMessageReader();
|
||||
capnp::ReaderOptions options;
|
||||
options.traversalLimitInWords = kj::maxValue; // Don't limit
|
||||
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader(m->aligned_buf.align(msg), options);
|
||||
delete msg;
|
||||
messages.push_back({m->name, m->msg_reader->getRoot<cereal::Event>()});
|
||||
}
|
||||
|
||||
update_msgs(current_time, messages);
|
||||
}
|
||||
|
||||
void SubMaster::update_msgs(uint64_t current_time, const std::vector<std::pair<std::string, cereal::Event::Reader>> &messages){
|
||||
if (++frame == UINT64_MAX) frame = 1;
|
||||
|
||||
for (auto &kv : messages) {
|
||||
auto m_find = services_.find(kv.first);
|
||||
if (m_find == services_.end()){
|
||||
continue;
|
||||
}
|
||||
SubMessage *m = m_find->second;
|
||||
m->event = kv.second;
|
||||
m->updated = true;
|
||||
m->rcv_time = current_time;
|
||||
m->rcv_frame = frame;
|
||||
m->valid = m->event.getValid();
|
||||
if (SIMULATION) m->alive = true;
|
||||
}
|
||||
|
||||
if (!SIMULATION) {
|
||||
for (auto &kv : messages_) {
|
||||
SubMessage *m = kv.second;
|
||||
m->alive = (m->freq <= (1e-5) || ((current_time - m->rcv_time) * (1e-9)) < (10.0 / m->freq));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SubMaster::all_(const std::vector<const char *> &service_list, bool valid, bool alive) {
|
||||
int found = 0;
|
||||
for (auto &kv : messages_) {
|
||||
SubMessage *m = kv.second;
|
||||
if (service_list.size() == 0 || inList(service_list, m->name.c_str())) {
|
||||
found += (!valid || m->valid) && (!alive || (m->alive || m->ignore_alive));
|
||||
}
|
||||
}
|
||||
return service_list.size() == 0 ? found == messages_.size() : found == service_list.size();
|
||||
}
|
||||
|
||||
void SubMaster::drain() {
|
||||
while (true) {
|
||||
auto polls = poller_->poll(0);
|
||||
if (polls.size() == 0)
|
||||
break;
|
||||
|
||||
for (auto sock : polls) {
|
||||
Message *msg = sock->receive(true);
|
||||
delete msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SubMaster::updated(const char *name) const {
|
||||
return services_.at(name)->updated;
|
||||
}
|
||||
|
||||
bool SubMaster::alive(const char *name) const {
|
||||
return services_.at(name)->alive;
|
||||
}
|
||||
|
||||
bool SubMaster::valid(const char *name) const {
|
||||
return services_.at(name)->valid;
|
||||
}
|
||||
|
||||
uint64_t SubMaster::rcv_frame(const char *name) const {
|
||||
return services_.at(name)->rcv_frame;
|
||||
}
|
||||
|
||||
uint64_t SubMaster::rcv_time(const char *name) const {
|
||||
return services_.at(name)->rcv_time;
|
||||
}
|
||||
|
||||
cereal::Event::Reader &SubMaster::operator[](const char *name) const {
|
||||
return services_.at(name)->event;
|
||||
}
|
||||
|
||||
SubMaster::~SubMaster() {
|
||||
delete poller_;
|
||||
for (auto &kv : messages_) {
|
||||
SubMessage *m = kv.second;
|
||||
m->msg_reader->~FlatArrayMessageReader();
|
||||
free(m->allocated_msg_reader);
|
||||
delete m->socket;
|
||||
delete m;
|
||||
}
|
||||
}
|
||||
|
||||
PubMaster::PubMaster(const std::vector<const char *> &service_list) {
|
||||
for (auto name : service_list) {
|
||||
assert(services.count(name) > 0);
|
||||
PubSocket *socket = PubSocket::create(message_context.context(), name);
|
||||
assert(socket);
|
||||
sockets_[name] = socket;
|
||||
}
|
||||
}
|
||||
|
||||
int PubMaster::send(const char *name, MessageBuilder &msg) {
|
||||
auto bytes = msg.toBytes();
|
||||
return send(name, bytes.begin(), bytes.size());
|
||||
}
|
||||
|
||||
PubMaster::~PubMaster() {
|
||||
for (auto s : sockets_) delete s.second;
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
import os
|
||||
import capnp
|
||||
import multiprocessing
|
||||
import numbers
|
||||
import random
|
||||
import threading
|
||||
import time
|
||||
from parameterized import parameterized
|
||||
import pytest
|
||||
|
||||
from cereal import log, car
|
||||
import cereal.messaging as messaging
|
||||
from cereal.services import SERVICE_LIST
|
||||
|
||||
events = [evt for evt in log.Event.schema.union_fields if evt in SERVICE_LIST.keys()]
|
||||
|
||||
def random_sock():
|
||||
return random.choice(events)
|
||||
|
||||
def random_socks(num_socks=10):
|
||||
return list({random_sock() for _ in range(num_socks)})
|
||||
|
||||
def random_bytes(length=1000):
|
||||
return bytes([random.randrange(0xFF) for _ in range(length)])
|
||||
|
||||
def zmq_sleep(t=1):
|
||||
if "ZMQ" in os.environ:
|
||||
time.sleep(t)
|
||||
|
||||
|
||||
# TODO: this should take any capnp struct and returrn a msg with random populated data
|
||||
def random_carstate():
|
||||
fields = ["vEgo", "aEgo", "gas", "steeringAngleDeg"]
|
||||
msg = messaging.new_message("carState")
|
||||
cs = msg.carState
|
||||
for f in fields:
|
||||
setattr(cs, f, random.random() * 10)
|
||||
return msg
|
||||
|
||||
# TODO: this should compare any capnp structs
|
||||
def assert_carstate(cs1, cs2):
|
||||
for f in car.CarState.schema.non_union_fields:
|
||||
# TODO: check all types
|
||||
val1, val2 = getattr(cs1, f), getattr(cs2, f)
|
||||
if isinstance(val1, numbers.Number):
|
||||
assert val1 == val2, f"{f}: sent '{val1}' vs recvd '{val2}'"
|
||||
|
||||
def delayed_send(delay, sock, dat):
|
||||
def send_func():
|
||||
sock.send(dat)
|
||||
threading.Timer(delay, send_func).start()
|
||||
|
||||
|
||||
class TestMessaging:
|
||||
def setUp(self):
|
||||
# TODO: ZMQ tests are too slow; all sleeps will need to be
|
||||
# replaced with logic to block on the necessary condition
|
||||
if "ZMQ" in os.environ:
|
||||
pytest.skip()
|
||||
|
||||
# ZMQ pub socket takes too long to die
|
||||
# sleep to prevent multiple publishers error between tests
|
||||
zmq_sleep()
|
||||
|
||||
@parameterized.expand(events)
|
||||
def test_new_message(self, evt):
|
||||
try:
|
||||
msg = messaging.new_message(evt)
|
||||
except capnp.lib.capnp.KjException:
|
||||
msg = messaging.new_message(evt, random.randrange(200))
|
||||
assert (time.monotonic() - msg.logMonoTime) < 0.1
|
||||
assert not msg.valid
|
||||
assert evt == msg.which()
|
||||
|
||||
@parameterized.expand(events)
|
||||
def test_pub_sock(self, evt):
|
||||
messaging.pub_sock(evt)
|
||||
|
||||
@parameterized.expand(events)
|
||||
def test_sub_sock(self, evt):
|
||||
messaging.sub_sock(evt)
|
||||
|
||||
@parameterized.expand([
|
||||
(messaging.drain_sock, capnp._DynamicStructReader),
|
||||
(messaging.drain_sock_raw, bytes),
|
||||
])
|
||||
def test_drain_sock(self, func, expected_type):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sub_sock = messaging.sub_sock(sock, timeout=1000)
|
||||
zmq_sleep()
|
||||
|
||||
# no wait and no msgs in queue
|
||||
msgs = func(sub_sock)
|
||||
assert isinstance(msgs, list)
|
||||
assert len(msgs) == 0
|
||||
|
||||
# no wait but msgs are queued up
|
||||
num_msgs = random.randrange(3, 10)
|
||||
for _ in range(num_msgs):
|
||||
pub_sock.send(messaging.new_message(sock).to_bytes())
|
||||
time.sleep(0.1)
|
||||
msgs = func(sub_sock)
|
||||
assert isinstance(msgs, list)
|
||||
assert all(isinstance(msg, expected_type) for msg in msgs)
|
||||
assert len(msgs) == num_msgs
|
||||
|
||||
def test_recv_sock(self):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sub_sock = messaging.sub_sock(sock, timeout=100)
|
||||
zmq_sleep()
|
||||
|
||||
# no wait and no msg in queue, socket should timeout
|
||||
recvd = messaging.recv_sock(sub_sock)
|
||||
assert recvd is None
|
||||
|
||||
# no wait and one msg in queue
|
||||
msg = random_carstate()
|
||||
pub_sock.send(msg.to_bytes())
|
||||
time.sleep(0.01)
|
||||
recvd = messaging.recv_sock(sub_sock)
|
||||
assert isinstance(recvd, capnp._DynamicStructReader)
|
||||
# https://github.com/python/mypy/issues/13038
|
||||
assert_carstate(msg.carState, recvd.carState)
|
||||
|
||||
def test_recv_one(self):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sub_sock = messaging.sub_sock(sock, timeout=1000)
|
||||
zmq_sleep()
|
||||
|
||||
# no msg in queue, socket should timeout
|
||||
recvd = messaging.recv_one(sub_sock)
|
||||
assert recvd is None
|
||||
|
||||
# one msg in queue
|
||||
msg = random_carstate()
|
||||
pub_sock.send(msg.to_bytes())
|
||||
recvd = messaging.recv_one(sub_sock)
|
||||
assert isinstance(recvd, capnp._DynamicStructReader)
|
||||
assert_carstate(msg.carState, recvd.carState)
|
||||
|
||||
@pytest.mark.xfail(condition="ZMQ" in os.environ, reason='ZMQ detected')
|
||||
def test_recv_one_or_none(self):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sub_sock = messaging.sub_sock(sock)
|
||||
zmq_sleep()
|
||||
|
||||
# no msg in queue, socket shouldn't block
|
||||
recvd = messaging.recv_one_or_none(sub_sock)
|
||||
assert recvd is None
|
||||
|
||||
# one msg in queue
|
||||
msg = random_carstate()
|
||||
pub_sock.send(msg.to_bytes())
|
||||
recvd = messaging.recv_one_or_none(sub_sock)
|
||||
assert isinstance(recvd, capnp._DynamicStructReader)
|
||||
assert_carstate(msg.carState, recvd.carState)
|
||||
|
||||
def test_recv_one_retry(self):
|
||||
sock = "carState"
|
||||
sock_timeout = 0.1
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sub_sock = messaging.sub_sock(sock, timeout=round(sock_timeout*1000))
|
||||
zmq_sleep()
|
||||
|
||||
# this test doesn't work with ZMQ since multiprocessing interrupts it
|
||||
if "ZMQ" not in os.environ:
|
||||
# wait 15 socket timeouts and make sure it's still retrying
|
||||
p = multiprocessing.Process(target=messaging.recv_one_retry, args=(sub_sock,))
|
||||
p.start()
|
||||
time.sleep(sock_timeout*15)
|
||||
assert p.is_alive()
|
||||
p.terminate()
|
||||
|
||||
# wait 15 socket timeouts before sending
|
||||
msg = random_carstate()
|
||||
delayed_send(sock_timeout*15, pub_sock, msg.to_bytes())
|
||||
start_time = time.monotonic()
|
||||
recvd = messaging.recv_one_retry(sub_sock)
|
||||
assert (time.monotonic() - start_time) >= sock_timeout*15
|
||||
assert isinstance(recvd, capnp._DynamicStructReader)
|
||||
assert_carstate(msg.carState, recvd.carState)
|
||||
@@ -1,157 +0,0 @@
|
||||
import random
|
||||
import time
|
||||
from typing import Sized, cast
|
||||
|
||||
import cereal.messaging as messaging
|
||||
from cereal.messaging.tests.test_messaging import events, random_sock, random_socks, \
|
||||
random_bytes, random_carstate, assert_carstate, \
|
||||
zmq_sleep
|
||||
|
||||
|
||||
class TestSubMaster:
|
||||
|
||||
def setup_method(self):
|
||||
# ZMQ pub socket takes too long to die
|
||||
# sleep to prevent multiple publishers error between tests
|
||||
zmq_sleep(3)
|
||||
|
||||
def test_init(self):
|
||||
sm = messaging.SubMaster(events)
|
||||
for p in [sm.updated, sm.recv_time, sm.recv_frame, sm.alive,
|
||||
sm.sock, sm.data, sm.logMonoTime, sm.valid]:
|
||||
assert len(cast(Sized, p)) == len(events)
|
||||
|
||||
def test_init_state(self):
|
||||
socks = random_socks()
|
||||
sm = messaging.SubMaster(socks)
|
||||
assert sm.frame == -1
|
||||
assert not any(sm.updated.values())
|
||||
assert not any(sm.alive.values())
|
||||
assert all(t == 0. for t in sm.recv_time.values())
|
||||
assert all(f == 0 for f in sm.recv_frame.values())
|
||||
assert all(t == 0 for t in sm.logMonoTime.values())
|
||||
|
||||
for p in [sm.updated, sm.recv_time, sm.recv_frame, sm.alive,
|
||||
sm.sock, sm.data, sm.logMonoTime, sm.valid]:
|
||||
assert len(cast(Sized, p)) == len(socks)
|
||||
|
||||
def test_getitem(self):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sm = messaging.SubMaster([sock,])
|
||||
zmq_sleep()
|
||||
|
||||
msg = random_carstate()
|
||||
pub_sock.send(msg.to_bytes())
|
||||
sm.update(1000)
|
||||
assert_carstate(msg.carState, sm[sock])
|
||||
|
||||
# TODO: break this test up to individually test SubMaster.update and SubMaster.update_msgs
|
||||
def test_update(self):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sm = messaging.SubMaster([sock,])
|
||||
zmq_sleep()
|
||||
|
||||
for i in range(10):
|
||||
msg = messaging.new_message(sock)
|
||||
pub_sock.send(msg.to_bytes())
|
||||
sm.update(1000)
|
||||
assert sm.frame == i
|
||||
assert all(sm.updated.values())
|
||||
|
||||
def test_update_timeout(self):
|
||||
sock = random_sock()
|
||||
sm = messaging.SubMaster([sock,])
|
||||
for _ in range(5):
|
||||
timeout = random.randrange(1000, 5000)
|
||||
start_time = time.monotonic()
|
||||
sm.update(timeout)
|
||||
t = time.monotonic() - start_time
|
||||
assert t >= timeout/1000.
|
||||
assert t < 5
|
||||
assert not any(sm.updated.values())
|
||||
|
||||
def test_avg_frequency_checks(self):
|
||||
for poll in (True, False):
|
||||
sm = messaging.SubMaster(["modelV2", "carParams", "carState", "cameraOdometry", "liveCalibration"],
|
||||
poll=("modelV2" if poll else None),
|
||||
frequency=(20. if not poll else None))
|
||||
|
||||
checks = {
|
||||
"carState": (20, 20),
|
||||
"modelV2": (20, 20 if poll else 10),
|
||||
"cameraOdometry": (20, 10),
|
||||
"liveCalibration": (4, 4),
|
||||
"carParams": (None, None),
|
||||
}
|
||||
|
||||
for service, (max_freq, min_freq) in checks.items():
|
||||
if max_freq is not None:
|
||||
assert sm._check_avg_freq(service)
|
||||
assert sm.max_freq[service] == max_freq*1.2
|
||||
assert sm.min_freq[service] == min_freq*0.8
|
||||
else:
|
||||
assert not sm._check_avg_freq(service)
|
||||
|
||||
def test_alive(self):
|
||||
pass
|
||||
|
||||
def test_ignore_alive(self):
|
||||
pass
|
||||
|
||||
def test_valid(self):
|
||||
pass
|
||||
|
||||
# SubMaster should always conflate
|
||||
def test_conflate(self):
|
||||
sock = "carState"
|
||||
pub_sock = messaging.pub_sock(sock)
|
||||
sm = messaging.SubMaster([sock,])
|
||||
|
||||
n = 10
|
||||
for i in range(n+1):
|
||||
msg = messaging.new_message(sock)
|
||||
msg.carState.vEgo = i
|
||||
pub_sock.send(msg.to_bytes())
|
||||
time.sleep(0.01)
|
||||
sm.update(1000)
|
||||
assert sm[sock].vEgo == n
|
||||
|
||||
|
||||
class TestPubMaster:
|
||||
|
||||
def setup_method(self):
|
||||
# ZMQ pub socket takes too long to die
|
||||
# sleep to prevent multiple publishers error between tests
|
||||
zmq_sleep(3)
|
||||
|
||||
def test_init(self):
|
||||
messaging.PubMaster(events)
|
||||
|
||||
def test_send(self):
|
||||
socks = random_socks()
|
||||
pm = messaging.PubMaster(socks)
|
||||
sub_socks = {s: messaging.sub_sock(s, conflate=True, timeout=1000) for s in socks}
|
||||
zmq_sleep()
|
||||
|
||||
# PubMaster accepts either a capnp msg builder or bytes
|
||||
for capnp in [True, False]:
|
||||
for i in range(100):
|
||||
sock = socks[i % len(socks)]
|
||||
|
||||
if capnp:
|
||||
try:
|
||||
msg = messaging.new_message(sock)
|
||||
except Exception:
|
||||
msg = messaging.new_message(sock, random.randrange(50))
|
||||
else:
|
||||
msg = random_bytes()
|
||||
|
||||
pm.send(sock, msg)
|
||||
recvd = sub_socks[sock].receive()
|
||||
|
||||
if capnp:
|
||||
msg.clear_write_flag()
|
||||
msg = msg.to_bytes()
|
||||
assert msg == recvd, i
|
||||
@@ -1,21 +0,0 @@
|
||||
import os
|
||||
import tempfile
|
||||
from typing import Dict
|
||||
from parameterized import parameterized
|
||||
|
||||
import cereal.services as services
|
||||
from cereal.services import SERVICE_LIST
|
||||
|
||||
|
||||
class TestServices:
|
||||
|
||||
@parameterized.expand(SERVICE_LIST.keys())
|
||||
def test_services(self, s):
|
||||
service = SERVICE_LIST[s]
|
||||
assert service.frequency <= 104
|
||||
assert service.decimation != 0
|
||||
|
||||
def test_generated_header(self):
|
||||
with tempfile.NamedTemporaryFile(suffix=".h") as f:
|
||||
ret = os.system(f"python3 {services.__file__} > {f.name} && clang++ {f.name}")
|
||||
assert ret == 0, "generated services header is not valid C"
|
||||
@@ -1,131 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class Service:
|
||||
def __init__(self, should_log: bool, frequency: float, decimation: Optional[int] = None):
|
||||
self.should_log = should_log
|
||||
self.frequency = frequency
|
||||
self.decimation = decimation
|
||||
|
||||
|
||||
_services: dict[str, tuple] = {
|
||||
# service: (should_log, frequency, qlog decimation (optional))
|
||||
# note: the "EncodeIdx" packets will still be in the log
|
||||
"gyroscope": (True, 104., 104),
|
||||
"gyroscope2": (True, 100., 100),
|
||||
"accelerometer": (True, 104., 104),
|
||||
"accelerometer2": (True, 100., 100),
|
||||
"magnetometer": (True, 25.),
|
||||
"lightSensor": (True, 100., 100),
|
||||
"temperatureSensor": (True, 2., 200),
|
||||
"temperatureSensor2": (True, 2., 200),
|
||||
"gpsNMEA": (True, 9.),
|
||||
"deviceState": (True, 2., 1),
|
||||
"can": (True, 100., 2053), # decimation gives ~3 msgs in a full segment
|
||||
"controlsState": (True, 100., 10),
|
||||
"pandaStates": (True, 10., 1),
|
||||
"peripheralState": (True, 2., 1),
|
||||
"radarState": (True, 20., 5),
|
||||
"roadEncodeIdx": (False, 20., 1),
|
||||
"liveTracks": (True, 20.),
|
||||
"sendcan": (True, 100., 139),
|
||||
"logMessage": (True, 0.),
|
||||
"errorLogMessage": (True, 0., 1),
|
||||
"liveCalibration": (True, 4., 4),
|
||||
"liveTorqueParameters": (True, 4., 1),
|
||||
"androidLog": (True, 0.),
|
||||
"carState": (True, 100., 10),
|
||||
"carControl": (True, 100., 10),
|
||||
"carOutput": (True, 100., 10),
|
||||
"longitudinalPlan": (True, 20., 10),
|
||||
"procLog": (True, 0.5, 15),
|
||||
"gpsLocationExternal": (True, 10., 10),
|
||||
"gpsLocation": (True, 1., 1),
|
||||
"ubloxGnss": (True, 10.),
|
||||
"qcomGnss": (True, 2.),
|
||||
"gnssMeasurements": (True, 10., 10),
|
||||
"clocks": (True, 0.1, 1),
|
||||
"ubloxRaw": (True, 20.),
|
||||
"livePose": (True, 20., 4),
|
||||
"liveLocationKalman": (True, 20.),
|
||||
"liveParameters": (True, 20., 5),
|
||||
"cameraOdometry": (True, 20., 10),
|
||||
"lateralPlanDEPRECATED": (True, 20., 5),
|
||||
"thumbnail": (True, 0.2, 1),
|
||||
"onroadEvents": (True, 1., 1),
|
||||
"carParams": (True, 0.02, 1),
|
||||
"roadCameraState": (True, 20., 20),
|
||||
"driverCameraState": (True, 20., 20),
|
||||
"driverEncodeIdx": (False, 20., 1),
|
||||
"driverStateV2": (True, 20., 10),
|
||||
"driverMonitoringState": (True, 20., 10),
|
||||
"wideRoadEncodeIdx": (False, 20., 1),
|
||||
"wideRoadCameraState": (True, 20., 20),
|
||||
"drivingModelData": (True, 20., 10),
|
||||
"modelV2": (True, 20.),
|
||||
"managerState": (True, 2., 1),
|
||||
"uploaderState": (True, 0., 1),
|
||||
"navInstruction": (True, 1., 10),
|
||||
"navRoute": (True, 0.),
|
||||
"navThumbnail": (True, 0.),
|
||||
"navModelDEPRECATED": (True, 2., 4.),
|
||||
"mapRenderState": (True, 2., 1.),
|
||||
"uiPlanDEPRECATED": (True, 20., 40.),
|
||||
"qRoadEncodeIdx": (False, 20.),
|
||||
"userFlag": (True, 0., 1),
|
||||
"microphone": (True, 10., 10),
|
||||
|
||||
"controlsStateSP": (True, 100., 10),
|
||||
"longitudinalPlanSP": (True, 20., 5),
|
||||
"lateralPlanSPDEPRECATED": (True, 20., 5),
|
||||
"driverMonitoringStateSP": (True, 20., 10),
|
||||
"liveMapDataSP": (True, 0.),
|
||||
"e2eLongStateSP": (True, 0.),
|
||||
"modelV2SP": (True, 20., 40),
|
||||
|
||||
# debug
|
||||
"uiDebug": (True, 0., 1),
|
||||
"testJoystick": (True, 0.),
|
||||
"roadEncodeData": (False, 20.),
|
||||
"driverEncodeData": (False, 20.),
|
||||
"wideRoadEncodeData": (False, 20.),
|
||||
"qRoadEncodeData": (False, 20.),
|
||||
"livestreamWideRoadEncodeIdx": (False, 20.),
|
||||
"livestreamRoadEncodeIdx": (False, 20.),
|
||||
"livestreamDriverEncodeIdx": (False, 20.),
|
||||
"livestreamWideRoadEncodeData": (False, 20.),
|
||||
"livestreamRoadEncodeData": (False, 20.),
|
||||
"livestreamDriverEncodeData": (False, 20.),
|
||||
"customReservedRawData0": (True, 0.),
|
||||
"customReservedRawData1": (True, 0.),
|
||||
"customReservedRawData2": (True, 0.),
|
||||
}
|
||||
SERVICE_LIST = {name: Service(*vals) for
|
||||
idx, (name, vals) in enumerate(_services.items())}
|
||||
|
||||
|
||||
def build_header():
|
||||
h = ""
|
||||
h += "/* THIS IS AN AUTOGENERATED FILE, PLEASE EDIT services.py */\n"
|
||||
h += "#ifndef __SERVICES_H\n"
|
||||
h += "#define __SERVICES_H\n"
|
||||
|
||||
h += "#include <map>\n"
|
||||
h += "#include <string>\n"
|
||||
|
||||
h += "struct service { std::string name; bool should_log; int frequency; int decimation; };\n"
|
||||
h += "static std::map<std::string, service> services = {\n"
|
||||
for k, v in SERVICE_LIST.items():
|
||||
should_log = "true" if v.should_log else "false"
|
||||
decimation = -1 if v.decimation is None else v.decimation
|
||||
h += ' { "%s", {"%s", %s, %d, %d}},\n' % \
|
||||
(k, k, should_log, v.frequency, decimation)
|
||||
h += "};\n"
|
||||
|
||||
h += "#endif\n"
|
||||
return h
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(build_header())
|
||||
@@ -6,8 +6,3 @@ coverage:
|
||||
informational: true
|
||||
patch: off
|
||||
|
||||
ignore:
|
||||
- "**/test_*.py"
|
||||
- "selfdrive/test/**"
|
||||
- "system/version.py" # codecov changes depending on if we are in a branch or not
|
||||
- "tools"
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
Import('env', 'envCython', 'arch')
|
||||
Import('env', 'envCython', 'arch', 'SHARED')
|
||||
|
||||
if SHARED:
|
||||
fxn = env.SharedLibrary
|
||||
else:
|
||||
fxn = env.Library
|
||||
|
||||
common_libs = [
|
||||
'params.cc',
|
||||
'statlog.cc',
|
||||
'swaglog.cc',
|
||||
'util.cc',
|
||||
'i2c.cc',
|
||||
@@ -12,28 +18,29 @@ common_libs = [
|
||||
if arch != "Darwin":
|
||||
common_libs.append('gpio.cc')
|
||||
|
||||
_common = env.Library('common', common_libs, LIBS="json11")
|
||||
_common = fxn('common', common_libs, LIBS="json11")
|
||||
|
||||
files = [
|
||||
'clutil.cc',
|
||||
]
|
||||
|
||||
_gpucommon = env.Library('gpucommon', files)
|
||||
_gpucommon = fxn('gpucommon', files)
|
||||
Export('_common', '_gpucommon')
|
||||
|
||||
if GetOption('extras'):
|
||||
env.Program('tests/test_common',
|
||||
['tests/test_runner.cc', 'tests/test_params.cc', 'tests/test_util.cc', 'tests/test_swaglog.cc'],
|
||||
['tests/test_runner.cc', 'tests/test_util.cc', 'tests/test_swaglog.cc', 'tests/test_ratekeeper.cc'],
|
||||
LIBS=[_common, 'json11', 'zmq', 'pthread'])
|
||||
|
||||
# Cython bindings
|
||||
params_python = envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11'])
|
||||
|
||||
SConscript([
|
||||
'transformations/SConscript',
|
||||
'kalman/SConscript',
|
||||
'transformations/SConscript'
|
||||
])
|
||||
|
||||
Import('transformations_python')
|
||||
common_python = [params_python, transformations_python]
|
||||
Import('simple_kalman_python', 'transformations_python')
|
||||
common_python = [params_python, simple_kalman_python, transformations_python]
|
||||
|
||||
Export('common_python')
|
||||
|
||||
@@ -1,27 +1,46 @@
|
||||
from .comma_connect import CommaConnectApi
|
||||
from .sunnylink import SunnylinkApi
|
||||
import jwt
|
||||
import os
|
||||
import requests
|
||||
from datetime import datetime, timedelta
|
||||
from openpilot.common.basedir import PERSIST
|
||||
from openpilot.system.version import get_version
|
||||
|
||||
API_HOST = os.getenv('API_HOST', 'https://api.commadotai.com')
|
||||
|
||||
class Api:
|
||||
def __init__(self, dongle_id, use_sunnylink=False):
|
||||
if use_sunnylink:
|
||||
self.service = SunnylinkApi(dongle_id)
|
||||
else:
|
||||
self.service = CommaConnectApi(dongle_id)
|
||||
|
||||
def request(self, method, endpoint, **params):
|
||||
return self.service.request(method, endpoint, **params)
|
||||
class Api():
|
||||
def __init__(self, dongle_id):
|
||||
self.dongle_id = dongle_id
|
||||
with open(PERSIST+'/comma/id_rsa') as f:
|
||||
self.private_key = f.read()
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
return self.service.get(*args, **kwargs)
|
||||
return self.request('GET', *args, **kwargs)
|
||||
|
||||
def post(self, *args, **kwargs):
|
||||
return self.service.post(*args, **kwargs)
|
||||
return self.request('POST', *args, **kwargs)
|
||||
|
||||
def request(self, method, endpoint, timeout=None, access_token=None, **params):
|
||||
return api_get(endpoint, method=method, timeout=timeout, access_token=access_token, **params)
|
||||
|
||||
def get_token(self, expiry_hours=1):
|
||||
return self.service.get_token(expiry_hours)
|
||||
now = datetime.utcnow()
|
||||
payload = {
|
||||
'identity': self.dongle_id,
|
||||
'nbf': now,
|
||||
'iat': now,
|
||||
'exp': now + timedelta(hours=expiry_hours)
|
||||
}
|
||||
token = jwt.encode(payload, self.private_key, algorithm='RS256')
|
||||
if isinstance(token, bytes):
|
||||
token = token.decode('utf8')
|
||||
return token
|
||||
|
||||
|
||||
def api_get(endpoint, method='GET', timeout=None, access_token=None, use_sunnylink=False, **params):
|
||||
return CommaConnectApi(None).api_get(endpoint, method, timeout, access_token, **params) if not use_sunnylink else \
|
||||
SunnylinkApi(None).api_get(endpoint, method, timeout, access_token, **params)
|
||||
def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
|
||||
headers = {}
|
||||
if access_token is not None:
|
||||
headers['Authorization'] = "JWT " + access_token
|
||||
|
||||
headers['User-Agent'] = "openpilot-" + get_version()
|
||||
|
||||
return requests.request(method, API_HOST + "/" + endpoint, timeout=timeout, headers=headers, params=params)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import jwt
|
||||
import requests
|
||||
import unicodedata
|
||||
from datetime import datetime, timedelta, UTC
|
||||
from openpilot.system.hardware.hw import Paths
|
||||
from openpilot.system.version import get_version
|
||||
|
||||
|
||||
class BaseApi:
|
||||
def __init__(self, dongle_id, api_host, user_agent="openpilot-"):
|
||||
self.dongle_id = dongle_id
|
||||
self.api_host = api_host
|
||||
self.user_agent = user_agent
|
||||
with open(Paths.persist_root()+'/comma/id_rsa') as f:
|
||||
self.private_key = f.read()
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
return self.request('GET', *args, **kwargs)
|
||||
|
||||
def post(self, *args, **kwargs):
|
||||
return self.request('POST', *args, **kwargs)
|
||||
|
||||
def request(self, method, endpoint, timeout=None, access_token=None, **params):
|
||||
return self.api_get(endpoint, method=method, timeout=timeout, access_token=access_token, **params)
|
||||
|
||||
def _get_token(self, expiry_hours=1, **extra_payload):
|
||||
now = datetime.now(UTC).replace(tzinfo=None)
|
||||
payload = {
|
||||
'identity': self.dongle_id,
|
||||
'nbf': now,
|
||||
'iat': now,
|
||||
'exp': now + timedelta(hours=expiry_hours),
|
||||
**extra_payload
|
||||
}
|
||||
token = jwt.encode(payload, self.private_key, algorithm='RS256')
|
||||
if isinstance(token, bytes):
|
||||
token = token.decode('utf8')
|
||||
return token
|
||||
|
||||
def get_token(self, expiry_hours=1):
|
||||
return self._get_token(expiry_hours)
|
||||
|
||||
def remove_non_ascii_chars(self, text):
|
||||
normalized_text = unicodedata.normalize('NFD', text)
|
||||
ascii_encoded_text = normalized_text.encode('ascii', 'ignore')
|
||||
return ascii_encoded_text.decode()
|
||||
|
||||
def api_get(self, endpoint, method='GET', timeout=None, access_token=None, **params):
|
||||
headers = {}
|
||||
if access_token is not None:
|
||||
headers['Authorization'] = "JWT " + access_token
|
||||
|
||||
version = self.remove_non_ascii_chars(get_version())
|
||||
headers['User-Agent'] = self.user_agent + version
|
||||
|
||||
return requests.request(method, self.api_host + "/" + endpoint, timeout=timeout, headers=headers, params=params)
|
||||
@@ -1,11 +0,0 @@
|
||||
import os
|
||||
|
||||
from openpilot.common.api.base import BaseApi
|
||||
|
||||
API_HOST = os.getenv('API_HOST', 'https://api.commadotai.com')
|
||||
|
||||
|
||||
class CommaConnectApi(BaseApi):
|
||||
def __init__(self, dongle_id):
|
||||
super().__init__(dongle_id, API_HOST)
|
||||
self.user_agent = "openpilot-"
|
||||
@@ -1,155 +0,0 @@
|
||||
import os
|
||||
import time
|
||||
import jwt
|
||||
import json
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timedelta
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.system.hardware import HARDWARE
|
||||
from openpilot.system.hardware.hw import Paths
|
||||
|
||||
from openpilot.common.api.base import BaseApi
|
||||
|
||||
API_HOST = os.getenv('SUNNYLINK_API_HOST', 'https://stg.api.sunnypilot.ai')
|
||||
UNREGISTERED_SUNNYLINK_DONGLE_ID = "UnregisteredDevice"
|
||||
MAX_RETRIES = 6
|
||||
CRASH_LOG_DIR = '/data/community/crashes'
|
||||
|
||||
class SunnylinkApi(BaseApi):
|
||||
def __init__(self, dongle_id):
|
||||
super().__init__(dongle_id, API_HOST)
|
||||
self.user_agent = "sunnypilot-"
|
||||
self.spinner = None
|
||||
self.params = Params()
|
||||
|
||||
def api_get(self, endpoint, method='GET', timeout=10, access_token=None, **kwargs):
|
||||
if not self.params.get_bool("SunnylinkEnabled"):
|
||||
return None
|
||||
|
||||
return super().api_get(endpoint, method, timeout, access_token, **kwargs)
|
||||
|
||||
def resume_queued(self, timeout=10, **kwargs):
|
||||
sunnylinkId, commaId = self._resolve_dongle_ids()
|
||||
return self.api_get(f"ws/{sunnylinkId}/resume_queued", "POST", timeout, access_token=self.get_token(), **kwargs)
|
||||
|
||||
def get_token(self, expiry_hours=1):
|
||||
# Add your additional data here
|
||||
additional_data = {}
|
||||
return super()._get_token(expiry_hours, **additional_data)
|
||||
|
||||
def _status_update(self, message):
|
||||
print(message)
|
||||
if self.spinner:
|
||||
self.spinner.update(message)
|
||||
time.sleep(0.5)
|
||||
|
||||
def _resolve_dongle_ids(self):
|
||||
sunnylink_dongle_id = self.params.get("SunnylinkDongleId", encoding='utf-8')
|
||||
comma_dongle_id = self.dongle_id or self.params.get("DongleId", encoding='utf-8')
|
||||
return sunnylink_dongle_id, comma_dongle_id
|
||||
|
||||
def _resolve_imeis(self):
|
||||
imei1, imei2 = None, None
|
||||
imei_try = 0
|
||||
while imei1 is None and imei2 is None and imei_try < MAX_RETRIES:
|
||||
try:
|
||||
imei1, imei2 = self.params.get("IMEI", encoding='utf8') or HARDWARE.get_imei(0), HARDWARE.get_imei(1)
|
||||
except Exception:
|
||||
self._status_update(f"Error getting imei, trying again... [{imei_try+1}/{MAX_RETRIES}]")
|
||||
time.sleep(1)
|
||||
imei_try += 1
|
||||
return imei1, imei2
|
||||
|
||||
def _resolve_serial(self):
|
||||
serial = self.params.get("HardwareSerial", encoding='utf8') or HARDWARE.get_serial()
|
||||
return serial
|
||||
|
||||
def register_device(self, spinner=None, timeout=60, verbose=False):
|
||||
self.spinner = spinner
|
||||
|
||||
sunnylink_dongle_id, comma_dongle_id = self._resolve_dongle_ids()
|
||||
|
||||
if comma_dongle_id is None:
|
||||
self._status_update("Comma dongle ID not found, deferring sunnylink's registration to comma's registration process.")
|
||||
return None
|
||||
|
||||
imei1, imei2 = self._resolve_imeis()
|
||||
serial = self._resolve_serial()
|
||||
|
||||
if sunnylink_dongle_id not in (None, UNREGISTERED_SUNNYLINK_DONGLE_ID):
|
||||
return sunnylink_dongle_id
|
||||
|
||||
privkey_path = Path(Paths.persist_root()+"/comma/id_rsa")
|
||||
pubkey_path = Path(Paths.persist_root()+"/comma/id_rsa.pub")
|
||||
|
||||
start_time = time.monotonic()
|
||||
successful_registration = False
|
||||
if not pubkey_path.is_file():
|
||||
sunnylink_dongle_id = UNREGISTERED_SUNNYLINK_DONGLE_ID
|
||||
self._status_update("Public key not found, setting dongle ID to unregistered.")
|
||||
else:
|
||||
Params().put("LastSunnylinkPingTime", "0") # Reset the last ping time to 0 if we are trying to register
|
||||
with pubkey_path.open() as f1, privkey_path.open() as f2:
|
||||
public_key = f1.read()
|
||||
private_key = f2.read()
|
||||
|
||||
backoff = 1
|
||||
while True:
|
||||
register_token = jwt.encode({'register': True, 'exp': datetime.utcnow() + timedelta(hours=1)}, private_key, algorithm='RS256')
|
||||
try:
|
||||
if verbose or time.monotonic() - start_time < timeout / 2:
|
||||
self._status_update("Registering device to sunnylink...")
|
||||
elif time.monotonic() - start_time >= timeout / 2:
|
||||
self._status_update("Still registering device to sunnylink...")
|
||||
|
||||
resp = self.api_get("v2/pilotauth/", method='POST', timeout=15, imei=imei1, imei2=imei2, serial=serial, comma_dongle_id=comma_dongle_id, public_key=public_key, register_token=register_token)
|
||||
|
||||
if resp is None:
|
||||
raise Exception("Unable to register device, request was None")
|
||||
|
||||
if resp.status_code in (409, 412):
|
||||
timeout = time.monotonic() - start_time # Don't retry if the public key is already in use
|
||||
key_in_use = "Public key is already in use, is your key unique? Contact your vendor for a new key."
|
||||
unsafe_key = "Public key is known to not be unique and it's unsafe. Contact your vendor for a new key."
|
||||
error_message = key_in_use if resp.status_code == 409 else unsafe_key
|
||||
raise Exception(error_message)
|
||||
|
||||
if resp.status_code != 200:
|
||||
raise Exception(f"Failed to register with sunnylink. Status code: {resp.status_code}\nData\n:{resp.text}")
|
||||
|
||||
dongleauth = json.loads(resp.text)
|
||||
sunnylink_dongle_id = dongleauth["device_id"]
|
||||
if sunnylink_dongle_id:
|
||||
self._status_update("Device registered successfully.")
|
||||
successful_registration = True
|
||||
break
|
||||
except Exception as e:
|
||||
if verbose:
|
||||
self._status_update(f"Waiting {backoff}s before retry, Exception occurred during registration: [{str(e)}]")
|
||||
|
||||
if not os.path.exists(CRASH_LOG_DIR):
|
||||
os.makedirs(CRASH_LOG_DIR)
|
||||
|
||||
with open(f'{CRASH_LOG_DIR}/error.txt', 'a') as f:
|
||||
f.write(f"[{datetime.now()}] sunnylink: {str(e)}\n")
|
||||
|
||||
backoff = min(backoff * 2, 60)
|
||||
time.sleep(backoff)
|
||||
|
||||
if time.monotonic() - start_time > timeout:
|
||||
self._status_update(f"Giving up on sunnylink's registration after {timeout}s. Will retry on next boot.")
|
||||
time.sleep(3)
|
||||
break
|
||||
|
||||
self.params.put("SunnylinkDongleId", sunnylink_dongle_id or UNREGISTERED_SUNNYLINK_DONGLE_ID)
|
||||
|
||||
# Set the last ping time to the current time since we were just talking to the API
|
||||
last_ping = int(time.monotonic() * 1e9) if successful_registration else start_time
|
||||
Params().put("LastSunnylinkPingTime", str(last_ping))
|
||||
|
||||
# Disable sunnylink if registration was not successful
|
||||
if not successful_registration:
|
||||
Params().put_bool("SunnylinkEnabled", False)
|
||||
|
||||
self.spinner = None
|
||||
return sunnylink_dongle_id
|
||||
@@ -1,4 +1,11 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from openpilot.system.hardware import PC
|
||||
|
||||
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
|
||||
|
||||
if PC:
|
||||
PERSIST = os.path.join(str(Path.home()), ".comma", "persist")
|
||||
else:
|
||||
PERSIST = "/persist"
|
||||
|
||||
@@ -1,8 +1,55 @@
|
||||
import os
|
||||
import sys
|
||||
import fcntl
|
||||
import hashlib
|
||||
import platform
|
||||
|
||||
from cffi import FFI
|
||||
|
||||
def suffix():
|
||||
if platform.system() == "Darwin":
|
||||
return ".dylib"
|
||||
else:
|
||||
return ".so"
|
||||
|
||||
def ffi_wrap(name, c_code, c_header, tmpdir="/tmp/ccache", cflags="", libraries=None):
|
||||
if libraries is None:
|
||||
libraries = []
|
||||
|
||||
cache = name + "_" + hashlib.sha1(c_code.encode('utf-8')).hexdigest()
|
||||
try:
|
||||
os.mkdir(tmpdir)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
fd = os.open(tmpdir, 0)
|
||||
fcntl.flock(fd, fcntl.LOCK_EX)
|
||||
try:
|
||||
sys.path.append(tmpdir)
|
||||
try:
|
||||
mod = __import__(cache)
|
||||
except Exception:
|
||||
print(f"cache miss {cache}")
|
||||
compile_code(cache, c_code, c_header, tmpdir, cflags, libraries)
|
||||
mod = __import__(cache)
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
return mod.ffi, mod.lib
|
||||
|
||||
|
||||
def compile_code(name, c_code, c_header, directory, cflags="", libraries=None):
|
||||
if libraries is None:
|
||||
libraries = []
|
||||
|
||||
ffibuilder = FFI()
|
||||
ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
|
||||
ffibuilder.cdef(c_header)
|
||||
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++1z"
|
||||
os.environ['CFLAGS'] = cflags
|
||||
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
|
||||
|
||||
|
||||
def wrap_compiled(name, directory):
|
||||
sys.path.append(directory)
|
||||
mod = __import__(name)
|
||||
return mod.ffi, mod.lib
|
||||
|
||||
@@ -1,6 +1,60 @@
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import contextlib
|
||||
from atomicwrites import AtomicWriter
|
||||
|
||||
|
||||
def mkdirs_exists_ok(path):
|
||||
if path.startswith(('http://', 'https://')):
|
||||
raise ValueError('URL path')
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError:
|
||||
if not os.path.isdir(path):
|
||||
raise
|
||||
|
||||
|
||||
def rm_not_exists_ok(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
if os.path.exists(path):
|
||||
raise
|
||||
|
||||
|
||||
def rm_tree_or_link(path):
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
elif os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def get_tmpdir_on_same_filesystem(path):
|
||||
normpath = os.path.normpath(path)
|
||||
parts = normpath.split("/")
|
||||
if len(parts) > 1 and parts[1] == "scratch":
|
||||
return "/scratch/tmp"
|
||||
elif len(parts) > 2 and parts[2] == "runner":
|
||||
return f"/{parts[1]}/runner/tmp"
|
||||
return "/tmp"
|
||||
|
||||
|
||||
class NamedTemporaryDir():
|
||||
def __init__(self, temp_dir=None):
|
||||
self._path = tempfile.mkdtemp(dir=temp_dir)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._path
|
||||
|
||||
def close(self):
|
||||
shutil.rmtree(self._path)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self.close()
|
||||
|
||||
|
||||
class CallbackReader:
|
||||
@@ -22,16 +76,24 @@ class CallbackReader:
|
||||
return chunk
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def atomic_write_in_dir(path: str, mode: str = 'w', buffering: int = -1, encoding: str = None, newline: str = None,
|
||||
overwrite: bool = False):
|
||||
"""Write to a file atomically using a temporary file in the same directory as the destination file."""
|
||||
dir_name = os.path.dirname(path)
|
||||
def _get_fileobject_func(writer, temp_dir):
|
||||
def _get_fileobject():
|
||||
return writer.get_fileobject(dir=temp_dir)
|
||||
return _get_fileobject
|
||||
|
||||
if not overwrite and os.path.exists(path):
|
||||
raise FileExistsError(f"File '{path}' already exists. To overwrite it, set 'overwrite' to True.")
|
||||
def atomic_write_on_fs_tmp(path, **kwargs):
|
||||
"""Creates an atomic writer using a temporary file in a temporary directory
|
||||
on the same filesystem as path.
|
||||
"""
|
||||
# TODO(mgraczyk): This use of AtomicWriter relies on implementation details to set the temp
|
||||
# directory.
|
||||
writer = AtomicWriter(path, **kwargs)
|
||||
return writer._open(_get_fileobject_func(writer, get_tmpdir_on_same_filesystem(path)))
|
||||
|
||||
with tempfile.NamedTemporaryFile(mode=mode, buffering=buffering, encoding=encoding, newline=newline, dir=dir_name, delete=False) as tmp_file:
|
||||
yield tmp_file
|
||||
tmp_file_name = tmp_file.name
|
||||
os.replace(tmp_file_name, path)
|
||||
|
||||
def atomic_write_in_dir(path, **kwargs):
|
||||
"""Creates an atomic writer using a temporary file in the same directory
|
||||
as the destination file.
|
||||
"""
|
||||
writer = AtomicWriter(path, **kwargs)
|
||||
return writer._open(_get_fileobject_func(writer, os.path.dirname(path)))
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
from functools import cache
|
||||
import subprocess
|
||||
from openpilot.common.run import run_cmd, run_cmd_default
|
||||
|
||||
|
||||
@cache
|
||||
def get_commit(cwd: str = None, branch: str = "HEAD") -> str:
|
||||
return run_cmd_default(["git", "rev-parse", branch], cwd=cwd)
|
||||
|
||||
|
||||
@cache
|
||||
def get_commit_date(cwd: str = None, commit: str = "HEAD") -> str:
|
||||
return run_cmd_default(["git", "show", "--no-patch", "--format='%ct %ci'", commit], cwd=cwd)
|
||||
|
||||
|
||||
@cache
|
||||
def get_short_branch(cwd: str = None) -> str:
|
||||
return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "HEAD"], cwd=cwd)
|
||||
|
||||
|
||||
@cache
|
||||
def get_branch(cwd: str = None) -> str:
|
||||
return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"], cwd=cwd)
|
||||
|
||||
|
||||
@cache
|
||||
def get_origin(cwd: str = None) -> str:
|
||||
try:
|
||||
local_branch = run_cmd(["git", "name-rev", "--name-only", "HEAD"], cwd=cwd)
|
||||
tracking_remote = run_cmd(["git", "config", "branch." + local_branch + ".remote"], cwd=cwd)
|
||||
return run_cmd(["git", "config", "remote." + tracking_remote + ".url"], cwd=cwd)
|
||||
except subprocess.CalledProcessError: # Not on a branch, fallback
|
||||
return run_cmd_default(["git", "config", "--get", "remote.origin.url"], cwd=cwd)
|
||||
|
||||
|
||||
@cache
|
||||
def get_normalized_origin(cwd: str = None) -> str:
|
||||
return get_origin(cwd) \
|
||||
.replace("git@", "", 1) \
|
||||
.replace(".git", "", 1) \
|
||||
.replace("https://", "", 1) \
|
||||
.replace(":", "/", 1)
|
||||
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
from functools import cache
|
||||
from functools import lru_cache
|
||||
from typing import Optional, List
|
||||
|
||||
def gpio_init(pin: int, output: bool) -> None:
|
||||
try:
|
||||
@@ -15,7 +16,7 @@ def gpio_set(pin: int, high: bool) -> None:
|
||||
except Exception as e:
|
||||
print(f"Failed to set gpio {pin} value: {e}")
|
||||
|
||||
def gpio_read(pin: int) -> bool | None:
|
||||
def gpio_read(pin: int) -> Optional[bool]:
|
||||
val = None
|
||||
try:
|
||||
with open(f"/sys/class/gpio/gpio{pin}/value", 'rb') as f:
|
||||
@@ -35,8 +36,8 @@ def gpio_export(pin: int) -> None:
|
||||
except Exception:
|
||||
print(f"Failed to export gpio {pin}")
|
||||
|
||||
@cache
|
||||
def get_irq_action(irq: int) -> list[str]:
|
||||
@lru_cache(maxsize=None)
|
||||
def get_irq_action(irq: int) -> List[str]:
|
||||
try:
|
||||
with open(f"/sys/kernel/irq/{irq}/actions") as f:
|
||||
actions = f.read().strip().split(',')
|
||||
@@ -44,7 +45,7 @@ def get_irq_action(irq: int) -> list[str]:
|
||||
except FileNotFoundError:
|
||||
return []
|
||||
|
||||
def get_irqs_for_action(action: str) -> list[str]:
|
||||
def get_irqs_for_action(action: str) -> List[str]:
|
||||
ret = []
|
||||
with open("/proc/interrupts") as f:
|
||||
for l in f.readlines():
|
||||
|
||||
1
common/kalman/.gitignore
vendored
Normal file
1
common/kalman/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
simple_kalman_impl.c
|
||||
5
common/kalman/SConscript
Normal file
5
common/kalman/SConscript
Normal file
@@ -0,0 +1,5 @@
|
||||
Import('envCython')
|
||||
|
||||
simple_kalman_python = envCython.Program('simple_kalman_impl.so', 'simple_kalman_impl.pyx')
|
||||
|
||||
Export('simple_kalman_python')
|
||||
12
common/kalman/simple_kalman.py
Normal file
12
common/kalman/simple_kalman.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from openpilot.common.kalman.simple_kalman_impl import KF1D as KF1D
|
||||
assert KF1D
|
||||
import numpy as np
|
||||
|
||||
def get_kalman_gain(dt, A, C, Q, R, iterations=100):
|
||||
P = np.zeros_like(Q)
|
||||
for _ in range(iterations):
|
||||
P = A.dot(P).dot(A.T) + dt * Q
|
||||
S = C.dot(P).dot(C.T) + R
|
||||
K = P.dot(C.T).dot(np.linalg.inv(S))
|
||||
P = (np.eye(len(P)) - K.dot(C)).dot(P)
|
||||
return K
|
||||
18
common/kalman/simple_kalman_impl.pxd
Normal file
18
common/kalman/simple_kalman_impl.pxd
Normal file
@@ -0,0 +1,18 @@
|
||||
# cython: language_level = 3
|
||||
|
||||
cdef class KF1D:
|
||||
cdef public:
|
||||
double x0_0
|
||||
double x1_0
|
||||
double K0_0
|
||||
double K1_0
|
||||
double A0_0
|
||||
double A0_1
|
||||
double A1_0
|
||||
double A1_1
|
||||
double C0_0
|
||||
double C0_1
|
||||
double A_K_0
|
||||
double A_K_1
|
||||
double A_K_2
|
||||
double A_K_3
|
||||
37
common/kalman/simple_kalman_impl.pyx
Normal file
37
common/kalman/simple_kalman_impl.pyx
Normal file
@@ -0,0 +1,37 @@
|
||||
# distutils: language = c++
|
||||
# cython: language_level=3
|
||||
|
||||
cdef class KF1D:
|
||||
def __init__(self, x0, A, C, K):
|
||||
self.x0_0 = x0[0][0]
|
||||
self.x1_0 = x0[1][0]
|
||||
self.A0_0 = A[0][0]
|
||||
self.A0_1 = A[0][1]
|
||||
self.A1_0 = A[1][0]
|
||||
self.A1_1 = A[1][1]
|
||||
self.C0_0 = C[0]
|
||||
self.C0_1 = C[1]
|
||||
self.K0_0 = K[0][0]
|
||||
self.K1_0 = K[1][0]
|
||||
|
||||
self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0
|
||||
self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1
|
||||
self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0
|
||||
self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1
|
||||
|
||||
def update(self, meas):
|
||||
cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas
|
||||
cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas
|
||||
self.x0_0 = x0_0
|
||||
self.x1_0 = x1_0
|
||||
|
||||
return [self.x0_0, self.x1_0]
|
||||
|
||||
@property
|
||||
def x(self):
|
||||
return [[self.x0_0], [self.x1_0]]
|
||||
|
||||
@x.setter
|
||||
def x(self, x):
|
||||
self.x0_0 = x[0][0]
|
||||
self.x1_0 = x[1][0]
|
||||
23
common/kalman/simple_kalman_old.py
Normal file
23
common/kalman/simple_kalman_old.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
class KF1D:
|
||||
# this EKF assumes constant covariance matrix, so calculations are much simpler
|
||||
# the Kalman gain also needs to be precomputed using the control module
|
||||
|
||||
def __init__(self, x0, A, C, K):
|
||||
self.x = x0
|
||||
self.A = A
|
||||
self.C = np.atleast_2d(C)
|
||||
self.K = K
|
||||
|
||||
self.A_K = self.A - np.dot(self.K, self.C)
|
||||
|
||||
# K matrix needs to be pre-computed as follow:
|
||||
# import control
|
||||
# (x, l, K) = control.dare(np.transpose(self.A), np.transpose(self.C), Q, R)
|
||||
# self.K = np.transpose(K)
|
||||
|
||||
def update(self, meas):
|
||||
self.x = np.dot(self.A_K, self.x) + np.dot(self.K, meas)
|
||||
return self.x
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user