Skip to content

Commit

Permalink
leave the flippening to another PR
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Dec 28, 2021
1 parent 8b665ce commit 5d090a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ def publish_logs(self, CS, start_time, actuators, lac_log):
left_lane_visible = self.sm['lateralPlan'].lProb > 0.5
l_lane_change_prob = meta.desirePrediction[Desire.laneChangeLeft - 1]
r_lane_change_prob = meta.desirePrediction[Desire.laneChangeRight - 1]
l_lane_close = left_lane_visible and (self.sm['modelV2'].laneLines[1].y[0] > -(1.08 - CAMERA_OFFSET))
r_lane_close = right_lane_visible and (self.sm['modelV2'].laneLines[2].y[0] < (1.08 + CAMERA_OFFSET))
l_lane_close = left_lane_visible and (self.sm['modelV2'].laneLines[1].y[0] > -(1.08 + CAMERA_OFFSET))
r_lane_close = right_lane_visible and (self.sm['modelV2'].laneLines[2].y[0] < (1.08 - CAMERA_OFFSET))

CC.hudControl.leftLaneDepart = bool(l_lane_change_prob > LANE_DEPARTURE_THRESHOLD and l_lane_close)
CC.hudControl.rightLaneDepart = bool(r_lane_change_prob > LANE_DEPARTURE_THRESHOLD and r_lane_close)
Expand Down
8 changes: 4 additions & 4 deletions selfdrive/controls/lib/lane_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

TRAJECTORY_SIZE = 33
# model path is 0.06 m left of car center
MODEL_PATH_OFFSET = -0.06
MODEL_PATH_OFFSET = 0.06
if EON:
CAMERA_OFFSET = -0.06
CAMERA_OFFSET = 0.06
elif TICI:
CAMERA_OFFSET = 0.04
CAMERA_OFFSET = -0.04
else:
CAMERA_OFFSET = 0.0

Expand All @@ -39,7 +39,7 @@ def __init__(self, wide_camera=False):
self.r_lane_change_prob = 0.

self.camera_offset = -CAMERA_OFFSET if wide_camera else CAMERA_OFFSET
self.path_offset = MODEL_PATH_OFFSET - self.camera_offset
self.path_offset = self.camera_offset - MODEL_PATH_OFFSET

def parse_model(self, md):
if len(md.laneLines) == 4 and len(md.laneLines[0].t) == TRAJECTORY_SIZE:
Expand Down

0 comments on commit 5d090a3

Please sign in to comment.