Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhenghao committed May 14, 2024
1 parent 384549b commit 8787adb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions metadrive/component/vehicle/base_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,10 @@ def update_dist_to_left_right(self):
self.dist_to_left_side, self.dist_to_right_side = self._dist_to_route_left_right()

def _dist_to_route_left_right(self, navigation=None):
# TODO
if self.navigation is None or self.navigation.current_ref_lanes is None:
return 0, 0
if navigation is None:
navigation = self.navigation
if navigation is None or navigation.current_ref_lanes is None:
return 0, 0
current_reference_lane = navigation.current_ref_lanes[0]
_, lateral_to_reference = current_reference_lane.local_coordinates(self.position)
lateral_to_left = lateral_to_reference + navigation.get_current_lane_width() / 2
Expand Down

0 comments on commit 8787adb

Please sign in to comment.