Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

071 clean #48

Merged
merged 52 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c447c78
Merge pull request #524 from ShaneSmiskol/071-clean
arne182 Jan 26, 2020
93312d6
Who knew, RAV4 min set speed = 44
arne182 Jan 27, 2020
84a5497
change set speed logic for under 45kph set speed
arne182 Jan 27, 2020
4c374c0
Upgrade Toyota fingerprints
arne182 Jan 27, 2020
9319474
Add RAV4H_TSS2, LEXUS_RX and LEXUS_ISH
arne182 Jan 27, 2020
33968e7
Fix CHR fingerprint
arne182 Jan 27, 2020
3b769e8
Upgrade Chrysler Fingerprints
arne182 Jan 27, 2020
5dfd59f
Add CAR.JEEP_CHEROKEE_2017, 2018 to interface
arne182 Jan 27, 2020
8b97b2a
Add more RAV4H_TSS2 values
arne182 Jan 27, 2020
dd9287a
Fix Syntax
arne182 Jan 27, 2020
a9885a5
Fix syntax again
arne182 Jan 27, 2020
5805340
Fix collision of CHR and Camry Hybrid
arne182 Jan 27, 2020
9fbd1b8
Update fingerprint name
arne182 Jan 27, 2020
c09f416
Will this make travis happy?
arne182 Jan 27, 2020
76d7954
Try comment out the renamed cars
arne182 Jan 27, 2020
c0d9c42
Add Corolla Hybrid 2019 support
arne182 Jan 27, 2020
3495a08
Already had support for COROLLAH_TSS2
arne182 Jan 27, 2020
e7d9371
Update Corolla_TSS2 fingerprint
arne182 Jan 28, 2020
3a6e99f
Try to correct Corolla 2020 LE misfingerprinting
arne182 Jan 28, 2020
3768f3c
Create can_compare.py
arne182 Jan 28, 2020
df2d256
Change messaging location
arne182 Jan 28, 2020
7bfeadf
make executable
Jan 28, 2020
01814fe
restore 0.6 features
arne182 Jan 28, 2020
06832a8
Update longcontrol.py
arne182 Jan 28, 2020
3ed661d
create custom event structure
arne182 Jan 28, 2020
974a0a9
new interface structure and some events
arne182 Jan 28, 2020
c99bd7b
update interface structure
arne182 Jan 28, 2020
b4f8f89
update interface structure
arne182 Jan 28, 2020
a5f895a
update interface structure
arne182 Jan 28, 2020
61227f7
update interface structure
arne182 Jan 28, 2020
9fa19d9
update interface structure
arne182 Jan 28, 2020
7dee0e6
update interface structure
arne182 Jan 28, 2020
9dcf85b
update interface structure
arne182 Jan 28, 2020
504f4c8
update interface structure
arne182 Jan 28, 2020
c4ac533
update interface structure
arne182 Jan 28, 2020
b174ce2
update plannerd with new arne_sm
arne182 Jan 28, 2020
58dba1e
update planner with new structure and add eco, sport button support
arne182 Jan 28, 2020
74ddb4d
pass enableGasInterceptor into longcontrol
arne182 Jan 28, 2020
4511512
Force comma long PID if lead car is detected
arne182 Jan 28, 2020
d255084
fix up location of ret_arne182 definitiion
arne182 Jan 28, 2020
ba4187b
remove unused import
arne182 Jan 28, 2020
e9040d6
remove unused import
arne182 Jan 28, 2020
4880ffa
removed unused import
arne182 Jan 28, 2020
600dc87
remove unused import
arne182 Jan 28, 2020
7d79ce5
remove unused import
arne182 Jan 28, 2020
bf6fe7d
remove unused import
arne182 Jan 28, 2020
eec12ef
initialise arne_sm and return events_arne182
arne182 Jan 28, 2020
98822bf
Remove unsued import
arne182 Jan 28, 2020
64a4006
Fix location of ret_arne182
arne182 Jan 28, 2020
430be85
Initialise arne_sm
arne182 Jan 28, 2020
24d7599
Needs to have square brackets
arne182 Jan 28, 2020
526c4ec
if travis make gas_button_status = 0
arne182 Jan 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions selfdrive/car/car_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def fingerprint(logcan, sendcan, has_relay):
if frame > frame_fingerprint:
# fingerprint done
car_fingerprint = candidate_cars[b][0]
elif len(candidate_cars[b]) == 2: # For the RAV4 2019 and Corolla 2020 LE Fingerprint problem
if frame > 180:
car_fingerprint = candidate_cars[b][1]

