arizona mode

This commit is contained in:
rav4kumar
2026-07-31 13:55:17 -07:00
parent 5cd2634643
commit 53cba4d505
8 changed files with 13 additions and 10 deletions
@@ -2,7 +2,7 @@ import math
import numpy as np
from cereal import custom
from openpilot.cereal import custom
AccelProfile = custom.LongitudinalPlanSP.AccelController.Profile
@@ -10,7 +10,7 @@ from typing import NamedTuple
import numpy as np
from cereal import log
from openpilot.cereal import log
from openpilot.selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import (
LongitudinalMpc, LongitudinalPlanSource, STOP_DISTANCE, T_IDXS, get_T_FOLLOW, get_stopped_equivalence_factor,
)
@@ -3,7 +3,7 @@ from statistics import median
import numpy as np
from cereal import custom
from openpilot.cereal import custom
from openpilot.sunnypilot.selfdrive.controls.lib.accel_controller.constants import (
CAP_FILTER_FRAMES, DEPARTURE_MOTION_NOISE_FLOOR, DEPARTURE_MOTION_STEP_MIN, SPEED_RELIEF_DEADBAND, STOP_HOLD_CREEP_DISTANCE,
STOP_HOLD_CREEP_SPEED, STOP_HOLD_EXIT_FRAMES,
@@ -4,7 +4,7 @@ from types import SimpleNamespace
import numpy as np
import pytest
from cereal import log
from openpilot.cereal import log
from opendbc.car.interfaces import ACCEL_MAX, ACCEL_MIN
from openpilot.common.realtime import DT_MDL
from openpilot.selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import (
@@ -5,7 +5,7 @@ from types import SimpleNamespace
import numpy as np
import pytest
from cereal import custom, log, messaging
from openpilot.cereal import custom, log, messaging
from opendbc.car.interfaces import ACCEL_MAX, ACCEL_MIN
from openpilot.common.realtime import DT_MDL
from openpilot.selfdrive.controls.lib.longitudinal_planner import LongitudinalPlanner
@@ -1,7 +1,6 @@
import pytest
from openpilot.cereal import log, custom
from openpilot.common.params import Params
from openpilot.selfdrive.controls.lib.desire_helper import DesireHelper
from openpilot.sunnypilot.selfdrive.controls.lib.lane_turn_desire import LaneTurnController, LANE_CHANGE_SPEED_MIN
from openpilot.sunnypilot.selfdrive.controls.lib.auto_lane_change import AutoLaneChangeMode
@@ -116,4 +115,3 @@ def test_desire_helper_integration(carstate, lateral_active, lane_change_prob, e
dh.update(carstate, lateral_active, lane_change_prob,
left_edge_detected=relc.left_edge_detected, right_edge_detected=relc.right_edge_detected)
assert dh.desire == expected_desire # The first four tests were unit tests to test the controller, where this tests the integration in desire helpers
@@ -14,7 +14,7 @@ from typing import Any
import numpy as np
from cereal import log
from openpilot.cereal import log
import cereal.messaging as messaging
from openpilot.common.realtime import DT_MDL, Ratekeeper
from openpilot.selfdrive.modeld.constants import ModelConstants
+7 -2
View File
@@ -15,8 +15,13 @@ class FanController:
self.controller = PIDController(k_p=0, k_i=4e-3, rate=rate)
def update(self, cur_temp: float, ignition: bool) -> int:
self.controller.pos_limit = 100 if ignition else 30
self.controller.neg_limit = 30 if ignition else 0
if ignition:
# always run fan at max onroad, prioritize cooling over noise
self.last_ignition = ignition
return 100
self.controller.pos_limit = 30
self.controller.neg_limit = 0
if ignition != self.last_ignition:
self.controller.reset()