Take stop signs into account during routing
This commit is contained in:
+2
-2
@@ -30,6 +30,7 @@ function setup()
|
||||
use_turn_restrictions = true,
|
||||
left_hand_driving = false,
|
||||
traffic_light_penalty = 2,
|
||||
stop_sign_penalty = 2
|
||||
},
|
||||
|
||||
default_mode = mode.driving,
|
||||
@@ -481,8 +482,7 @@ function process_turn(profile, turn)
|
||||
if turn.has_traffic_light then
|
||||
turn.duration = profile.properties.traffic_light_penalty
|
||||
elseif turn.has_stop_sign then
|
||||
-- TODO: use another constant
|
||||
turn.duration = profile.properties.traffic_light_penalty
|
||||
turn.duration = profile.properties.stop_sign_penalty
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ function TrafficSignal.get_value(node)
|
||||
local direction = node:get_value_by_key("traffic_signals:direction")
|
||||
if direction then
|
||||
if "forward" == direction then
|
||||
return traffic_lights.direction_forward
|
||||
return traffic_flow_control_direction.direction_forward
|
||||
end
|
||||
if "backward" == direction then
|
||||
return traffic_lights.direction_reverse
|
||||
return traffic_flow_control_direction.direction_reverse
|
||||
end
|
||||
end
|
||||
-- return traffic_lights.direction_all
|
||||
|
||||
Reference in New Issue
Block a user