mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-21 05:52:06 +08:00
Toyota: only send gas interceptor message when openpilot controls longitudinal (#23357)
* Toyota: gate enableGasInterceptor behind openpilotLongitudinalControl * fix carcontroller typo * Revert "Toyota: gate enableGasInterceptor behind openpilotLongitudinalControl" This reverts commit a974e8f8cfb4040d0fe12e285154c6fff4cb9825. * put condition in carcontroller * gate building can messages Co-authored-by: Willem Melching <willem.melching@gmail.com>
This commit is contained in:
@@ -89,7 +89,7 @@ class CarController():
|
||||
|
||||
# we can spam can to cancel the system even if we are using lat only control
|
||||
if (frame % 3 == 0 and CS.CP.openpilotLongitudinalControl) or pcm_cancel_cmd:
|
||||
lead = lead or CS.out.vEgo < 12. # at low speed we always assume the lead is present do ACC can be engaged
|
||||
lead = lead or CS.out.vEgo < 12. # at low speed we always assume the lead is present so ACC can be engaged
|
||||
|
||||
# Lexus IS uses a different cancellation message
|
||||
if pcm_cancel_cmd and CS.CP.carFingerprint in [CAR.LEXUS_IS, CAR.LEXUS_RC]:
|
||||
@@ -100,7 +100,7 @@ class CarController():
|
||||
else:
|
||||
can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type))
|
||||
|
||||
if frame % 2 == 0 and CS.CP.enableGasInterceptor:
|
||||
if frame % 2 == 0 and CS.CP.enableGasInterceptor and CS.CP.openpilotLongitudinalControl:
|
||||
# send exactly zero if gas cmd is zero. Interceptor will send the max between read value and gas cmd.
|
||||
# This prevents unexpected pedal range rescaling
|
||||
can_sends.append(create_gas_interceptor_command(self.packer, interceptor_gas_cmd, frame // 2))
|
||||
|
||||
Reference in New Issue
Block a user