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

* add slight turns

* bump cereal

* revert

* hmm, i like this better

* whops

* fix

* bump
This commit is contained in:
Shane Smiskol
2023-08-17 20:51:52 -07:00
committed by GitHub
parent 2fa09a9ad7
commit 6d2922b8e6
5 changed files with 9 additions and 2 deletions
+1 -1
Submodule cereal updated: 2077dd1a1b...1ee48e0110
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

+6 -1
View File
@@ -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'
+2
View File
@@ -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 {