@@ -503,7 +503,7 @@ def state_control(self, CS):
503503 if not self .joystick_mode :
504504 # accel PID loop
505505 pid_accel_limits = self .CI .get_pid_accel_limits (self .CP , CS .vEgo , self .v_cruise_kph * CV .KPH_TO_MS )
506- actuators .accel = self .LoC .update (self .active , CS , self .CP , long_plan , pid_accel_limits )
506+ actuators .accel , stopping , starting = self .LoC .update (self .active , CS , self .CP , long_plan , pid_accel_limits )
507507
508508 # Steering PID loop and lateral MPC
509509 lat_active = self .active and not CS .steerWarning and not CS .steerError and CS .vEgo > self .CP .minSteerSpeed
@@ -513,6 +513,8 @@ def state_control(self, CS):
513513 lat_plan .curvatureRates )
514514 actuators .steer , actuators .steeringAngleDeg , lac_log = self .LaC .update (lat_active , CS , self .CP , self .VM , params , self .last_actuators ,
515515 desired_curvature , desired_curvature_rate )
516+ lac_log .saturated = starting
517+ lac_log .active = stopping
516518 else :
517519 lac_log = log .ControlsState .LateralDebugState .new_message ()
518520 if self .sm .rcv_frame ['testJoystick' ] > 0 and self .active :
@@ -537,17 +539,17 @@ def state_control(self, CS):
537539 self .saturated_count = 0
538540
539541 # Send a "steering required alert" if saturation count has reached the limit
540- if (lac_log .saturated and not CS .steeringPressed ) or \
541- (self .saturated_count > STEER_ANGLE_SATURATION_TIMEOUT ):
542-
543- if len (lat_plan .dPathPoints ):
544- # Check if we deviated from the path
545- # TODO use desired vs actual curvature
546- left_deviation = actuators .steer > 0 and lat_plan .dPathPoints [0 ] < - 0.20
547- right_deviation = actuators .steer < 0 and lat_plan .dPathPoints [0 ] > 0.20
548-
549- if left_deviation or right_deviation :
550- self .events .add (EventName .steerSaturated )
542+ # if (lac_log.saturated and not CS.steeringPressed) or \
543+ # (self.saturated_count > STEER_ANGLE_SATURATION_TIMEOUT):
544+ #
545+ # if len(lat_plan.dPathPoints):
546+ # # Check if we deviated from the path
547+ # # TODO use desired vs actual curvature
548+ # left_deviation = actuators.steer > 0 and lat_plan.dPathPoints[0] < -0.20
549+ # right_deviation = actuators.steer < 0 and lat_plan.dPathPoints[0] > 0.20
550+ #
551+ # if left_deviation or right_deviation:
552+ # self.events.add(EventName.steerSaturated)
551553
552554 # Ensure no NaNs/Infs
553555 for p in ACTUATOR_FIELDS :
0 commit comments