Skip to content

Commit

Permalink
Update to T.O.P v0.9.4 Release (NN Torque Control)
Browse files Browse the repository at this point in the history
C3 version with NN Torque Controller
Synced with openpilot master 2023.07.28 commits & Non-Inflatable Model.

T.O.P function update
.Display IP address of WIFI connection
.New Vision Turn Control
.Navigate on T.O.P

NNFF Support list (122 cars):
ACURA RDX 2020
AUDI A3 3RD GEN
AUDI Q3 2ND GEN
BUICK LACROSSE 2017
CHEVROLET BOLT EUV 2022
CHEVROLET BOLT EV NO ACC
CHEVROLET SILVERADO 1500 2020
CHEVROLET SUBURBAN PREMIER 2019
CHEVROLET VOLT PREMIER 2017
CHRYSLER PACIFICA 2018
CHRYSLER PACIFICA 2020
CHRYSLER PACIFICA HYBRID 2017
CHRYSLER PACIFICA HYBRID 2018
CHRYSLER PACIFICA HYBRID 2019
GENESIS (DH)
GENESIS G70 2018
GENESIS G80 2017
GENESIS GV60 ELECTRIC 1ST GEN
GMC ACADIA DENALI 2018
HONDA ACCORD 2018
HONDA ACCORD HYBRID 2018
HONDA CIVIC (BOSCH) 2019
HONDA CIVIC 2016
HONDA CIVIC 2022
HONDA CR-V 2017
HONDA CR-V HYBRID 2019
HONDA HRV 2019
HONDA INSIGHT 2019
HONDA ODYSSEY 2018
HONDA PILOT 2017
HONDA RIDGELINE 2017
HYUNDAI ELANTRA 2021
HYUNDAI ELANTRA HYBRID 2021
HYUNDAI IONIQ 5 2022
HYUNDAI IONIQ ELECTRIC LIMITED 2019
HYUNDAI IONIQ PHEV 2020
HYUNDAI KONA ELECTRIC 2019
HYUNDAI KONA ELECTRIC 2022
HYUNDAI KONA HYBRID 2020
HYUNDAI PALISADE 2020
HYUNDAI SANTA FE 2019
HYUNDAI SANTA FE 2022
HYUNDAI SANTA FE HYBRID 2022
HYUNDAI SANTA FE PlUG-IN HYBRID 2022
HYUNDAI SONATA 2020
HYUNDAI SONATA HYBRID 2021
HYUNDAI TUCSON 4TH GEN
HYUNDAI TUCSON HYBRID 4TH GEN
JEEP GRAND CHEROKEE 2019
JEEP GRAND CHEROKEE V6 2018
KIA CEED INTRO ED 2019
KIA EV6 2022
KIA K5 2021
KIA NIRO EV 2020
KIA NIRO HYBRID 2ND GEN
KIA NIRO HYBRID 2019
KIA SELTOS 2021
KIA SORENTO 4TH GEN
KIA SORENTO PLUG-IN HYBRID 4TH GEN
KIA SPORTAGE 5TH GEN
KIA SPORTAGE HYBRID 5TH GEN
KIA STINGER 2022
KIA STINGER GT2 2018
LEXUS ES 2019
LEXUS ES HYBRID 2019
LEXUS IS 2018
LEXUS NX 2018
LEXUS NX 2020
LEXUS NX HYBRID 2018
LEXUS RX 2016
LEXUS RX 2020
LEXUS RX HYBRID 2017
MAZDA CX-5 2022
MAZDA CX-9 2021
MAZDA CX-9
RAM 1500 5TH GEN
RAM HD 5TH GEN
SKODA KAROQ 1ST GEN
SKODA KODIAQ 1ST GEN
SKODA OCTAVIA 3RD GEN
SKODA SUPERB 3RD GEN
SUBARU ASCENT LIMITED 2019
SUBARU FORESTER 2019
SUBARU IMPREZA LIMITED 2019
SUBARU LEGACY 7TH GEN
SUBARU LEGACY 2015 - 2018
SUBARU OUTBACK 6TH GEN
TOYOTA AVALON 2016
TOYOTA AVALON 2019
TOYOTA AVALON 2022
TOYOTA AVALON HYBRID 2019
TOYOTA AVALON HYBRID 2022
TOYOTA CAMRY 2018
TOYOTA CAMRY 2021
TOYOTA CAMRY HYBRID 2018
TOYOTA CAMRY HYBRID 2021
TOYOTA C-HR 2018
TOYOTA C-HR HYBRID 2022
TOYOTA COROLLA 2017
TOYOTA COROLLA HYBRID TSS2 2019
TOYOTA COROLLA TSS2 2019
TOYOTA HIGHLANDER 2017
TOYOTA HIGHLANDER 2020
TOYOTA HIGHLANDER HYBRID 2018
TOYOTA HIGHLANDER HYBRID 2020
TOYOTA MIRAI 2021
TOYOTA PRIUS 2017
TOYOTA PRIUS TSS2 2021
TOYOTA PRIUS v 2017
TOYOTA RAV4 2017
TOYOTA RAV4 2019
TOYOTA RAV4 HYBRID 2017
TOYOTA RAV4 HYBRID 2019
TOYOTA RAV4 HYBRID 2022
TOYOTA SIENNA 2018
VOLKSWAGEN ARTEON 1ST GEN
VOLKSWAGEN ATLAS 1ST GEN
VOLKSWAGEN GOLF 7TH GEN
VOLKSWAGEN JETTA 7TH GEN
VOLKSWAGEN PASSAT 8TH GEN
VOLKSWAGEN PASSAT NMS
VOLKSWAGEN TIGUAN 2ND GEN
  • Loading branch information
