mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-30 04:03:44 +08:00
MSPA: lateralPlanSP legacy support (#274)
* MSPA: `lateralPlanSP` legacy support * bump cereal
This commit is contained in:
+1
-1
Submodule cereal updated: 437d2e4593...4450066983
@@ -81,7 +81,7 @@ class Controls:
|
||||
self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration',
|
||||
'driverMonitoringState', 'longitudinalPlan', 'lateralPlan', 'liveLocationKalman',
|
||||
'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters',
|
||||
'testJoystick', 'longitudinalPlanSP', 'lateralPlanSP'] + self.camera_packets + self.sensor_packets,
|
||||
'testJoystick', 'longitudinalPlanSP', 'lateralPlanSPDEPRECATED'] + self.camera_packets + self.sensor_packets,
|
||||
ignore_alive=ignore, ignore_avg_freq=['radarState', 'testJoystick'])
|
||||
|
||||
if CI is None:
|
||||
@@ -299,7 +299,7 @@ class Controls:
|
||||
lane_change_set_timer = int(self.params.get("AutoLaneChangeTimer", encoding="utf8"))
|
||||
if self.sm['lateralPlan'].laneChangeState == LaneChangeState.preLaneChange:
|
||||
direction = self.sm['lateralPlan'].laneChangeDirection
|
||||
lc_prev = self.sm['lateralPlanSP'].laneChangePrev
|
||||
lc_prev = self.sm['lateralPlanSPDEPRECATED'].laneChangePrev
|
||||
if (CS.leftBlindspot and direction == LaneChangeDirection.left) or \
|
||||
(CS.rightBlindspot and direction == LaneChangeDirection.right):
|
||||
self.events.add(EventName.laneChangeBlocked)
|
||||
|
||||
@@ -74,13 +74,13 @@ class LateralPlanner:
|
||||
|
||||
pm.send('lateralPlan', plan_send)
|
||||
|
||||
plan_sp_send = messaging.new_message('lateralPlanSP')
|
||||
plan_sp_send = messaging.new_message('lateralPlanSPDEPRECATED')
|
||||
plan_sp_send.valid = sm.all_checks(service_list=['carState', 'controlsState', 'modelV2'])
|
||||
|
||||
lateralPlanSP = plan_sp_send.lateralPlanSP
|
||||
lateralPlanSP.laneChangePrev = self.DH.prev_lane_change
|
||||
lateralPlanSPDEPRECATED = plan_sp_send.lateralPlanSPDEPRECATED
|
||||
lateralPlanSPDEPRECATED.laneChangePrev = self.DH.prev_lane_change
|
||||
|
||||
lateralPlanSP.dPathWLinesX = [float(x) for x in self.d_path_w_lines_xyz[:, 0]]
|
||||
lateralPlanSP.dPathWLinesY = [float(y) for y in self.d_path_w_lines_xyz[:, 1]]
|
||||
lateralPlanSPDEPRECATED.dPathWLinesX = [float(x) for x in self.d_path_w_lines_xyz[:, 0]]
|
||||
lateralPlanSPDEPRECATED.dPathWLinesY = [float(y) for y in self.d_path_w_lines_xyz[:, 1]]
|
||||
|
||||
pm.send('lateralPlanSP', plan_sp_send)
|
||||
pm.send('lateralPlanSPDEPRECATED', plan_sp_send)
|
||||
|
||||
@@ -41,7 +41,7 @@ def plannerd_thread():
|
||||
longitudinal_planner = LongitudinalPlanner(CP)
|
||||
lateral_planner = LateralPlanner(CP, debug=debug_mode)
|
||||
|
||||
pm = messaging.PubMaster(['longitudinalPlan', 'lateralPlan', 'uiPlan', 'longitudinalPlanSP', 'lateralPlanSP'])
|
||||
pm = messaging.PubMaster(['longitudinalPlan', 'lateralPlan', 'uiPlan', 'longitudinalPlanSP', 'lateralPlanSPDEPRECATED'])
|
||||
sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'radarState', 'modelV2'],
|
||||
poll=['radarState', 'modelV2'], ignore_avg_freq=['radarState'])
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ def cycle_alerts(duration=200, is_metric=False):
|
||||
CP = CarInterface.get_non_essential_params("HONDA CIVIC 2016")
|
||||
sm = messaging.SubMaster(['deviceState', 'pandaStates', 'roadCameraState', 'modelV2', 'liveCalibration',
|
||||
'driverMonitoringState', 'longitudinalPlan', 'lateralPlan', 'liveLocationKalman',
|
||||
'managerState', 'longitudinalPlanSP', 'lateralPlanSP',
|
||||
'managerState', 'longitudinalPlanSP', 'lateralPlanSPDEPRECATED',
|
||||
'driverMonitoringStateSP'] + cameras)
|
||||
|
||||
pm = messaging.PubMaster(['controlsState', 'pandaStates', 'deviceState'])
|
||||
|
||||
Reference in New Issue
Block a user