mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-08 19:25:42 +08:00
Merge branch 'SP-134-pause-lateral-speed' into master-dev-c3
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ sunnypilot - 0.9.7.0 (2024-05-xx)
|
||||
* NEW❗: Parse speed limit sign recognition from camera for certain supported platforms
|
||||
* UPDATED: Auto Lane Change Timer -> Auto Lane Change by Blinker
|
||||
* NEW❗: New "Off" option to disable lane change by blinker
|
||||
* UPDATED: Pause Lateral Below Speed w/ Blinker
|
||||
* UPDATED: Pause Lateral Below Speed with Blinker
|
||||
* NEW❗: Customizable Pause Lateral Speed
|
||||
* Pause lateral actuation with blinker when traveling below the desired speed selected. Default is 20 MPH or 32 km/h.
|
||||
* UPDATED: Hyundai CAN Longitudinal
|
||||
|
||||
@@ -18,7 +18,8 @@ from openpilot.common.params import Params
|
||||
from openpilot.common.realtime import DT_CTRL
|
||||
from openpilot.selfdrive.car import apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG
|
||||
from openpilot.selfdrive.car.values import PLATFORMS
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, V_CRUISE_UNSET, get_friction, get_min_lateral_speed
|
||||
from openpilot.selfdrive.controls.lib.desire_helper import get_min_lateral_speed
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, V_CRUISE_UNSET, get_friction
|
||||
from openpilot.selfdrive.controls.lib.events import Events
|
||||
from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@ AUTO_LANE_CHANGE_TIMER = {
|
||||
}
|
||||
|
||||
|
||||
def get_min_lateral_speed(value: int, is_metric: bool, default: float = LANE_CHANGE_SPEED_MIN):
|
||||
speed: float = default if value == 0 else value * CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS
|
||||
return speed
|
||||
|
||||
|
||||
class DesireHelper:
|
||||
def __init__(self):
|
||||
self.lane_change_state = LaneChangeState.off
|
||||
|
||||
@@ -5,7 +5,6 @@ from cereal import car, log, custom
|
||||
from openpilot.common.conversions import Conversions as CV
|
||||
from openpilot.common.numpy_fast import clip, interp
|
||||
from openpilot.common.realtime import DT_MDL, DT_CTRL
|
||||
from openpilot.selfdrive.controls.lib.desire_helper import LANE_CHANGE_SPEED_MIN
|
||||
from openpilot.selfdrive.modeld.constants import ModelConstants
|
||||
|
||||
# WARNING: this value was determined based on the model's training distribution,
|
||||
@@ -342,8 +341,3 @@ def get_road_edge(carstate, model_v2, toggle):
|
||||
road_edge = False
|
||||
|
||||
return road_edge
|
||||
|
||||
|
||||
def get_min_lateral_speed(value: int, is_metric: bool, default: float = LANE_CHANGE_SPEED_MIN):
|
||||
speed: float = default if value == 0 else value * CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS
|
||||
return speed
|
||||
|
||||
Reference in New Issue
Block a user