Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/tesla_alpha_6.6' into tesla_devel
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver committed Nov 14, 2019
2 parents 8a6d1dc + 559b9b3 commit e4667c1
Show file tree
Hide file tree
Showing 292 changed files with 10,110 additions and 5,037 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ openpilot
notebooks
xx

<<<<<<< HEAD
/selfdrive/tinklad/params
/selfdrive/tinklad/bb_openpilot.cfg
/selfdrive/tinklad/tinklad-cache
/selfdrive/tinklad/bb_openpilot_config.cfg
=======
.coverage*
htmlcov

>>>>>>> d4eb5a6eafdd4803d09e6f3963918216cca5a81f
4 changes: 3 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ verify_ssl = true
opencv-python= "==3.4.2.17"
PyQt5 = "*"
ipython = "*"
networkx = "*"
azure-common = "*"
azure-nspkg = "*"
azure-storage-blob = "*"
Expand Down Expand Up @@ -99,6 +100,7 @@ gast = "==0.2.2"
matplotlib = "*"
dictdiffer = "*"
aenum = "*"
coverage = "*"

[packages]
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
Expand Down Expand Up @@ -135,7 +137,7 @@ Flask = "*"
PyJWT = "*"
"Jinja2" = "*"
nose = "*"
pyflakes = "*"
flake8 = "*"
pylint = "*"
pycryptodome = "*"
pillow = "*"
Expand Down
899 changes: 500 additions & 399 deletions Pipfile.lock

Large diffs are not rendered by default.

171 changes: 86 additions & 85 deletions README.md

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
Version 0.6.6 (2019-11-05)
========================
* Volkswagen support thanks to jyoung8607!
* Toyota Corolla Hybrid with TSS 2.0 support thanks to u8511049!
* Lexus ES with TSS 2.0 support thanks to energee!
* Fix GM ignition detection and lock safety mode not required anymore
* Log panda firmware and dongle ID thanks to martinl!
* New driving model: improve path prediction and lead detection
* New driver monitoring model, 4x smaller and running on DSP
* Display an alert and don't start openpilot if panda has wrong firmware
* Fix bug preventing EON from terminating processes after a drive
* Remove support for Toyota giraffe without the 120Ohm resistor

Version 0.6.5 (2019-10-07)
========================
* NEOS update: upgrade to Python3 and new installer!
* comma Harness support!
* New driving model: lateral control has lower reliance on lanelines
* New driving model: improve path prediction
* New driver monitoring model: more accurate face and eye detection
* Redesign offroad screen to display updates and alerts
* Increase maximum allowed acceleration
Expand Down Expand Up @@ -62,7 +75,7 @@ Version 0.6 (2019-07-01)
* Panda safety code is MISRA compliant and ships with a signed version on release2
* New NEOS is 500MB smaller and has a reproducible usr/pipenv
* Lexus ES Hybrid support thanks to wocsor!
* Improve tuning for supported Toyota with TSS2
* Improve tuning for supported Toyota with TSS 2.0
* Various other stability improvements

Version 0.5.13 (2019-05-31)
Expand Down
33 changes: 28 additions & 5 deletions SAFETY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
openpilot Safety
======

openpilot is an Adaptive Cruise Control (ACC) and Lane Keeping Assist (LKA) system.
Like other ACC and LKA systems, openpilot requires the driver to be alert and to
openpilot is an Adaptive Cruise Control (ACC) and Automated Lane Centering (ALC) system.
Like other ACC and ALC systems, openpilot requires the driver to be alert and to
pay attention at all times. We repeat, **driver alertness is necessary, but not
sufficient, for openpilot to be used safely**.

Expand Down Expand Up @@ -93,7 +93,7 @@ GM/Chevrolet
commands outside these limits. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.75s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
torque exceeds 12 units in the opposite dicrection to ensure limited applied torque against the
torque exceeds 12 units in the opposite direction to ensure limited applied torque against the
driver's will.

- Brake pedal and gas pedal potentiometer signals are contained in the 0xF1 and 0x1A1 CAN messages,
Expand All @@ -116,7 +116,7 @@ Hyundai/Kia (Lateral only)
commands outside the values of -409 and 409. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.85s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
torque exceeds 50 units in the opposite dicrection to ensure limited applied torque against the
torque exceeds 50 units in the opposite direction to ensure limited applied torque against the
driver's will.

