Skip to content

Commit b194c81

Browse files
authored
Merge pull request #19 from BogGyver/tesla_pedal_056
Tesla 0.5.6 merge
2 parents fd6497b + 41b34e3 commit b194c81

File tree

128 files changed

+5856
-1540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+5856
-1540
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ selfdrive/test/tests/plant/out
3333

3434
one
3535

36-
.vscode/settings.json
36+
.vscode/*.json
3737
launch_chffrplus.sh
3838

README.md

+72-60
Large diffs are not rendered by default.

RELEASES.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
Version 0.5.6 (2018-11-16)
2+
========================
3+
* Refresh settings layout and add feature descriptions
4+
* In Honda, keep stock camera on for logging and extra stock features; new openpilot giraffe setting is 0111!
5+
* In Toyota, option to keep stock camera on for logging and extra stock features (e.g. AHB); 120Ohm resistor required on giraffe.
6+
* Improve camera calibration stability
7+
* More tuning to Honda positive accelerations
8+
* Reduce brake pump use on Hondas
9+
* Chevrolet Malibu support thanks to tylergets!
10+
11+
Version 0.5.5 (2018-10-20)
12+
========================
13+
* Increase allowed Honda positive accelerations
14+
* Fix sporadic unexpected braking when passing semi-trucks in Toyota
15+
* Fix gear reading bug in Hyundai Elantra thanks to emmertex!
16+
117
Version 0.5.4 (2018-09-25)
218
========================
319
* New Driving Model

apk/ai.comma.plus.frame.apk

-310 Bytes
Binary file not shown.

apk/ai.comma.plus.offroad.apk

168 KB
Binary file not shown.

cereal/car.capnp

+8-7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
7171
belowSteerSpeed @46;
7272
calibrationProgress @47;
7373
lowBattery @48;
74+
invalidGiraffeHonda @49;
7475
}
7576
}
7677

@@ -260,13 +261,13 @@ struct CarControl {
260261
# these are the choices from the Honda
261262
# map as good as you can for your car
262263
none @0;
263-
beepSingle @1;
264-
beepTriple @2;
265-
beepRepeated @3;
266-
chimeSingle @4;
267-
chimeDouble @5;
268-
chimeRepeated @6;
269-
chimeContinuous @7;
264+
chimeEngage @1;
265+
chimeDisengage @2;
266+
chimeError @3;
267+
chimeWarning1 @4;
268+
chimeWarning2 @5;
269+
chimeWarningRepeat @6;
270+
chimePrompt @7;
270271
}
271272
}
272273
}

cereal/log.capnp

+16
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ struct Live100Data {
410410
alertStatus @38 :AlertStatus;
411411
alertSize @39 :AlertSize;
412412
alertBlinkingRate @42 :Float32;
413+
alertType @44 :Text;
414+
alertSound @45 :Text;
413415
awarenessStatus @26 :Float32;
414416
angleOffset @27 :Float32;
415417
gpsPlannerActive @40 :Bool;
@@ -1558,6 +1560,18 @@ struct Boot {
15581560
lastPmsg @2 :Data;
15591561
}
15601562

1563+
struct LiveParametersData {
1564+
valid @0 :Bool;
1565+
gyroBias @1 :Float32;
1566+
angleOffset @2 :Float32;
1567+
}
1568+
1569+
struct LiveMapData {
1570+
valid @0 :Bool;
1571+
speedLimit @1 :Float32;
1572+
}
1573+
1574+
15611575
struct Event {
15621576
# in nanoseconds?
15631577
logMonoTime @0 :UInt64;
@@ -1623,5 +1637,7 @@ struct Event {
16231637
orbFeaturesSummary @58 :OrbFeaturesSummary;
16241638
driverMonitoring @59 :DriverMonitoring;
16251639
boot @60 :Boot;
1640+
liveParameters @61 :LiveParametersData;
1641+
liveMapData @62 :LiveMapData;
16261642
}
16271643
}

common/ffi_wrapper.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
TMPDIR = "/tmp/ccache"
88

9-
def ffi_wrap(name, c_code, c_header, tmpdir=TMPDIR):
9+
def ffi_wrap(name, c_code, c_header, tmpdir=TMPDIR, cflags="", libraries=[]):
1010
cache = name + "_" + hashlib.sha1(c_code).hexdigest()
1111
try:
1212
os.mkdir(tmpdir)
@@ -21,19 +21,19 @@ def ffi_wrap(name, c_code, c_header, tmpdir=TMPDIR):
2121
mod = __import__(cache)
2222
except Exception:
2323
print "cache miss", cache
24-
compile_code(cache, c_code, c_header, tmpdir)
24+
compile_code(cache, c_code, c_header, tmpdir, cflags, libraries)
2525
mod = __import__(cache)
2626
finally:
2727
os.close(fd)
2828

2929
return mod.ffi, mod.lib
3030

31-
def compile_code(name, c_code, c_header, directory):
31+
def compile_code(name, c_code, c_header, directory, cflags="", libraries=[]):
3232
ffibuilder = FFI()
33-
ffibuilder.set_source(name, c_code, source_extension='.cpp')
33+
ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
3434
ffibuilder.cdef(c_header)
3535
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11"
36-
os.environ['CFLAGS'] = ""
36+
os.environ['CFLAGS'] = cflags
3737
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
3838

3939
def wrap_compiled(name, directory):

common/transformations/model.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ def get_model_height_transform(camera_frame_from_road_frame, height):
7575
[0, 0, 1],
7676
]))
7777

78-
ground_from_camera_frame = np.linalg.inv(camera_frame_from_road_ground)
79-
80-
low_camera_from_high_camera = np.dot(camera_frame_from_road_high, ground_from_camera_frame)
81-
high_camera_from_low_camera = np.linalg.inv(low_camera_from_high_camera)
78+
road_high_from_camera_frame = np.linalg.inv(camera_frame_from_road_high)
79+
high_camera_from_low_camera = np.dot(camera_frame_from_road_ground, road_high_from_camera_frame)
8280

8381
return high_camera_from_low_camera
8482

opendbc/acura_ilx_2016_can_generated.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
293293
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
294294
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
295295

296-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
296+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
297297
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
298298
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
299299
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;

opendbc/acura_rdx_2018_can_generated.dbc

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ BO_ 660 SCM_FEEDBACK: 8 SCM
288288
CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break";
289289
VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ;
290290
VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
291+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
291292
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
292293

293294
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";

opendbc/generator/honda/_bosch_2018.dbc

+2
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,5 @@ BO_ 891 STALK_STATUS_2: 8 XXX
259259
SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX
260260
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
261261
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
262+
263+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;

opendbc/generator/honda/acura_ilx_2016_can.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
6464
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
6565
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
6666

67-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
67+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
6868
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
6969
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
7070
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;

opendbc/generator/honda/acura_rdx_2018_can.dbc

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ BO_ 660 SCM_FEEDBACK: 8 SCM
5959
CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break";
6060
VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ;
6161
VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
62+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
6263
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
6364

6465
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";

opendbc/generator/honda/honda_civic_touring_2016_can.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged";
129129
CM_ SG_ 450 EPB_STATE "3 \"engaged\" 2 \"disengaging\" 1 \"engaging\" 0 \"disengaged\"";
130130
CM_ SG_ 806 REVERSE_LIGHT "Might be reverse gear selected and not the lights";
131131

132-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
132+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
133133
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
134134
VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
135135
VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ;

opendbc/generator/honda/honda_crv_touring_2016_can.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ BO_ 891 WIPERS: 8 XXX
6464

6565
CM_ SG_ 401 GEAR "10 = reverse, 11 = transition";
6666

67-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
67+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
6868
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
6969
VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
7070
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;

opendbc/generator/honda/honda_fit_ex_2018_can.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ BO_ 884 STALK_STATUS: 8 XXX
8787
CM_ SG_ 401 GEAR "10 = reverse, 11 = transition";
8888
CM_ SG_ 420 BRAKE_HOLD_RELATED "On when Brake Hold engaged";
8989

90-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
90+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
9191
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
9292
VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
9393
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;

opendbc/generator/honda/honda_odyssey_exl_2018.dbc

+1-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
100100
CM_ SG_ 806 REVERSE_LIGHT "Might be reverse gear selected and not the lights";
101101
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnings etc...";
102102

103-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
103+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
104104
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
105105
VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ;
106106
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
@@ -110,7 +110,5 @@ VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
110110
VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
111111
VAL_ 927 ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead" ;
112112
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
113-
VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
114-
VAL_ 927 ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead" ;
115113

116114
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";

opendbc/generator/honda/honda_pilot_touring_2017_can.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ BO_ 660 SCM_FEEDBACK: 8 SCM
5858
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON
5959
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON
6060

61-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
61+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
6262
VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ;
6363
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
6464
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;

opendbc/generator/honda/honda_ridgeline_black_edition_2017_can.dbc

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ BO_ 660 SCM_FEEDBACK: 8 SCM
5353
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON
5454
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON
5555

56-
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
56+
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
5757
VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ;
5858
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
5959
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;

0 commit comments

Comments
 (0)