mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-19 06:02:06 +08:00
process_replay/migration: doesnt need to import acados (#38040)
process_replay/migration: drop transitive dep on long_mpc/acados migrate_longitudinalPlan only needs get_accel_from_plan + CONTROL_N_T_IDX, both available from drive_helpers + ModelConstants directly. Importing from longitudinal_planner instead pulled in long_mpc -> libacados.so as an eager side-effect, which downstream log-migration consumers (e.g. commaai/xx pipeline) shouldn't pay for.
This commit is contained in:
@@ -14,7 +14,7 @@ from opendbc.car.gm.values import GMSafetyFlags
|
||||
from openpilot.selfdrive.modeld.constants import ModelConstants
|
||||
from openpilot.selfdrive.modeld.fill_model_msg import fill_xyz_poly, fill_lane_line_meta
|
||||
from openpilot.selfdrive.test.process_replay.vision_meta import meta_from_encode_index
|
||||
from openpilot.selfdrive.controls.lib.longitudinal_planner import get_accel_from_plan, CONTROL_N_T_IDX
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N, get_accel_from_plan
|
||||
from openpilot.system.manager.process_config import managed_processes
|
||||
from openpilot.tools.lib.logreader import LogIterable
|
||||
|
||||
@@ -126,7 +126,7 @@ def migrate_longitudinalPlan(msgs):
|
||||
if msg.which() != 'longitudinalPlan':
|
||||
continue
|
||||
new_msg = msg.as_builder()
|
||||
a_target, should_stop = get_accel_from_plan(msg.longitudinalPlan.speeds, msg.longitudinalPlan.accels, CONTROL_N_T_IDX)
|
||||
a_target, should_stop = get_accel_from_plan(msg.longitudinalPlan.speeds, msg.longitudinalPlan.accels, ModelConstants.T_IDXS[:CONTROL_N])
|
||||
new_msg.longitudinalPlan.aTarget, new_msg.longitudinalPlan.shouldStop = float(a_target), bool(should_stop)
|
||||
ops.append((index, as_reader(new_msg)))
|
||||
return ops, [], []
|
||||
|
||||
Reference in New Issue
Block a user