# bail if no cars left or we've been waiting for more than 2s
failed = all(len(cc) == 0 for cc in candidate_cars.values()) or frame > 200
Expand Down
9 changes: 6 additions & 3 deletions selfdrive/car/chrysler/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from cereal import car
from cereal import car, arne182
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
from selfdrive.controls.lib.vehicle_model import VehicleModel
Expand Down Expand Up @@ -59,7 +59,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False,
ret.steerRateCost = 0.7
ret.steerLimitTimer = 0.4

if candidate in (CAR.JEEP_CHEROKEE, CAR.JEEP_CHEROKEE_2019):
if candidate in (CAR.JEEP_CHEROKEE_2017, CAR.JEEP_CHEROKEE_2018, CAR.JEEP_CHEROKEE_2019):
ret.wheelbase = 2.91 # in meters
ret.steerRatio = 12.7
ret.steerActuatorDelay = 0.2 # in seconds
Expand Down Expand Up @@ -117,6 +117,7 @@ def update(self, c, can_strings):

# create message
ret = car.CarState.new_message()
ret_arne182 = arne182.CarStateArne182.new_message()

ret.canValid = self.cp.can_valid and self.cp_cam.can_valid

Expand Down Expand Up @@ -187,6 +188,7 @@ def update(self, c, can_strings):

