Skip to content

Commit

Permalink
Road Edge Detection: toggle state fix (commaai#198)
Browse files Browse the repository at this point in the history
* Road Edge Detection: toggle state fix

* one liner

* Revert "one liner"

This reverts commit 44a34a3505456181af47329fbe76119c7fa204fb.
  • Loading branch information
sunnyhaibin authored Jun 28, 2023
1 parent 89e2856 commit 7ce9f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions selfdrive/controls/lib/desire_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/lateral_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ce9f86

Please sign in to comment.