Skip to content

Commit

Permalink
openpilot v0.5.6 release
Browse files Browse the repository at this point in the history
old-commit-hash: 860a487
  • Loading branch information
Vehicle Researcher committed Nov 17, 2018
1 parent 29685c9 commit fdbf213
Show file tree
Hide file tree
Showing 55 changed files with 1,684 additions and 1,110 deletions.
131 changes: 70 additions & 61 deletions README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Version 0.5.6 (2018-11-16)
========================
* Refresh settings layout and add feature descriptions
* In Honda, keep stock camera on for logging and extra stock features; new openpilot giraffe setting is 0111!
* In Toyota, option to keep stock camera on for logging and extra stock features (e.g. AHB); 120Ohm resistor required on giraffe.
* Improve camera calibration stability
* More tuning to Honda positive accelerations
* Reduce brake pump use on Hondas
* Chevrolet Malibu support thanks to tylergets!

Version 0.5.5 (2018-10-20)
========================
* Increase allowed Honda positive accelerations
Expand Down
4 changes: 2 additions & 2 deletions apk/ai.comma.plus.frame.apk
Git LFS file not shown
4 changes: 2 additions & 2 deletions apk/ai.comma.plus.offroad.apk
Git LFS file not shown
15 changes: 8 additions & 7 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
belowSteerSpeed @46;
calibrationProgress @47;
lowBattery @48;
invalidGiraffeHonda @49;
}
}

Expand Down Expand Up @@ -260,13 +261,13 @@ struct CarControl {
# these are the choices from the Honda
# map as good as you can for your car
none @0;
beepSingle @1;
beepTriple @2;
beepRepeated @3;
chimeSingle @4;
chimeDouble @5;
chimeRepeated @6;
chimeContinuous @7;
chimeEngage @1;
chimeDisengage @2;
chimeError @3;
chimeWarning1 @4;
chimeWarning2 @5;
chimeWarningRepeat @6;
chimePrompt @7;
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ struct Live100Data {
alertSize @39 :AlertSize;
alertBlinkingRate @42 :Float32;
alertType @44 :Text;
alertSound @45 :Text;
awarenessStatus @26 :Float32;
angleOffset @27 :Float32;
gpsPlannerActive @40 :Bool;
Expand Down Expand Up @@ -1565,6 +1566,11 @@ struct LiveParametersData {
angleOffset @2 :Float32;
}

struct LiveMapData {
valid @0 :Bool;
speedLimit @1 :Float32;
}


struct Event {
# in nanoseconds?
Expand Down Expand Up @@ -1632,5 +1638,6 @@ struct Event {
driverMonitoring @59 :DriverMonitoring;
boot @60 :Boot;
liveParameters @61 :LiveParametersData;
liveMapData @62 :LiveMapData;
}
}
3 changes: 3 additions & 0 deletions selfdrive/assets/sounds/disengaged.wav
Git LFS file not shown
3 changes: 3 additions & 0 deletions selfdrive/assets/sounds/engaged.wav
Git LFS file not shown
3 changes: 3 additions & 0 deletions selfdrive/assets/sounds/error.wav
Git LFS file not shown
3 changes: 0 additions & 3 deletions selfdrive/assets/sounds/hq_disengaged.mp3

This file was deleted.

3 changes: 0 additions & 3 deletions selfdrive/assets/sounds/hq_engaged.mp3

This file was deleted.

3 changes: 0 additions & 3 deletions selfdrive/assets/sounds/hq_warning_0.mp3

This file was deleted.

3 changes: 0 additions & 3 deletions selfdrive/assets/sounds/hq_warning_1.mp3

This file was deleted.

3 changes: 0 additions & 3 deletions selfdrive/assets/sounds/hq_warning_2.mp3

This file was deleted.

3 changes: 3 additions & 0 deletions selfdrive/assets/sounds/warning_1.wav
Git LFS file not shown
3 changes: 3 additions & 0 deletions selfdrive/assets/sounds/warning_2.wav
Git LFS file not shown
6 changes: 4 additions & 2 deletions selfdrive/boardd/boardd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python

# TODO: merge the extra functionalities of this file (like MOCK) in boardd.c and
# delete this python version of boardd

import os
import struct
import zmq
Expand All @@ -16,8 +20,6 @@
except Exception:
pass

# TODO: rewrite in C to save CPU

SAFETY_NOOUTPUT = 0
SAFETY_HONDA = 1
SAFETY_TOYOTA = 2
Expand Down
6 changes: 3 additions & 3 deletions selfdrive/car/gm/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class CarControllerParams():
def __init__(self, car_fingerprint):
if car_fingerprint == CAR.VOLT:
if car_fingerprint in (CAR.VOLT, CAR.MALIBU):
self.STEER_MAX = 300
self.STEER_STEP = 2 # how often we update the steer cmd
self.STEER_DELTA_UP = 7 # ~0.75s time to peak torque (255/50hz/0.75s)
Expand Down Expand Up @@ -104,7 +104,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \
self.apply_steer_last = apply_steer
idx = (frame / P.STEER_STEP) % 4

if self.car_fingerprint == CAR.VOLT:
if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU):
can_sends.append(gmcan.create_steering_control(self.packer_pt,
canbus.powertrain, apply_steer, idx, lkas_enabled))
if self.car_fingerprint == CAR.CADILLAC_CT6:
Expand All @@ -113,7 +113,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \

### GAS/BRAKE ###

if self.car_fingerprint == CAR.VOLT:
if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU):
# no output if not enabled, but keep sending keepalive messages
# treat pedals as one
final_pedal = actuators.gas - actuators.brake
Expand Down
7 changes: 3 additions & 4 deletions selfdrive/car/gm/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_powertrain_can_parser(CP, canbus):
("LKATorqueDeliveredStatus", "PSCMStatus", 0),
]

