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

* add slight turns

* bump cereal

* revert

* hmm, i like this better

* whops

* fix

* bump
old-commit-hash: 6d2922b8e6
beeps
Shane Smiskol 2 years ago committed by GitHub
parent 5530871c0e
commit 593322dfa9
  1. 2
      cereal
  2. 3
      selfdrive/assets/navigation/direction_turn_slight_left_inactive.png
  3. 3
      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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ce2ea01f9ed172048c86b93e0ebfa8f468473de49be92ad200fb54d688434cb
size 3696

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c1a3d5ee5f493093848b0b5f09e3572bf3cb8a6f79907fcb1b1bd4d690bc634
size 3743

@ -8,6 +8,9 @@ from common.conversions import Conversions
from common.numpy_fast import clip
from common.params import Params
DIRECTIONS = ('left', 'right', 'straight')
MODIFIABLE_DIRECTIONS = ('left', 'right')
EARTH_MEAN_RADIUS = 6371007.2
SPEED_CONVERSIONS = {
'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:
for d in ['left', 'right', 'straight']:
for d in DIRECTIONS:
if d in direction:
if 'slight' in direction and d in MODIFIABLE_DIRECTIONS:
return 'slight' + d.capitalize()
return d
return 'none'

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

Loading…
Cancel
Save