Skip to content

Commit

Permalink
Revert "is this what I think it is?"
Browse files Browse the repository at this point in the history
This reverts commit acac587.
  • Loading branch information
cydia2020 committed Mar 12, 2024
1 parent cc22e8d commit 7ef9e74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions selfdrive/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,17 @@ def update(self, CC, CS):

# Send ACC_CONTROL_SAFE if RADAR Interceptor is detected, else send 0x343
acc_msg = 'ACC_CONTROL_SAFE' if self.CP.carFingerprint in RADAR_ACC_CAR_TSS1 else 'ACC_CONTROL'
slow_brake_release = 1 if CS.out.vEgo < 4. and actuators.accel > 1e-3 else 0.
# Handle raw acceleration, prevent vehicle creeping when coming to a stop
# send compensated when lead visible, send -2.5 when stopping, else send actuators.accel
at_raw = -2.5 if stopping or (CS.out.vEgo < 0.5 and lead_vehicle_stopped) else pcm_accel_cmd if hud_control.leadVisible else actuators.accel
# Lexus IS uses a different cancellation message
if pcm_cancel_cmd and self.CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC):
can_sends.append(create_acc_cancel_command(self.packer))
elif self.CP.openpilotLongitudinalControl:
can_sends.append(create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, slow_brake_release,
CS.acc_type, adjust_distance, fcw_alert, lead_vehicle_stopped, at_raw, acc_msg))
can_sends.append(create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, CS.acc_type, adjust_distance, fcw_alert, lead_vehicle_stopped, at_raw, acc_msg))
self.accel = pcm_accel_cmd
else:
can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, False, CS.acc_type, adjust_distance, False, False, 0, acc_msg))
can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type, adjust_distance, False, False, 0, acc_msg))

if self.frame % 2 == 0 and self.CP.enableGasInterceptor:
# send exactly zero if gas cmd is zero. Interceptor will send the max between read value and gas cmd.
Expand Down
3 changes: 1 addition & 2 deletions selfdrive/car/toyota/toyotacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create_lta_steer_command(packer, steer, steer_req, raw_cnt):
return packer.make_can_msg("STEERING_LTA", 0, values)


def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, slow_brake_release, acc_type, distance_button, fcw_alert, lead_vehicle_stopped, at_raw, msg='ACC_CONTROL'):
def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_type, distance_button, fcw_alert, lead_vehicle_stopped, at_raw, msg='ACC_CONTROL'):
# TODO: find the exact canceling bit that does not create a chime
values = {
"ACCEL_CMD": accel,
Expand All @@ -42,7 +42,6 @@ def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, slow_b
"ACC_CUT_IN": fcw_alert,
"ACCEL_CMD_ALT": at_raw,
"LEAD_STANDSTILL": lead_vehicle_stopped,
"SLOW_BRAKE_RELEASE": slow_brake_release,
}
return packer.make_can_msg(msg, 0, values)

Expand Down

0 comments on commit 7ef9e74

Please sign in to comment.