ui/map: slight turn lane types (#29446)

* add slight turns

* bump cereal

* revert

* hmm, i like this better

* whops

* fix

* bump
pull/29416/head^2
Shane Smiskol 2 years ago committed by GitHub
parent 2fa09a9ad7
commit 6d2922b8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cereal
  2. BIN
      selfdrive/assets/navigation/direction_turn_slight_left_inactive.png
  3. BIN
      selfdrive/assets/navigation/direction_turn_slight_right_inactive.png
  4. 7
      selfdrive/navd/helpers.py
  5. 2
      selfdrive/ui/qt/maps/map_instructions.h

@ -1 +1 @@
Subproject commit 2077dd1a1b0054713102aee8197434f8cfa07de7 Subproject commit 1ee48e0110a46fbdd9db50ed89a38bb5a748cfcb

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

@ -8,6 +8,9 @@ from common.conversions import Conversions
from common.numpy_fast import clip from common.numpy_fast import clip
from common.params import Params from common.params import Params
DIRECTIONS = ('left', 'right', 'straight')
MODIFIABLE_DIRECTIONS = ('left', 'right')
EARTH_MEAN_RADIUS = 6371007.2 EARTH_MEAN_RADIUS = 6371007.2
SPEED_CONVERSIONS = { SPEED_CONVERSIONS = {
'km/h': Conversions.KPH_TO_MS, 'km/h': Conversions.KPH_TO_MS,
@ -119,8 +122,10 @@ def coordinate_from_param(param: str, params: Optional[Params] = None) -> Option
def string_to_direction(direction: str) -> str: def string_to_direction(direction: str) -> str:
for d in ['left', 'right', 'straight']: for d in DIRECTIONS:
if d in direction: if d in direction:
if 'slight' in direction and d in MODIFIABLE_DIRECTIONS:
return 'slight' + d.capitalize()
return d return d
return 'none' return 'none'

@ -11,6 +11,8 @@ static std::map<cereal::NavInstruction::Direction, QString> DIRECTIONS = {
{cereal::NavInstruction::Direction::LEFT, "left"}, {cereal::NavInstruction::Direction::LEFT, "left"},
{cereal::NavInstruction::Direction::RIGHT, "right"}, {cereal::NavInstruction::Direction::RIGHT, "right"},
{cereal::NavInstruction::Direction::STRAIGHT, "straight"}, {cereal::NavInstruction::Direction::STRAIGHT, "straight"},
{cereal::NavInstruction::Direction::SLIGHT_LEFT, "slight_left"},
{cereal::NavInstruction::Direction::SLIGHT_RIGHT, "slight_right"},
}; };
class MapInstructions : public QWidget { class MapInstructions : public QWidget {

Loading…
Cancel
Save