From c0abd08f1345985f74b7d9b465ffabf0c98f258e Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 16 Jun 2022 18:18:03 +0200 Subject: [PATCH] navd: handle maxspeed being none (#24871) * navd: handle maxspeed being none * none is encoded like this old-commit-hash: a875afd5639d6e1ac24baa4de047cb8a2988a953 --- selfdrive/navd/navd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py index 509653a46d..f02de43c7b 100755 --- a/selfdrive/navd/navd.py +++ b/selfdrive/navd/navd.py @@ -143,8 +143,10 @@ class RouteEngine: coord = Coordinate.from_mapbox_tuple(c) # Last step does not have maxspeed - if (maxspeed_idx < len(maxspeeds)) and ('unknown' not in maxspeeds[maxspeed_idx]): - coord.annotations['maxspeed'] = maxspeed_to_ms(maxspeeds[maxspeed_idx]) + if (maxspeed_idx < len(maxspeeds)): + maxspeed = maxspeeds[maxspeed_idx] + if ('unknown' not in maxspeed) and ('none' not in maxspeed): + coord.annotations['maxspeed'] = maxspeed_to_ms(maxspeed) coords.append(coord) maxspeed_idx += 1