fix empty banner instructions when arriving at destination

pull/29034/head
Shane Smiskol 2 years ago committed by GitHub
parent 5cfb79e35f
commit a7bc8d40b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      selfdrive/navd/navd.py

@ -218,9 +218,12 @@ class RouteEngine:
along_geometry = distance_along_geometry(geometry, self.last_position)
distance_to_maneuver_along_geometry = step['distance'] - along_geometry
# Banner instructions are for the following step, don't use empty last step
banner_instructions = self.route[max(min(self.step_idx, len(self.route) - 2), 0))]
# Current instruction
msg.navInstruction.maneuverDistance = distance_to_maneuver_along_geometry
parse_banner_instructions(msg.navInstruction, step['bannerInstructions'], distance_to_maneuver_along_geometry)
parse_banner_instructions(msg.navInstruction, banner_instructions, distance_to_maneuver_along_geometry)
# Compute total remaining time and distance
remaining = 1.0 - along_geometry / max(step['distance'], 1)

Loading…
Cancel
Save