# events
events = []
eventsArne182 = []
if not (ret.gearShifter in (GearShifter.drive, GearShifter.low)):
events.append(create_event('wrongGear', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
if ret.doorOpen:
Expand Down Expand Up @@ -216,12 +218,13 @@ def update(self, c, can_strings):
events.append(create_event('belowSteerSpeed', [ET.WARNING]))

ret.events = events
ret_arne182.events = eventsArne182

self.gas_pressed_prev = ret.gasPressed
self.brake_pressed_prev = ret.brakePressed
self.cruise_enabled_prev = ret.cruiseState.enabled

return ret.as_reader()
return ret.as_reader(), ret_arne182.as_reader()

# pass in a car.CarControl
# to be called @ 100hz
Expand Down
52 changes: 25 additions & 27 deletions selfdrive/car/chrysler/values.py

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions selfdrive/car/ford/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from cereal import car
from cereal import car, arne182
from selfdrive.swaglog import cloudlog
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
Expand Down Expand Up @@ -110,6 +110,7 @@ def update(self, c, can_strings):

# create message
ret = car.CarState.new_message()
ret_arne182 = arne182.CarStateArne182.new_message()

ret.canValid = self.cp.can_valid

Expand Down Expand Up @@ -140,6 +141,7 @@ def update(self, c, can_strings):

# events
events = []
eventsArne182 = []

if self.CS.steer_error:
events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
Expand All @@ -162,12 +164,13 @@ def update(self, c, can_strings):
events.append(create_event('steerTempUnavailableMute', [ET.WARNING]))

ret.events = events
ret_arne182.events = eventsArne182

self.gas_pressed_prev = ret.gasPressed
self.brake_pressed_prev = ret.brakePressed
self.cruise_enabled_prev = ret.cruiseState.enabled

return ret.as_reader()
return ret.as_reader(), ret_arne182.as_reader()

# pass in a car.CarControl
# to be called @ 100hz
Expand Down
7 changes: 5 additions & 2 deletions selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from cereal import car
from cereal import car, arne182
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
Expand Down Expand Up @@ -179,6 +179,7 @@ def update(self, c, can_strings):

# create message
ret = car.CarState.new_message()
ret_arne182 = arne182.CarStateArne182.new_message()

ret.canValid = self.pt_cp.can_valid

Expand Down Expand Up @@ -260,6 +261,7 @@ def update(self, c, can_strings):
ret.buttonEvents = buttonEvents

events = []
eventsArne182 = []
if self.CS.steer_error:
events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
if self.CS.steer_not_allowed:
Expand Down Expand Up @@ -311,14 +313,15 @@ def update(self, c, can_strings):
events.append(create_event('buttonCancel', [ET.USER_DISABLE]))

ret.events = events
ret_arne182.events = eventsArne182

# update previous brake/gas pressed
self.acc_active_prev = self.CS.acc_active
self.gas_pressed_prev = ret.gasPressed
self.brake_pressed_prev = ret.brakePressed

# cast to reader so it can't be modified
return ret.as_reader()
return ret.as_reader(), ret_arne182.as_reader()

# pass in a car.CarControl
# to be called @ 100hz
Expand Down
8 changes: 5 additions & 3 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
import numpy as np
from cereal import car
from cereal import car, arne182
from common.numpy_fast import clip, interp
from common.realtime import DT_CTRL
from selfdrive.swaglog import cloudlog
Expand Down Expand Up @@ -384,6 +384,7 @@ def update(self, c, can_strings):

# create message
ret = car.CarState.new_message()
ret_arne182 = arne182.CarStateArne182.new_message()

ret.canValid = self.cp.can_valid and self.cp_cam.can_valid

Expand Down Expand Up @@ -490,6 +491,7 @@ def update(self, c, can_strings):

# events
events = []
eventsArne182 = []
if self.CS.steer_error:
events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
elif self.CS.steer_warning:
Expand Down Expand Up @@ -562,15 +564,15 @@ def update(self, c, can_strings):
self.last_enable_sent = cur_time
elif enable_pressed:
events.append(create_event('buttonEnable', [ET.ENABLE]))

ret_arne182.events = eventsArne182
ret.events = events

# update previous brake/gas pressed
self.gas_pressed_prev = ret.gasPressed
self.brake_pressed_prev = ret.brakePressed

# cast to reader so it can't be modified
return ret.as_reader()
return ret.as_reader(), ret_arne182.as_reader()

# pass in a car.CarControl
# to be called @ 100hz
Expand Down
11 changes: 7 additions & 4 deletions selfdrive/car/hyundai/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from cereal import car
from cereal import car, arne182
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
from selfdrive.controls.lib.vehicle_model import VehicleModel
Expand Down Expand Up @@ -157,7 +157,8 @@ def update(self, c, can_strings):
self.CS.update(self.cp, self.cp_cam)
# create message
ret = car.CarState.new_message()

ret_arne182 = arne182.CarStateArne182.new_message()

ret.canValid = self.cp.can_valid and self.cp_cam.can_valid

# speeds
Expand Down Expand Up @@ -233,6 +234,7 @@ def update(self, c, can_strings):
self.low_speed_alert = False

events = []
eventsArne182 = []
if not ret.gearShifter == GearShifter.drive:
events.append(create_event('wrongGear', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
if ret.doorOpen:
Expand Down Expand Up @@ -265,12 +267,13 @@ def update(self, c, can_strings):
events.append(create_event('belowSteerSpeed', [ET.WARNING]))

ret.events = events

ret_arne182.events = eventsArne182

self.gas_pressed_prev = ret.gasPressed
self.brake_pressed_prev = ret.brakePressed
self.cruise_enabled_prev = ret.cruiseState.enabled

return ret.as_reader()
return ret.as_reader(), ret_arne182.as_reader()

def apply(self, c):

Expand Down
10 changes: 6 additions & 4 deletions selfdrive/car/mock/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from cereal import car
from cereal import car, arne182
from selfdrive.config import Conversions as CV
from selfdrive.swaglog import cloudlog
import cereal.messaging as messaging
Expand Down Expand Up @@ -37,7 +37,7 @@ def compute_gb(accel, speed):
def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, car_fw=[]):

ret = car.CarParams.new_message()

ret.carName = "mock"
ret.carFingerprint = candidate

Expand Down Expand Up @@ -88,6 +88,7 @@ def update(self, c, can_strings):

# create message
ret = car.CarState.new_message()
ret_arne182 = arne182.CarStateArne182.new_message()

# speeds
ret.vEgo = self.speed
Expand All @@ -108,9 +109,10 @@ def update(self, c, can_strings):
ret.steeringAngle = curvature * self.CP.steerRatio * self.CP.wheelbase * CV.RAD_TO_DEG

events = []
eventsArne182 = []
ret.events = events

return ret.as_reader()
ret_arne182.events = eventsArne182
return ret.as_reader(), ret_arne182.as_reader()

def apply(self, c):
# in mock no carcontrols
Expand Down
10 changes: 6 additions & 4 deletions selfdrive/car/subaru/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from cereal import car
from cereal import car, arne182
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
Expand Down Expand Up @@ -102,7 +102,8 @@ def update(self, c, can_strings):

# create message
ret = car.CarState.new_message()

ret_arne182 = arne182.CarStateArne182.new_message()

ret.canValid = self.pt_cp.can_valid and self.cam_cp.can_valid

# speeds
Expand Down Expand Up @@ -160,6 +161,7 @@ def update(self, c, can_strings):


events = []
eventsArne182 = []
if ret.seatbeltUnlatched:
events.append(create_event('seatbeltNotLatched', [ET.NO_ENTRY, ET.SOFT_DISABLE]))

Expand All @@ -179,13 +181,13 @@ def update(self, c, can_strings):
events.append(create_event('pedalPressed', [ET.PRE_ENABLE]))

ret.events = events

ret_arne182.events = eventsArne182
# update previous brake/gas pressed
self.gas_pressed_prev = ret.gasPressed
self.acc_active_prev = self.CS.acc_active

# cast to reader so it can't be modified
return ret.as_reader()
return ret.as_reader(), ret_arne182.as_reader()

def apply(self, c):
can_sends = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
Expand Down
8 changes: 5 additions & 3 deletions selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def __init__(self, CP):
self.left_blinker_on = 0
self.right_blinker_on = 0
self.angle_offset = 0.
self.pcm_acc_status = False
self.init_angle_offset = False
self.v_cruise_pcmlast = 41.0
self.setspeedoffset = 34.0
Expand Down Expand Up @@ -228,7 +229,6 @@ def update(self, cp, cp_cam):
self.steer_torque_motor = cp.vl["STEER_TORQUE_SENSOR"]['STEER_TORQUE_EPS']
# we could use the override bit from dbc, but it's triggered at too high torque values
self.steer_override = abs(self.steer_torque_driver) > STEER_THRESHOLD
self.pcm_acc_status = cp.vl["PCM_CRUISE"]['CRUISE_STATE']

self.user_brake = 0
if self.CP.carFingerprint == CAR.LEXUS_IS:
Expand All @@ -239,10 +239,12 @@ def update(self, cp, cp_cam):
self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]['LOW_SPEED_LOCKOUT'] == 2
if self.CP.carFingerprint in TSS2_CAR:
minimum_set_speed = 27.0
elif self.CP.carFingerprint == CAR.RAV4:
minimum_set_speed = 44.0
else:
minimum_set_speed = 41.0
if cp.vl["PCM_CRUISE"]['CRUISE_STATE'] and not self.pcm_acc_status:
if self.v_ego < 11.38:
if self.v_ego < 12.5:
self.setspeedoffset = max(min(int(minimum_set_speed-self.v_ego*3.6),(minimum_set_speed-7.0)),0.0)
self.v_cruise_pcmlast = self.v_cruise_pcm
else:
Expand Down Expand Up @@ -272,7 +274,7 @@ def update(self, cp, cp_cam):

self.v_cruise_pcm = min(max(7, int(self.v_cruise_pcm) - self.setspeedoffset),169)


self.pcm_acc_status = cp.vl["PCM_CRUISE"]['CRUISE_STATE']
self.pcm_acc_active = bool(cp.vl["PCM_CRUISE"]['CRUISE_ACTIVE'])
self.brake_lights = bool(cp.vl["ESP_CONTROL"]['BRAKE_LIGHTS_ACC'] or self.brake_pressed)
if self.CP.carFingerprint == CAR.PRIUS:
Expand Down
Loading