forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2,392 changed files
with
744,866 additions
and
388,107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
Checks: ' | ||
bugprone-*, | ||
-bugprone-integer-division, | ||
-bugprone-narrowing-conversions, | ||
performance-*, | ||
clang-analyzer-*, | ||
misc-*, | ||
-misc-unused-parameters, | ||
modernize-*, | ||
-modernize-avoid-c-arrays, | ||
-modernize-deprecated-headers, | ||
-modernize-use-auto, | ||
-modernize-use-using, | ||
-modernize-use-nullptr, | ||
-modernize-use-trailing-return-type, | ||
' | ||
CheckOptions: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.Xauthority | ||
.env | ||
.host/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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 libegl1-mesa gdb bash-completion | ||
RUN pip install ipython jupyter jupyterlab | ||
|
||
RUN cd /tmp && \ | ||
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ | ||
curl -L -o virtualgl.deb "https://downloads.sourceforge.net/project/virtualgl/3.1/virtualgl_3.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "openpilot devcontainer", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"postCreateCommand": ".devcontainer/container_post_create.sh", | ||
"postStartCommand": ".devcontainer/container_post_start.sh", | ||
"initializeCommand": [".devcontainer/host_setup"], | ||
"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=/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 | ||
], | ||
"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": [ | ||
"ms-python.python", | ||
"ms-vscode.cpptools", | ||
"ms-toolsai.jupyter", | ||
"guyskk.language-cython", | ||
"lharri73.dbc" | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
"type=volume,source=scons_cache,target=/tmp/scons_cache" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
:: 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
**/.git | ||
.DS_Store | ||
*.dylib | ||
*.DSYM | ||
*.d | ||
*.pyc | ||
*.pyo | ||
.*.swp | ||
.*.swo | ||
.*.un~ | ||
*.tmp | ||
*.o | ||
*.o-* | ||
*.os | ||
*.os-* | ||
*.so | ||
*.a | ||
|
||
venv/ | ||
.venv/ | ||
|
||
notebooks | ||
phone | ||
massivemap | ||
neos | ||
installer | ||
chffr/app2 | ||
chffr/backend/env | ||
selfdrive/nav | ||
selfdrive/baseui | ||
selfdrive/test/simulator2 | ||
**/cache_data | ||
xx/plus | ||
xx/community | ||
xx/projects | ||
!xx/projects/eon_testing_master | ||
!xx/projects/map3d | ||
xx/ops | ||
xx/junk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{*.py, *.pyx, *.pxd}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Bug report | ||
description: For issues with running openpilot on your comma device | ||
labels: ["bug"] | ||
body: | ||
|
||
- type: markdown | ||
attributes: | ||
value: > | ||
Before creating a **bug report**, please check the following: | ||
* If the issue likely only affects your car model or make, go back and open a **car bug report** instead. | ||
* If the issue is related to the driving or driver monitoring models, you should open a [discussion](https://github.com/commaai/openpilot/discussions/categories/model-feedback) instead. | ||
* Ensure you're running the latest openpilot release. | ||
* Ensure you're using officially supported hardware. Issues running on PCs have a different issue template. | ||
* Ensure there isn't an existing issue for your bug. If there is, leave a comment on the existing issue. | ||
* Ensure you're running stock openpilot. We cannot look into bug reports from forks. | ||
If you're unsure whether you've hit a bug, check out the #installation-help channel in the [community Discord server](https://discord.comma.ai). | ||
- type: textarea | ||
attributes: | ||
label: Describe the bug | ||
description: Also include a description of how to reproduce the bug | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: route | ||
attributes: | ||
label: Provide a route where the issue occurs | ||
description: Ensure the route is fully uploaded at https://useradmin.comma.ai. We cannot look into issues without routes, or at least a Dongle ID. | ||
placeholder: 77611a1fac303767|2020-05-11--16-37-07 | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: version | ||
attributes: | ||
label: openpilot version | ||
description: If you're not on release, provide the commit hash | ||
placeholder: 0.8.10 | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Additional info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Car bug report | ||
description: For issues with a particular car make or model | ||
labels: ["car", "bug"] | ||
body: | ||
|
||
- type: markdown | ||
attributes: | ||
value: > | ||
Before creating a **bug report**, please check the following: | ||
* Ensure you're running the latest openpilot release. | ||
* Ensure you're using officially supported hardware. Issues running on PCs have a different issue template. | ||
* Ensure there isn't an existing issue for your bug. If there is, leave a comment on the existing issue. | ||
* Ensure you're running stock openpilot. We cannot look into bug reports from forks. | ||
If you're unsure whether you've hit a bug, check out the #installation-help channel in the [community Discord server](https://discord.comma.ai). | ||
- type: textarea | ||
attributes: | ||
label: Describe the bug | ||
description: Also include a description of how to reproduce the bug | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: car | ||
attributes: | ||
label: Which car does this affect? | ||
placeholder: Toyota Prius 2017 | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: route | ||
attributes: | ||
label: Provide a route where the issue occurs | ||
description: Ensure the route is fully uploaded at https://useradmin.comma.ai | ||
placeholder: 77611a1fac303767|2020-05-11--16-37-07 | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: version | ||
attributes: | ||
label: openpilot version | ||
description: If you're not on release, provide the commit hash | ||
placeholder: 0.8.10 | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Additional info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Report model bugs | ||
url: https://github.com/commaai/openpilot/discussions/categories/model-feedback | ||
about: Provide feedback for the driving or driver monitoring models | ||
- name: Discussions | ||
url: https://github.com/commaai/openpilot/discussions | ||
about: For questions and general discussion about openpilot | ||
- name: Community Wiki | ||
url: https://github.com/commaai/openpilot/wiki | ||
about: Check out our community wiki | ||
- name: Community Discord | ||
url: https://discord.comma.ai | ||
about: Check out our community discord |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: Enhancement | ||
about: For openpilot enhancement suggestions | ||
title: '' | ||
labels: 'enhancement' | ||
assignees: '' | ||
--- | ||
|
Oops, something went wrong.