if CP.carFingerprint == CAR.VOLT:
if CP.carFingerprint in (CAR.VOLT, CAR.MALIBU):
signals += [
("RegenPaddle", "EBCMRegenPaddle", 0),
("TractionControlOn", "ESPStatus", 0),
Expand Down Expand Up @@ -117,14 +117,14 @@ def update(self, pt_cp):
self.left_blinker_on = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 1
self.right_blinker_on = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 2

if self.car_fingerprint == CAR.VOLT:
if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU):
self.park_brake = pt_cp.vl["EPBStatus"]['EPBClosed']
self.main_on = pt_cp.vl["ECMEngineStatus"]['CruiseMainOn']
self.acc_active = False
self.esp_disabled = pt_cp.vl["ESPStatus"]['TractionControlOn'] != 1
self.regen_pressed = bool(pt_cp.vl["EBCMRegenPaddle"]['RegenPaddle'])
self.pcm_acc_status = pt_cp.vl["AcceleratorPedal2"]['CruiseState']
else:
else:
self.park_brake = False
self.main_on = False
self.acc_active = pt_cp.vl["ASCMActiveCruiseControlStatus"]['ACCCmdActive']
Expand All @@ -141,4 +141,3 @@ def update(self, pt_cp):
self.brake_pressed = self.user_brake > 10 or self.regen_pressed

self.gear_shifter_valid = self.gear_shifter == car.CarState.GearShifter.drive

24 changes: 13 additions & 11 deletions selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET
from selfdrive.controls.lib.vehicle_model import VehicleModel
from selfdrive.car.gm.values import DBC, CAR, STOCK_CONTROL_MSGS
from selfdrive.car.gm.values import DBC, CAR, STOCK_CONTROL_MSGS, AUDIO_HUD
from selfdrive.car.gm.carstate import CarState, CruiseButtons, get_powertrain_can_parser

try:
Expand Down Expand Up @@ -85,6 +85,16 @@ def get_params(candidate, fingerprint):
ret.steerRatioRear = 0.
ret.centerToFront = ret.wheelbase * 0.4 # wild guess

elif candidate == CAR.MALIBU:
# supports stop and go, but initial engage must be above 18mph (which include conservatism)
ret.minEnableSpeed = 18 * CV.MPH_TO_MS
ret.mass = 1496 + std_cargo
ret.safetyModel = car.CarParams.SafetyModels.gm
ret.wheelbase = 2.83
ret.steerRatio = 15.8
ret.steerRatioRear = 0.
ret.centerToFront = ret.wheelbase * 0.4 # wild guess

elif candidate == CAR.CADILLAC_CT6:
# engage speed is decided by pcm
ret.minEnableSpeed = -1
Expand Down Expand Up @@ -254,7 +264,7 @@ def update(self, c):
if ret.seatbeltUnlatched:
events.append(create_event('seatbeltNotLatched', [ET.NO_ENTRY, ET.SOFT_DISABLE]))

if self.CS.car_fingerprint == CAR.VOLT:
if self.CS.car_fingerprint in (CAR.VOLT, CAR.MALIBU):

