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

Disablelkaonblinkerv2 #228

Merged
merged 7 commits into from
Apr 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion selfdrive/car/chrysler/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def update(self, sendcan, enabled, CS, frame, actuators,
if not lkas_active:
apply_steer = 0

if CS.cstm_btns.get_button_status("lka") == 0:
if not CS.lane_departure_toggle_on:
apply_steer = 0
self.apply_steer_last = apply_steer

Expand Down
12 changes: 11 additions & 1 deletion selfdrive/car/chrysler/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, CP):
self.prev_lka_button = 0
self.lka_button = 0
self.lkMode = True

self.lane_departure_toggle_on = True
# ALCA PARAMS
self.blind_spot_on = bool(0)
# max REAL delta angle for correction vs actuator
Expand Down Expand Up @@ -180,6 +180,7 @@ def update_ui_buttons(self,id,btn_status):
if self.alcaMode == 3:
self.cstm_btns.set_button_status("alca", 0)


else:
self.cstm_btns.btns[id].btn_status = btn_status * self.cstm_btns.btns[id].btn_status
else:
Expand Down Expand Up @@ -252,3 +253,12 @@ def update(self, cp, cp_cam):
self.lkas_car_model = cp_cam.vl["LKAS_HUD"]['CAR_MODEL']
self.lkas_status_ok = cp_cam.vl["LKAS_HEARTBIT"]['LKAS_STATUS_OK']

if self.cstm_btns.get_button_status("lka") == 0:
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True

if self.alcaMode == 3 and (self.left_blinker_on or self.right_blinker_on):
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True
2 changes: 1 addition & 1 deletion selfdrive/car/gm/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \

self.apply_steer_last = apply_steer
idx = (frame / P.STEER_STEP) % 4
if CS.cstm_btns.get_button_status("lka") == 0:
if not CS.lane_departure_toggle_on:
apply_steer = 0

if self.car_fingerprint in SUPERCRUISE_CARS:
Expand Down
10 changes: 10 additions & 0 deletions selfdrive/car/gm/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ def update(self, pt_cp):
self.prev_right_blinker_on = self.right_blinker_on
self.left_blinker_on = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 1
self.right_blinker_on = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 2

if self.cstm_btns.get_button_status("lka") == 0:
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True

if self.alcaMode == 3 and (self.left_blinker_on or self.right_blinker_on):
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True

if self.car_fingerprint in SUPERCRUISE_CARS:
self.park_brake = False
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/honda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ def update(self, sendcan, enabled, CS, frame, actuators, \
apply_gas = clip(actuators.gas, 0., 1.)
apply_brake = int(clip(self.brake_last * BRAKE_MAX, 0, BRAKE_MAX - 1))
apply_steer = int(clip(-alca_steer * STEER_MAX, -STEER_MAX, STEER_MAX))
if CS.cstm_btns.get_button_status("lka") == 0:
if not CS.lane_departure_toggle_on:
apply_steer = 0
# any other cp.vl[0x18F]['STEER_STATUS'] is common and can happen during user override. sending 0 torque to avoid EPS sending error 5
lkas_active = enabled and not CS.steer_not_allowed
lkas_active = enabled and not CS.steer_not_allowed and CS.lkMode

# Send CAN commands.
can_sends = []
Expand Down
18 changes: 18 additions & 0 deletions selfdrive/car/honda/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def get_cam_can_parser(CP):

class CarState(object):
def __init__(self, CP):
self.lkMode = True
self.Angle = [0, 5, 10, 15,20,25,30,35,60,100,180,270,500]
self.Angle_Speed = [255,160,100,80,70,60,55,50,40,30,20,10,5]
self.blind_spot_on = bool(0)
Expand Down Expand Up @@ -444,7 +445,24 @@ def update(self, cp, cp_cam):
if self.read_distance_lines == 3:
self.UE.custom_alert_message(2,"Following distance set to 2.7s",200,3)
self.read_distance_lines_prev = self.read_distance_lines

# when user presses LKAS button on steering wheel
if self.cruise_setting == 1:
if cp.vl["SCM_BUTTONS"]["CRUISE_SETTING"] == 0:
if self.lkMode:
self.lkMode = False
else:
self.lkMode = True
if self.cstm_btns.get_button_status("lka") == 0:
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True

if self.alcaMode == 3 and (self.left_blinker_on or self.right_blinker_on):
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True

# Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models
# TODO: this should be ok for all cars. Verify it.
if self.CP.carFingerprint in (CAR.PILOT, CAR.PILOT_2019, CAR.RIDGELINE):
Expand Down
5 changes: 4 additions & 1 deletion selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ def update(self, cp, cp_cam):
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True

if self.alcaMode == 3 and (self.left_blinker_on or self.right_blinker_on):
self.lane_departure_toggle_on = False
else:
self.lane_departure_toggle_on = True
self.distance_toggle = cp.vl["JOEL_ID"]['ACC_DISTANCE']
if cp.vl["PCM_CRUISE_SM"]['DISTANCE_LINES'] == 2:
self.trfix = True
Expand Down