|
|
|
@ -323,7 +323,7 @@ class Controls: |
|
|
|
|
num_events = len(self.events) |
|
|
|
|
|
|
|
|
|
not_running = {p.name for p in self.sm['managerState'].processes if not p.running and p.shouldBeRunning} |
|
|
|
|
if self.sm.rcv_frame['managerState'] and (not_running - IGNORE_PROCESSES): |
|
|
|
|
if self.sm.recv_frame['managerState'] and (not_running - IGNORE_PROCESSES): |
|
|
|
|
self.events.add(EventName.processNotRunning) |
|
|
|
|
if not_running != self.not_running_prev: |
|
|
|
|
cloudlog.event("process_not_running", not_running=not_running, error=True) |
|
|
|
@ -380,7 +380,7 @@ class Controls: |
|
|
|
|
self.events.add(EventName.paramsdTemporaryError) |
|
|
|
|
|
|
|
|
|
# conservative HW alert. if the data or frequency are off, locationd will throw an error |
|
|
|
|
if any((self.sm.frame - self.sm.rcv_frame[s])*DT_CTRL > 10. for s in self.sensor_packets): |
|
|
|
|
if any((self.sm.frame - self.sm.recv_frame[s])*DT_CTRL > 10. for s in self.sensor_packets): |
|
|
|
|
self.events.add(EventName.sensorDataInvalid) |
|
|
|
|
|
|
|
|
|
if not REPLAY: |
|
|
|
@ -612,7 +612,7 @@ class Controls: |
|
|
|
|
if not self.joystick_mode: |
|
|
|
|
# accel PID loop |
|
|
|
|
pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_helper.v_cruise_kph * CV.KPH_TO_MS) |
|
|
|
|
t_since_plan = (self.sm.frame - self.sm.rcv_frame['longitudinalPlan']) * DT_CTRL |
|
|
|
|
t_since_plan = (self.sm.frame - self.sm.recv_frame['longitudinalPlan']) * DT_CTRL |
|
|
|
|
actuators.accel = self.LoC.update(CC.longActive, CS, long_plan, pid_accel_limits, t_since_plan) |
|
|
|
|
|
|
|
|
|
# Steering PID loop and lateral MPC |
|
|
|
@ -623,9 +623,9 @@ class Controls: |
|
|
|
|
self.sm['liveLocationKalman']) |
|
|
|
|
else: |
|
|
|
|
lac_log = log.ControlsState.LateralDebugState.new_message() |
|
|
|
|
if self.sm.rcv_frame['testJoystick'] > 0: |
|
|
|
|
if self.sm.recv_frame['testJoystick'] > 0: |
|
|
|
|
# reset joystick if it hasn't been received in a while |
|
|
|
|
should_reset_joystick = (self.sm.frame - self.sm.rcv_frame['testJoystick'])*DT_CTRL > 0.2 |
|
|
|
|
should_reset_joystick = (self.sm.frame - self.sm.recv_frame['testJoystick'])*DT_CTRL > 0.2 |
|
|
|
|
if not should_reset_joystick: |
|
|
|
|
joystick_axes = self.sm['testJoystick'].axes |
|
|
|
|
else: |
|
|
|
@ -700,7 +700,7 @@ class Controls: |
|
|
|
|
|
|
|
|
|
CC.cruiseControl.override = self.enabled and not CC.longActive and self.CP.openpilotLongitudinalControl |
|
|
|
|
CC.cruiseControl.cancel = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) |
|
|
|
|
if self.joystick_mode and self.sm.rcv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]: |
|
|
|
|
if self.joystick_mode and self.sm.recv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]: |
|
|
|
|
CC.cruiseControl.cancel = True |
|
|
|
|
|
|
|
|
|
speeds = self.sm['longitudinalPlan'].speeds |
|
|
|
|