From 7ce9f862b35756924da3c0f5339c9f6e44755214 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Wed, 28 Jun 2023 00:00:30 -0400 Subject: [PATCH] Road Edge Detection: toggle state fix (#198) * Road Edge Detection: toggle state fix * one liner * Revert "one liner" This reverts commit 44a34a3505456181af47329fbe76119c7fa204fb. --- selfdrive/controls/lib/desire_helper.py | 4 ++-- selfdrive/controls/lib/lateral_planner.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/lib/desire_helper.py b/selfdrive/controls/lib/desire_helper.py index f1e248355f4f52..c3e01d05260615 100644 --- a/selfdrive/controls/lib/desire_helper.py +++ b/selfdrive/controls/lib/desire_helper.py @@ -56,12 +56,12 @@ def __init__(self): self.road_edge = False self.param_read_counter = 0 self.read_param() - self.edge_toggle = self.param_s.get("RoadEdge") + self.edge_toggle = self.param_s.get_bool("RoadEdge") self.lane_change_set_timer = int(self.param_s.get("AutoLaneChangeTimer", encoding="utf8")) self.lane_change_bsm_delay = self.param_s.get_bool("AutoLaneChangeBsmDelay") def read_param(self): - self.edge_toggle = self.param_s.get("RoadEdge") + self.edge_toggle = self.param_s.get_bool("RoadEdge") self.lane_change_set_timer = int(self.param_s.get("AutoLaneChangeTimer", encoding="utf8")) self.lane_change_bsm_delay = self.param_s.get_bool("AutoLaneChangeBsmDelay") diff --git a/selfdrive/controls/lib/lateral_planner.py b/selfdrive/controls/lib/lateral_planner.py index 64d921ffc85dac..8db8681e7cee74 100644 --- a/selfdrive/controls/lib/lateral_planner.py +++ b/selfdrive/controls/lib/lateral_planner.py @@ -205,7 +205,7 @@ def publish(self, sm, pm): lateralPlan.laneChangeState = self.DH.lane_change_state lateralPlan.laneChangeDirection = self.DH.lane_change_direction lateralPlan.laneChangePrev = self.DH.prev_lane_change - lateralPlan.laneChangeEdgeBlock = (self.DH.lane_change_state == LaneChangeState.preLaneChange) and self.DH.road_edge + lateralPlan.laneChangeEdgeBlock = bool((self.DH.lane_change_state == LaneChangeState.preLaneChange) and self.DH.road_edge) lateralPlan.dynamicLaneProfile = int(self.dynamic_lane_profile) lateralPlan.dynamicLaneProfileStatus = bool(self.dynamic_lane_profile_status)