Chrysler/Jeep/Fiat (Lateral only)
Expand Down Expand Up @@ -144,8 +144,31 @@ Subaru (Lateral only)
commands outside the values of -2047 and 2047. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.41s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
torque exceeds 60 units in the opposite dicrection to ensure limited applied torque against the
torque exceeds 60 units in the opposite direction to ensure limited applied torque against the
driver's will.

Volkswagen, Audi, SEAT, Škoda (Lateral only)
------

- While the system is engaged, steer commands are subject to the same limits used by the stock system, and
additional limits required to meet Comma safety standards.

- Steering torque is controlled through the CAN message 0x126, also known as HCA_01 for Heading Control Assist.
It's limited by openpilot and Panda to a value between -250 and 250, representing 2.5 Nm of torque applied
at the steering rack. The vehicle EPS unit will fault for values outside -300 and 300.

- The vehicle EPS unit will tolerate any rate of increase or decrease, but may limit the effective rate of
change to 5.0 Nm/s. In accordance with the Comma AI safety model requirements, a rate limit is enforced by
the Panda firmware and by openpilot, so that the commanded steering torque cannot rise from 0 to maximum
faster than 1.25s. Commanded steering torque is gradually limited by the Panda firmware and by openpilot
if the driver's torque exceeds 0.8 Nm in the opposite direction to ensure limited applied torque against
the driver's will.

- Brake and gas pedal pressed signals are contained in the ESP_05 0x106 and Motor_20 0x121 CAN messages,
respectively. A rising edge of either signals triggers a disengagement and is enforced by openpilot.
The cancellation due to the rising edge of the gas pressed signal is also enforced by the Panda firmware.
Additionally, the cruise control system disengages on the rising edge of the brake pedal pressed signal,
and it's enforced by both openpilot and the Panda firmware.

