mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 19:12:07 +08:00
GM camera ACC: hide take steering alert (#26010)
* add all signals * try to forward this PSCMStatus * fixes * see if this works * modify checksum when bit flipped * bump opendbc * so i can test without restarting * bump * bump panda * clean up * comment * also fix this * bump * bump * every 5 seconds * only send our values * fix * try sending everything again (+1 counter) * revert * revert, forward msg * forward * fix that * bump panda * bump panda * fine to not copy * after cancel, pass bus * fix * Revert "fine to not copy" This reverts commit 654ac1a7dad4f7b9b0a3de52768522fb60cc55bd. old-commit-hash: 63d552cafc6e4728cfe097e7a3f8e3f5cd98a566
This commit is contained in:
+1
-1
Submodule panda updated: 723e60cb43...54f9390ff5
@@ -117,6 +117,10 @@ class CarController:
|
||||
self.last_button_frame = self.frame
|
||||
can_sends.append(gmcan.create_buttons(self.packer_pt, CanBus.CAMERA, CS.buttons_counter, CruiseButtons.CANCEL))
|
||||
|
||||
# Silence "Take Steering" alert sent by camera, forward PSCMStatus with HandsOffSWlDetectionStatus=1
|
||||
if self.frame % 10 == 0:
|
||||
can_sends.append(gmcan.create_pscm_status(self.packer_pt, CanBus.CAMERA, CS.pscm_status))
|
||||
|
||||
# Show green icon when LKA torque is applied, and
|
||||
# alarming orange icon when approaching torque limit.
|
||||
# If not sent again, LKA icon disappears in about 5 seconds.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import copy
|
||||
from cereal import car
|
||||
from common.conversions import Conversions as CV
|
||||
from common.numpy_fast import mean
|
||||
@@ -26,6 +27,7 @@ class CarState(CarStateBase):
|
||||
self.prev_cruise_buttons = self.cruise_buttons
|
||||
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"]
|
||||
self.buttons_counter = pt_cp.vl["ASCMSteeringButton"]["RollingCounter"]
|
||||
self.pscm_status = copy.copy(pt_cp.vl["PSCMStatus"])
|
||||
|
||||
# Variables used for avoiding LKAS faults
|
||||
self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0
|
||||
@@ -147,6 +149,11 @@ class CarState(CarStateBase):
|
||||
("LKADriverAppldTrq", "PSCMStatus"),
|
||||
("LKATorqueDelivered", "PSCMStatus"),
|
||||
("LKATorqueDeliveredStatus", "PSCMStatus"),
|
||||
("HandsOffSWlDetectionStatus", "PSCMStatus"),
|
||||
("HandsOffSWDetectionMode", "PSCMStatus"),
|
||||
("LKATotalTorqueDelivered", "PSCMStatus"),
|
||||
("PSCMStatusChecksum", "PSCMStatus"),
|
||||
("RollingCounter", "PSCMStatus"),
|
||||
("TractionControlOn", "ESPStatus"),
|
||||
("ParkBrake", "VehicleIgnitionAlt"),
|
||||
("CruiseMainOn", "ECMEngineStatus"),
|
||||
|
||||
@@ -7,6 +7,12 @@ def create_buttons(packer, bus, idx, button):
|
||||
}
|
||||
return packer.make_can_msg("ASCMSteeringButton", bus, values)
|
||||
|
||||
def create_pscm_status(packer, bus, pscm_status):
|
||||
checksum_mod = int(1 - pscm_status["HandsOffSWlDetectionStatus"]) << 5
|
||||
pscm_status["HandsOffSWlDetectionStatus"] = 1
|
||||
pscm_status["PSCMStatusChecksum"] += checksum_mod
|
||||
return packer.make_can_msg("PSCMStatus", bus, pscm_status)
|
||||
|
||||
def create_steering_control(packer, bus, apply_steer, idx, lkas_active):
|
||||
|
||||
values = {
|
||||
|
||||
Reference in New Issue
Block a user