Take stop signs into account during routing

This commit is contained in:
Siarhei Fedartsou
2022-10-28 22:59:46 +02:00
parent 4432756de1
commit 350862d177
15 changed files with 104 additions and 19 deletions
+5 -2
View File
@@ -30,7 +30,8 @@ function setup()
use_turn_restrictions = true,
left_hand_driving = false,
traffic_light_penalty = 2,
stop_sign_penalty = 2
stop_sign_penalty = 2,
give_way_sign_penalty = 2
},
default_mode = mode.driving,
@@ -480,9 +481,11 @@ function process_turn(profile, turn)
local turn_bias = turn.is_left_hand_driving and 1. / profile.turn_bias or profile.turn_bias
if turn.has_traffic_light then
turn.duration = profile.properties.traffic_light_penalty
turn.duration = profile.properties.traffic_light_penalty
elseif turn.has_stop_sign then
turn.duration = profile.properties.stop_sign_penalty
elseif turn.has_give_way_sign then
turn.duration = profile.properties.give_way_sign_penalty
end