**Extra note**: comma.ai strongly discourages the use of openpilot forks with safety code either missing or
not fully meeting the above requirements.
Binary file modified apk/ai.comma.plus.offroad.apk
Binary file not shown.
5 changes: 4 additions & 1 deletion cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct HealthData {
# from can health
voltage @0 :UInt32;
current @1 :UInt32;
started @2 :Bool;
ignitionLine @2 :Bool;
controlsAllowed @3 :Bool;
gasInterceptorDetected @4 :Bool;
startedSignalDetectedDeprecated @5 :Bool;
Expand All @@ -308,6 +308,8 @@ struct HealthData {
hwType @10 :HwType;
fanSpeedRpm @11 :UInt16;
usbPowerMode @12 :UsbPowerMode;
ignitionCan @13 :Bool;
safetyModel @14 :Car.CarParams.SafetyModel;

enum HwType {
unknown @0;
Expand Down Expand Up @@ -1723,6 +1725,7 @@ struct DriverMonitoring {
rightEyeProb @7 :Float32;
leftBlinkProb @8 :Float32;
rightBlinkProb @9 :Float32;
irPwr @10 :Float32;
}

struct Boot {
Expand Down
3 changes: 2 additions & 1 deletion check_code_quality.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
# Only pyflakes checks (--select=F)
flake8 --select=F $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
RESULT=$?
if [ $RESULT -eq 0 ]; then
pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
Expand Down
1 change: 0 additions & 1 deletion common/kalman/simple_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
subprocess.check_call(["make", "simple_kalman_impl.so"], cwd=kalman_dir)

from .simple_kalman_impl import KF1D as KF1D
# Silence pyflakes
assert KF1D
9 changes: 6 additions & 3 deletions common/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ class UnknownKeyName(Exception):
"LiveParameters": [TxType.PERSISTENT],
"LongitudinalControl": [TxType.PERSISTENT],
"OpenpilotEnabledToggle": [TxType.PERSISTENT],
"PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Passive": [TxType.PERSISTENT],
"RecordFront": [TxType.PERSISTENT],
"ReleaseNotes": [TxType.PERSISTENT],
"SafetyModelLock": [TxType.PERSISTENT],
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
"SpeedLimitOffset": [TxType.PERSISTENT],
"SubscriberInfo": [TxType.PERSISTENT],
Expand All @@ -90,9 +91,11 @@ class UnknownKeyName(Exception):
"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
"Version": [TxType.PERSISTENT],
"Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
}


Expand Down
Binary file modified models/driving_model.dlc
Binary file not shown.
Binary file modified models/monitoring_model.dlc
Binary file not shown.
4 changes: 4 additions & 0 deletions opendbc/generator/toyota/lexus_is_2018_pt.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ BO_ 550 BRAKE_MODULE: 8 XXX
SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX
SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX

BO_ 581 GAS_PEDAL_ALT: 5 XXX
SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX

BO_ 705 GAS_PEDAL: 8 XXX
SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX
SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX
Expand All @@ -15,6 +18,7 @@ BO_ 608 STEER_TORQUE_SENSOR: 8 XXX
SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX
SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX

BO_ 610 EPS_STATUS: 5 EPS
SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX
Expand Down
4 changes: 4 additions & 0 deletions opendbc/lexus_is_2018_pt_generated.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ BO_ 550 BRAKE_MODULE: 8 XXX
SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX
SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX

BO_ 581 GAS_PEDAL_ALT: 5 XXX
SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX

BO_ 705 GAS_PEDAL: 8 XXX
SG_ GAS_RELEASED : 3|1@0+ (1,0) [0|1] "" XXX
SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX
Expand All @@ -374,6 +377,7 @@ BO_ 608 STEER_TORQUE_SENSOR: 8 XXX
SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX
SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
SG_ STEER_ANGLE : 31|16@0- (0.0573,0) [-500|500] "" XXX

BO_ 610 EPS_STATUS: 5 EPS
SG_ IPAS_STATE : 3|4@0+ (1,0) [0|15] "" XXX
Expand Down
153 changes: 153 additions & 0 deletions opendbc/luxgen_s5_2015.dbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
VERSION ""


NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_

BS_:

BU_: XXX


BO_ 928 EPB_STATUS: 8 XXX
SG_ EPB_BRAKE : 16|1@1+ (1,0) [0|3] "" XXX

BO_ 1104 SEATBELT_STATUS: 8 XXX
SG_ DRIVER_SEAT_BELT_ONOFF : 21|1@0+ (1,0) [0|3] "" XXX

BO_ 1056 BODY_ECU_STATUS: 8 XXX
SG_ DOOR_RL_STATUS : 18|1@0+ (1,0) [0|255] "" XXX
SG_ DOOR_FL_STATUS : 13|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_FR_STATUS : 12|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_RR_STATUS : 19|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_BACK_DOOR_STATUS : 22|1@0+ (1,0) [0|1] "" XXX
SG_ LEFT_SIGNAL_STATUS : 10|1@0+ (1,0) [0|1] "" XXX
SG_ RIGHT_SIGNAL_STATUS : 9|1@0+ (1,0) [0|1] "" XXX

BO_ 832 GEAR_RPM_SPEED_STATUS: 8 XXX
SG_ TRANS_MODE : 7|5@1+ (1,0) [0|0] "" XXX
SG_ TRANS_GEAR_POS : 2|3@0+ (1,0) [0|1] "" XXX
SG_ ENGINE_RPM1 : 55|8@0+ (1,0) [0|255] "" XXX
SG_ ENGINE_TEMP : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 821 THROTTLE_STATUS: 8 XXX
SG_ CRUSE_ONOFF : 2|1@0+ (1,0) [0|1] "on/off" XXX
SG_ CRUSE_ENABLED : 4|1@0+ (1,0) [0|1] "" XXX
SG_ THROTTLE_PEDAL_POS : 32|8@1+ (1,0) [0|255] "" XXX
SG_ THROTTLE_POS : 24|8@1+ (1,0) [0|255] "" XXX
SG_ RPM : 48|8@1- (1,0) [0|65535] "" XXX

BO_ 922 STEERING_ANGLE_STATUS: 8 XXX
SG_ STEER_ANGLE_9000 : 7|16@0- (1,0) [0|65535] "" XXX

BO_ 906 WHEEL_SPEEDS: 8 XXX
SG_ SPEED_FR : 24|8@1+ (1,0) [0|255] "" XXX
SG_ ABS_UNDEF1 : 32|8@1+ (1,0) [0|255] "" XXX
SG_ SPEED_FL : 0|8@1+ (1,0) [0|255] "" XXX

BO_ 848 ABS_WHEELS_STATUS: 8 XXX
SG_ NEW_SIGNAL_1 : 23|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_2 : 31|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_3 : 7|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_4 : 15|8@0+ (1,0) [0|255] "" XXX

BO_ 1402 DASH_STATUS: 8 XXX
SG_ CAR_SPEED : 32|8@1+ (1,0) [0|255] "" XXX
SG_ DASH_INFO2 : 16|8@1+ (1,0) [0|255] "" XXX
SG_ DASH_INFO0 : 0|8@1+ (1,0) [0|255] "" XXX
SG_ DASH_INFO_2 : 15|8@0+ (1,0) [0|255] "" XXX
SG_ DASH_INFO_3 : 31|8@0+ (1,0) [0|255] "" XXX

BO_ 1306 _SPEEDX: 8 XXX
SG_ DASH_CAR_SPEED : 7|9@0+ (1,0) [0|255] "" XXX

BO_ 1296 undefined: 8 XXX

BO_ 790 ENGINE_DATA: 8 XXX
SG_ _X2 : 6|1@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_1 : 15|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_2 : 23|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_3 : 31|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_4 : 39|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_5 : 47|8@0+ (1,0) [0|255] "" XXX

BO_ 1313 undefined: 8 XXX

BO_ 1312 __trigger_every_range: 8 XXX
SG_ __SIGNAL_every_interval : 4|1@0+ (1,0) [0|1] "" XXX

BO_ 896 undefined: 8 XXX
SG_ NEW_SIGNAL_1 : 32|4@1+ (1,0) [0|15] "" XXX

BO_ 809 undefined: 8 XXX

BO_ 864 BREAK_TCS_STATUS: 8 XXX
SG_ SPEED3 : 24|8@1+ (1,0) [0|255] "" XXX
SG_ TCS_ON_FF : 45|1@0+ (1,0) [0|1] "" XXX
SG_ XXXX1 : 63|8@0+ (1,0) [0|255] "" XXX
SG_ BRAKE_PRSSED : 42|1@0+ (1,0) [0|1] "" XXX

BO_ 842 undefined: 8 XXX

BO_ 880 WHEEL_RPM_STATUS: 8 XXX
SG_ WHEEL_RL_SPEED : 23|16@0+ (1,0) [0|255] "" XXX
SG_ WHEEL_FR_SPEED : 39|16@0+ (1,0) [0|255] "" XXX
SG_ WHEEL_FL_SPEED : 55|16@0+ (1,0) [0|255] "" XXX
SG_ WHEEL_RR_SPEED : 7|16@0- (1,0) [0|255] "" XXX

BO_ 1040 CONSOLE_STATUS: 8 XXX
SG_ LEFT_SIGNAL_SWITCH : 1|1@0+ (1,0) [0|1] "" XXX
SG_ RIGHT_SIGNAL_SWITCH : 2|1@0+ (1,0) [0|1] "" XXX
SG_ HEAD_LIGHT_HANDLE_SWITCH : 3|1@0+ (1,0) [0|1] "" XXX
SG_ HID_LIGHT_SWITCH : 4|1@0+ (1,0) [0|1] "" XXX
SG_ YELLOW_WARN_TEMP_TRIGGER : 5|1@0+ (1,0) [0|1] "" XXX
SG_ HID_LIGHT_HANDLE_SWITCH : 6|1@0+ (1,0) [0|1] "" XXX
SG_ MIX_MODE : 7|1@0+ (1,0) [0|1] "" XXX
SG_ slider_rain_bar : 13|1@0+ (1,0) [0|1] "" XXX
SG_ temp_slider_rain_bar : 15|1@0+ (1,0) [0|1] "" XXX
SG_ temp_water_push : 11|1@0+ (1,0) [0|1] "" XXX

BO_ 1120 HAVC_STATUS: 8 XXX
SG_ HAVC_TEMP : 32|8@1+ (1,0) [0|255] "" XXX


CM_ SG_ 1104 DRIVER_SEAT_BELT_ONOFF "0 - on , 1 = off";
CM_ SG_ 1056 DOOR_RL_STATUS "04 - RL - open";
CM_ SG_ 1056 DOOR_FL_STATUS "28 - FL open , 38 - FR";
CM_ SG_ 1056 RIGHT_SIGNAL_STATUS "R,L shows at same time means hazard";
CM_ SG_ 832 TRANS_MODE "AT - 85 / MT - 8D";
CM_ SG_ 832 TRANS_GEAR_POS "R-7 , 0 - N";
CM_ SG_ 821 CRUSE_ONOFF "Cruse Switch";
CM_ SG_ 821 CRUSE_ENABLED "Cruse enabled";
CM_ SG_ 821 THROTTLE_PEDAL_POS "Real Pedal Pos";
CM_ SG_ 821 THROTTLE_POS "Throttle Pos for Cruse Mode";
CM_ SG_ 906 ABS_UNDEF1 "ABS force";
CM_ SG_ 906 SPEED_FL "used for car speed in dash board";
CM_ SG_ 864 TCS_ON_FF "ON = 1, OFF =0";
Loading

0 comments on commit e4667c1

Please sign in to comment.