Initial left hand driving implementation

This commit is contained in:
Lauren Budorick
2016-07-18 15:34:12 +02:00
committed by Michael Krasnyk
parent b0873e2aa4
commit c09b9b4c99
11 changed files with 92 additions and 17 deletions
+2 -1
View File
@@ -138,13 +138,14 @@ properties.u_turn_penalty = 20
properties.traffic_signal_penalty = 2
properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true
properties.left_hand_driving = false
local side_road_speed_multiplier = 0.8
local turn_penalty = 10
-- Note: this biases right-side driving. Should be
-- inverted for left-driving countries.
local turn_bias = 1.2
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
local obey_oneway = true
local ignore_areas = true
+19
View File
@@ -0,0 +1,19 @@
-- Testbot, with turn penalty
-- Used for testing turn penalties
require 'testbot'
properties.left_hand_driving = true
local turn_penalty = 500
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
function turn_function (angle)
---- compute turn penalty as angle^2, with a left/right bias
k = turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else
return angle*angle*k*turn_bias
end
end
+19
View File
@@ -0,0 +1,19 @@
-- Testbot, with turn penalty
-- Used for testing turn penalties
require 'testbot'
properties.left_hand_driving = false
local turn_penalty = 500
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
function turn_function (angle)
---- compute turn penalty as angle^2, with a left/right bias
k = turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else
return angle*angle*k*turn_bias
end
end