From 17b10058f3295fa5bdd6d689b6941ab4a2a5944f Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 25 Jul 2023 00:26:04 -0700 Subject: [PATCH] clean up --- selfdrive/navd/helpers.py | 2 +- selfdrive/navd/navd.py | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/selfdrive/navd/helpers.py b/selfdrive/navd/helpers.py index 33e64fe84a..36682d53e3 100644 --- a/selfdrive/navd/helpers.py +++ b/selfdrive/navd/helpers.py @@ -147,7 +147,7 @@ def parse_banner_instructions(instruction: Any, banners: Any, distance_to_maneuv current_banner = banner # Only show banner when close enough to maneuver - print(distance_to_maneuver, current_banner['distanceAlongGeometry']) + # print(distance_to_maneuver, current_banner['distanceAlongGeometry']) instruction.showFull = distance_to_maneuver < current_banner['distanceAlongGeometry'] # Primary diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py index 6633b505f3..cc95dca43f 100755 --- a/selfdrive/navd/navd.py +++ b/selfdrive/navd/navd.py @@ -10,7 +10,6 @@ import numpy as np import cereal.messaging as messaging from cereal import log from common.api import Api -from common.numpy_fast import clip from common.params import Params from common.realtime import Ratekeeper from common.transformations.coordinates import ecef2geodetic @@ -169,9 +168,6 @@ class RouteEngine: r = resp.json() if len(r['routes']): self.route = r['routes'][0]['legs'][0]['steps'] - if len(self.route) > 1 and not len(self.route[-1]['bannerInstructions']): - self.route[-1]['bannerInstructions'] = self.route[-2]['bannerInstructions'] - self.route_geometry = [] maxspeed_idx = 0 @@ -225,24 +221,9 @@ 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 - # print([i['bannerInstructions'] for i in self.route]) - # print(self.route) - print('---') - for _step in self.route: - print('maneuver', _step['maneuver'], _step['distance'], _step['duration']) - print('bannerInstructions', _step['bannerInstructions']) - print() - print('---') - # banner_step = self.route[np.clip(self.step_idx, 0, len(self.route) - 2)] - - # if not len(banner_step['bannerInstructions']) and self.step_idx == (len(self.route) - 1): - - print(self.step_idx) # Banner instructions are for the following step, don't use empty last step banner_step = step if not len(banner_step['bannerInstructions']) and len(self.route) - 1 == self.step_idx: - print('using step_idx', self.step_idx - 1) banner_step = self.route[max(self.step_idx - 1, 0)] # Current instruction