CT921 committed Aug 2, 2023
1 parent 6fe480b commit 7d13198
Show file tree
Hide file tree
Showing 277 changed files with 29,985 additions and 553 deletions.
81 changes: 44 additions & 37 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ jobs:
static_analysis:
name: static analysis
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -208,6 +209,7 @@ jobs:
valgrind:
name: valgrind
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -225,6 +227,7 @@ jobs:
unit_tests:
name: unit tests
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -250,6 +253,7 @@ jobs:
$UNIT_TEST selfdrive/athena && \
$UNIT_TEST selfdrive/thermald && \
$UNIT_TEST system/hardware/tici && \
$UNIT_TEST selfdrive/mapd && \
$UNIT_TEST tools/lib/tests && \
./selfdrive/ui/tests/create_test_translations.sh && \
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
Expand All @@ -267,47 +271,48 @@ jobs:
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3

process_replay:
name: process replay
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/workflows/setup
- name: Cache test routes
id: dependency-cache
uses: actions/cache@v3
with:
path: /tmp/comma_download_cache
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
run: |
${{ env.RUN }} "CI=1 coverage run selfdrive/test/process_replay/test_processes.py -j$(nproc) && \
coverage xml"
- name: Print diff
id: print-diff
if: always()
run: cat selfdrive/test/process_replay/diff.txt
- uses: actions/upload-artifact@v2
if: always()
continue-on-error: true
with:
name: process_replay_diff.txt
path: selfdrive/test/process_replay/diff.txt
- name: Upload reference logs
if: ${{ failure() && steps.print-diff.outcome == 'success' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }}
run: |
${{ env.RUN }} "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
#process_replay:
# name: process replay
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - uses: ./.github/workflows/setup
# - name: Cache test routes
# id: dependency-cache
# uses: actions/cache@v3
# with:
# path: /tmp/comma_download_cache
# 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
# run: |
# ${{ env.RUN }} "CI=1 coverage run selfdrive/test/process_replay/test_processes.py -j$(nproc) && \
# coverage xml"
# - name: Print diff
# id: print-diff
# if: always()
# run: cat selfdrive/test/process_replay/diff.txt
# - uses: actions/upload-artifact@v2
# if: always()
# continue-on-error: true
# with:
# name: process_replay_diff.txt
# path: selfdrive/test/process_replay/diff.txt
# - name: Upload reference logs
# if: ${{ failure() && steps.print-diff.outcome == 'success' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }}
# run: |
# ${{ env.RUN }} "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
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -335,6 +340,7 @@ jobs:
test_longitudinal:
name: longitudinal
runs-on: ubuntu-20.04
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -361,6 +367,7 @@ jobs:
test_cars:
name: cars
runs-on: ubuntu-20.04
timeout-minutes: 50
strategy:
fail-fast: false
matrix:
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[submodule "panda"]
path = panda
url = ../../commaai/panda.git
url = ../../CT921/panda.git
[submodule "opendbc"]
path = opendbc
url = ../../commaai/opendbc.git
url = ../../CT921/opendbc.git
[submodule "laika_repo"]
path = laika_repo
url = ../../commaai/laika.git
[submodule "cereal"]
path = cereal
url = ../../commaai/cereal.git
url = ../../CT921/cereal.git
[submodule "rednose_repo"]
path = rednose_repo
url = ../../commaai/rednose.git
Expand Down
81 changes: 0 additions & 81 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,85 +1,4 @@
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
- --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/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(selfdrive/debug/)/'
additional_dependencies: ['flake8-no-implicit-concat']
args:
- --indent-size=2
- --enable-extensions=NIC
- --select=F,E112,E113,E304,E502,E701,E702,E703,E71,E72,E731,W191,W6
- --statistics
- -j4
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)'
args:
- -j0
- -rn
- -sn
- --rcfile=.pylintrc
- 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: 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.5.0'
hooks:
Expand Down
2 changes: 1 addition & 1 deletion cereal
35 changes: 35 additions & 0 deletions common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,41 @@ std::unordered_map<std::string, uint32_t> keys = {
{"Version", PERSISTENT},
{"VisionRadarToggle", PERSISTENT},
{"WheeledBody", PERSISTENT},

// TOP
{"CarModel", PERSISTENT},
{"dp_atl", PERSISTENT},
{"dp_jetson", PERSISTENT},
{"DrivingPersonalitiesUIWheel", PERSISTENT},
{"dynamic_lane", PERSISTENT},
{"e2e_link", PERSISTENT},
{"EnableTorqueController", PERSISTENT},
{"LateralAllowed", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION},
{"LiveTorque", PERSISTENT},
{"NudgelessLaneChange", PERSISTENT},
{"OnroadScreenOff", PERSISTENT},
{"PrimeAd", PERSISTENT},
{"ReverseAccChange", PERSISTENT},
{"TimSignals", PERSISTENT},
{"TogglesUpdated", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION},
{"topsng", PERSISTENT},
{"toyotaautolock", PERSISTENT},
{"toyotaautounlock", PERSISTENT},
{"toyota_bsm", PERSISTENT},
{"TurnVisionControl", PERSISTENT},
{"QuietDrive", PERSISTENT},

{"dp_nav", PERSISTENT},
{"dp_otisserv", PERSISTENT},
{"dp_nav_mapbox_token_pk", PERSISTENT},
{"dp_nav_mapbox_token_sk", PERSISTENT},
{"dp_nav_gmap_enable", PERSISTENT},
{"dp_nav_gmap_key", PERSISTENT},
{"dp_nav_amap_enable", PERSISTENT},
{"dp_nav_amap_key", PERSISTENT},
{"dp_nav_amap_key_2", PERSISTENT},
{"dp_gpxd", PERSISTENT},
{"dp_mapd", PERSISTENT},
};

} // namespace
Expand Down
7 changes: 7 additions & 0 deletions common/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class Params {
inline bool getBool(const std::string &key, bool block = false) {
return get(key, block) == "1";
}
inline int getInt(const std::string &key, bool block = false) {
std::string value = get(key, block);
return value.empty() ? 0 : std::stoi(value);
}
std::map<std::string, std::string> readAll();

// helpers for writing values
Expand All @@ -42,6 +46,9 @@ class Params {
inline int putBool(const std::string &key, bool val) {
return put(key.c_str(), val ? "1" : "0", 1);
}
inline int putInt(const std::string &key, int val) {
return put(key.c_str(), std::to_string(val).c_str(), std::to_string(val).size());
}

private:
std::string params_path;
Expand Down
3 changes: 2 additions & 1 deletion common/params.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from common.params_pyx import Params, ParamKeyType, UnknownKeyName, put_nonblocking, put_bool_nonblocking # pylint: disable=no-name-in-module, import-error
from common.params_pyx import Params, ParamKeyType, UnknownKeyName, put_nonblocking, put_bool_nonblocking, put_int_nonblocking # pylint: disable=no-name-in-module, import-error
assert Params
assert ParamKeyType
assert UnknownKeyName
assert put_nonblocking
assert put_bool_nonblocking
assert put_int_nonblocking

if __name__ == "__main__":
import sys
Expand Down
17 changes: 17 additions & 0 deletions common/params_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ cdef extern from "common/params.h":
c_Params(string) nogil
string get(string, bool) nogil
bool getBool(string, bool) nogil
int getInt(string, bool) nogil
int remove(string) nogil
int put(string, string) nogil
int putBool(string, bool) nogil
int putInt(string, int) nogil
bool checkKey(string) nogil
string getParamPath(string) nogil
void clearAll(ParamKeyType)
Expand Down Expand Up @@ -75,6 +77,13 @@ cdef class Params:
r = self.p.getBool(k, block)
return r

def get_int(self, key, bool block=False):
cdef string k = self.check_key(key)
cdef int r
with nogil:
r = self.p.getInt(k, block)
return r

def put(self, key, dat):
"""
Warning: This function blocks until the param is written to disk!
Expand All @@ -92,6 +101,11 @@ cdef class Params:
with nogil:
self.p.putBool(k, val)

def put_int(self, key, int val):
cdef string k = self.check_key(key)
with nogil:
self.p.putInt(k, val)

def remove(self, key):
cdef string k = self.check_key(key)
with nogil:
Expand All @@ -109,3 +123,6 @@ def put_nonblocking(key, val, d=""):

def put_bool_nonblocking(key, bool val, d=""):
threading.Thread(target=lambda: Params(d).put_bool(key, val)).start()

def put_int_nonblocking(key, int val, d=""):
threading.Thread(target=lambda: Params(d).put_int(key, val)).start()
2 changes: 1 addition & 1 deletion common/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define COMMA_VERSION "0.9.4"
#define COMMA_VERSION "0.9.4 Release - 2023.07.28"
8 changes: 8 additions & 0 deletions force_car_recognition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
filenames = ['/data/openpilot/selfdrive/car/top_tmp/HondaCars', '/data/openpilot/selfdrive/car/top_tmp/HyundaiCars', '/data/openpilot/selfdrive/car/top_tmp/SubaruCars',
'/data/openpilot/selfdrive/car/top_tmp/ToyotaCars', '/data/openpilot/selfdrive/car/top_tmp/VolkswagenCars']

with open('/data/openpilot/selfdrive/car/top_tmp/Cars', 'w') as outfile:
for names in filenames:
with open(names) as infile:
outfile.write(infile.read())
outfile.write("\n")
11 changes: 10 additions & 1 deletion launch_chffrplus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ function launch {
# write tmux scrollback to a file
tmux capture-pane -pq -S-1000 > /tmp/launch_log

python ./selfdrive/car/honda/values.py > /data/openpilot/selfdrive/car/top_tmp/HondaCars
python ./selfdrive/car/hyundai/values.py > /data/openpilot/selfdrive/car/top_tmp/HyundaiCars
python ./selfdrive/car/subaru/values.py > /data/openpilot/selfdrive/car/top_tmp/SubaruCars
python ./selfdrive/car/toyota/values.py > /data/openpilot/selfdrive/car/top_tmp/ToyotaCars
python ./selfdrive/car/volkswagen/values.py > /data/openpilot/selfdrive/car/top_tmp/VolkswagenCars

python ./force_car_recognition.py

# start manager
cd selfdrive/manager
./build.py && ./manager.py
chmod 775 custom_dep.py
./custom_dep.py && ./build.py && ./manager.py

# if broken, keep on screen error
while true; do sleep 1; done
Expand Down
Loading

0 comments on commit 7d13198

Please sign in to comment.