mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-27 00:42:05 +08:00
Merge branch 'devel-en' into devel-zhs
This commit is contained in:
@@ -214,7 +214,7 @@ def state_transition(frame, CS, CP, state, events, soft_disable_timer, v_cruise_
|
||||
|
||||
|
||||
def state_control(frame, rcv_frame, plan, path_plan, CS, CP, state, events, v_cruise_kph, v_cruise_kph_last,
|
||||
AM, rk, driver_status, LaC, LoC, VM, read_only, is_metric, cal_perc):
|
||||
AM, rk, driver_status, LaC, LoC, VM, read_only, is_metric, cal_perc, dragon_lat_control):
|
||||
"""Given the state, this function returns an actuators packet"""
|
||||
|
||||
actuators = car.CarControl.Actuators.new_message()
|
||||
@@ -264,7 +264,7 @@ def state_control(frame, rcv_frame, plan, path_plan, CS, CP, state, events, v_cr
|
||||
actuators.steer, actuators.steerAngle, lac_log = LaC.update(active, CS.vEgo, CS.steeringAngle, CS.steeringRate, CS.steeringTorqueEps, CS.steeringPressed, CP, VM, path_plan)
|
||||
|
||||
# Send a "steering required alert" if saturation count has reached the limit
|
||||
if LaC.sat_flag and CP.steerLimitAlert:
|
||||
if dragon_lat_control and LaC.sat_flag and CP.steerLimitAlert:
|
||||
AM.add(frame, "steerSaturated", enabled)
|
||||
|
||||
# Parse permanent warnings to display constantly
|
||||
@@ -511,6 +511,7 @@ def controlsd_thread(gctx=None):
|
||||
ts = sec_since_boot()
|
||||
if ts - ts_last_check > 3.:
|
||||
dragon_toyota_stock_dsu = False if params.get("DragonToyotaStockDSU") == "0" else True
|
||||
dragon_lat_control = False if params.get("DragonLatCtrl") == "0" else True
|
||||
ts_last_check = ts
|
||||
|
||||
start_time = sec_since_boot()
|
||||
@@ -556,7 +557,7 @@ def controlsd_thread(gctx=None):
|
||||
# Compute actuators (runs PID loops and lateral MPC)
|
||||
actuators, v_cruise_kph, driver_status, v_acc, a_acc, lac_log = \
|
||||
state_control(sm.frame, sm.rcv_frame, sm['plan'], sm['pathPlan'], CS, CP, state, events, v_cruise_kph, v_cruise_kph_last, AM, rk,
|
||||
driver_status, LaC, LoC, VM, read_only, is_metric, cal_perc)
|
||||
driver_status, LaC, LoC, VM, read_only, is_metric, cal_perc, dragon_lat_control)
|
||||
|
||||
prof.checkpoint("State Control")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user