@@ -18,7 +18,7 @@ def __init__(self, CP):
18
18
can_define = CANDefine (DBC [CP .carFingerprint ]["pt" ])
19
19
self .shifter_values = can_define .dv ["ECMPRDNL2" ]["PRNDL2" ]
20
20
self .loopback_lka_steering_cmd_updated = False
21
- self .camera_lka_steering_cmd_counter = 0
21
+ self .pt_lka_steering_cmd_counter = 0
22
22
self .buttons_counter = 0
23
23
24
24
def update (self , pt_cp , cam_cp , loopback_cp ):
@@ -33,7 +33,7 @@ def update(self, pt_cp, cam_cp, loopback_cp):
33
33
# Variables used for avoiding LKAS faults
34
34
self .loopback_lka_steering_cmd_updated = len (loopback_cp .vl_all ["ASCMLKASteeringCmd" ]["RollingCounter" ]) > 0
35
35
if self .CP .networkLocation == NetworkLocation .fwdCamera :
36
- self .camera_lka_steering_cmd_counter = cam_cp .vl ["ASCMLKASteeringCmd" ]["RollingCounter" ]
36
+ self .pt_lka_steering_cmd_counter = pt_cp .vl ["ASCMLKASteeringCmd" ]["RollingCounter" ]
37
37
38
38
ret .wheelSpeeds = self .get_wheel_speeds (
39
39
pt_cp .vl ["EBCMWheelSpdFront" ]["FLWheelSpd" ],
@@ -113,13 +113,11 @@ def get_cam_can_parser(CP):
113
113
if CP .networkLocation == NetworkLocation .fwdCamera :
114
114
signals += [
115
115
("AEBCmdActive" , "AEBCmd" ),
116
- ("RollingCounter" , "ASCMLKASteeringCmd" ),
117
116
("ACCSpeedSetpoint" , "ASCMActiveCruiseControlStatus" ),
118
117
("ACCCruiseState" , "ASCMActiveCruiseControlStatus" ),
119
118
]
120
119
checks += [
121
120
("AEBCmd" , 10 ),
122
- ("ASCMLKASteeringCmd" , 10 ),
123
121
("ASCMActiveCruiseControlStatus" , 25 ),
124
122
]
125
123
@@ -180,6 +178,15 @@ def get_can_parser(CP):
180
178
("ECMAcceleratorPos" , 80 ),
181
179
]
182
180
181
+ # Used to read back last counter sent to PT by camera
182
+ if CP .networkLocation == NetworkLocation .fwdCamera :
183
+ signals += [
184
+ ("RollingCounter" , "ASCMLKASteeringCmd" ),
185
+ ]
186
+ checks += [
187
+ ("ASCMLKASteeringCmd" , 0 ),
188
+ ]
189
+
183
190
if CP .transmissionType == TransmissionType .direct :
184
191
signals .append (("RegenPaddle" , "EBCMRegenPaddle" ))
185
192
checks .append (("EBCMRegenPaddle" , 50 ))
0 commit comments