if self.CS.brake_error:
events.append(create_event('brakeUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
Expand Down Expand Up @@ -312,15 +322,7 @@ def apply(self, c, perception_state=log.Live20Data.new_message()):
if hud_v_cruise > 70:
hud_v_cruise = 0

chime, chime_count = {
"none": (0, 0),
"beepSingle": (CM.HIGH_CHIME, 1),
"beepTriple": (CM.HIGH_CHIME, 3),
"beepRepeated": (CM.LOW_CHIME, -1),
"chimeSingle": (CM.LOW_CHIME, 1),
"chimeDouble": (CM.LOW_CHIME, 2),
"chimeRepeated": (CM.LOW_CHIME, -1),
"chimeContinuous": (CM.LOW_CHIME, -1)}[str(c.hudControl.audibleAlert)]
chime, chime_count = AUDIO_HUD[c.hudControl.audibleAlert.raw]

# For Openpilot, "enabled" includes pre-enable.
# In GM, PCM faults out if ACC command overlaps user gas.
Expand Down
4 changes: 1 addition & 3 deletions selfdrive/car/gm/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def create_radard_can_parser(canbus, car_fingerprint):

dbc_f = DBC[car_fingerprint]['radar']
if car_fingerprint == CAR.VOLT:
if car_fingerprint in (CAR.VOLT, CAR.MALIBU):
# C1A-ARS3-A by Continental
radar_targets = range(SLOT_1_MSG, SLOT_1_MSG + NUM_SLOTS)
signals = zip(['FLRRNumValidTargets',
Expand Down Expand Up @@ -125,5 +125,3 @@ def update(self):
ret = RI.update()
print(chr(27) + "[2J")
print ret


31 changes: 30 additions & 1 deletion selfdrive/car/gm/values.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from cereal import car
from selfdrive.car import dbc_dict

AudibleAlert = car.CarControl.HUDControl.AudibleAlert

class CAR:
VOLT = "CHEVROLET VOLT PREMIER 2017"
CADILLAC_CT6 = "CADILLAC CT6 SUPERCRUISE 2018"
MALIBU = "CHEVROLET MALIBU PREMIER 2017"

class CruiseButtons:
UNPRESS = 1
Expand All @@ -12,9 +15,28 @@ class CruiseButtons:
MAIN = 5
CANCEL = 6

# Car chimes, beeps, blinker sounds etc
class CM:
TOCK = 0x81
TICK = 0x82
LOW_BEEP = 0x84
HIGH_BEEP = 0x85
LOW_CHIME = 0x86
HIGH_CHIME = 0x87

AUDIO_HUD = {
AudibleAlert.none: (0, 0),
AudibleAlert.chimeEngage: (CM.HIGH_CHIME, 1),
AudibleAlert.chimeDisengage: (CM.HIGH_CHIME, 1),
AudibleAlert.chimeError: (CM.LOW_CHIME, 2),
AudibleAlert.chimePrompt: (CM.LOW_CHIME, 1),
AudibleAlert.chimeWarning1: (CM.LOW_CHIME, 2),
AudibleAlert.chimeWarning2: (CM.LOW_CHIME, -1),
AudibleAlert.chimeWarningRepeat: (CM.LOW_CHIME, -1)}

def is_eps_status_ok(eps_status, car_fingerprint):
valid_eps_status = []
if car_fingerprint == CAR.VOLT:
if car_fingerprint in (CAR.VOLT, CAR.MALIBU):
valid_eps_status += [0, 1]
elif car_fingerprint == CAR.CADILLAC_CT6:
valid_eps_status += [0, 1, 4, 5, 6]
Expand Down Expand Up @@ -45,16 +67,23 @@ def parse_gear_shifter(can_gear):
CAR.CADILLAC_CT6: [{
190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 313: 8, 320: 3, 322: 7, 328: 1, 336: 1, 338: 6, 340: 6, 352: 5, 354: 5, 356: 8, 368: 3, 372: 5, 381: 8, 386: 8, 393: 7, 398: 8, 407: 7, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 455: 7, 456: 8, 458: 5, 460: 5, 462: 4, 463: 3, 479: 3, 481: 7, 485: 8, 487: 8, 489: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 528: 5, 532: 6, 534: 2, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 569: 3, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 719: 5, 723: 2, 753: 5, 761: 7, 800: 6, 801: 8, 804: 3, 810: 8, 832: 8, 833: 8, 834: 8, 835: 6, 836: 5, 837: 8, 838: 8, 839: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 884: 8, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1011: 6, 1013: 1, 1017: 8, 1019: 2, 1020: 8, 1105: 6, 1217: 8, 1221: 5, 1223: 3, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1914: 7, 1918: 7, 1919: 7, 1934: 7, 2016: 8, 2024: 8
}],
CAR.MALIBU: [
# Malibu Premier w/ ACC 2017
{
190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 388: 8, 393: 7, 398: 8, 407: 7, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 455: 7, 456: 8, 479: 3, 481: 7, 485: 8, 487: 8, 489: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 528: 5, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1013: 3, 1017: 8, 1019: 2, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1223: 2, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1919: 7, 1930: 7, 2016: 8, 2024: 8,
}],
}

STEER_THRESHOLD = 1.0

STOCK_CONTROL_MSGS = {
CAR.VOLT: [384, 715], # 384 = "ASCMLKASteeringCmd", 715 = "ASCMGasRegenCmd"
CAR.MALIBU: [384, 715], # 384 = "ASCMLKASteeringCmd", 715 = "ASCMGasRegenCmd"
CAR.CADILLAC_CT6: [], # Cadillac does not require ASCMs to be disconnected
}

DBC = {
CAR.VOLT: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
CAR.MALIBU: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
CAR.CADILLAC_CT6: dbc_dict('cadillac_ct6_powertrain', 'cadillac_ct6_object', chassis_dbc='cadillac_ct6_chassis'),
}
Loading

0 comments on commit fdbf213

Please sign in to comment.