Skip to content

Commit

Permalink
Merge pull request #18 from sisl/0.7-fixes
Browse files Browse the repository at this point in the history
0.7 fixes
  • Loading branch information
MaximeBouton authored Oct 2, 2018
2 parents 5a36408 + 046f79e commit 9e1878f
Show file tree
Hide file tree
Showing 32 changed files with 250 additions and 235 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ os:
- linux
# - osx
julia:
- 0.6
- 0.7
- 1.0
- nightly
matrix:
allow_failures:
Expand All @@ -14,6 +15,6 @@ notifications:
email: false
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.clone("https://github.com/tawheeler/Vec.jl.git"); Pkg.clone("https://github.com/sisl/Records.jl.git"); Pkg.add("Colors"); Pkg.add("Cairo"); Pkg.add("Reel"); Pkg.build("AutomotiveDrivingModels"); Pkg.clone("https://github.com/sisl/AutoViz.jl.git"); Pkg.test("AutomotiveDrivingModels"; coverage=true)'
- julia --project --check-bounds=yes -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/sisl/Records.jl")); Pkg.add(PackageSpec(url="https://github.com/sisl/Vec.jl")); Pkg.build("AutomotiveDrivingModels"); Pkg.test("AutomotiveDrivingModels"; coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("AutomotiveDrivingModels")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
- julia --project -e 'using Pkg; cd(Pkg.dir("AutomotiveDrivingModels")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
18 changes: 18 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name = "AutomotiveDrivingModels"
uuid = "99497e54-f3d6-53d3-a3a9-fa9315a7f1ba"
repo = "https://github.com/sisl/AutomotiveDrivingModels.jl.git"
version = "0.7.0"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
6 changes: 0 additions & 6 deletions REQUIRE

This file was deleted.

8 changes: 3 additions & 5 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Pkg
packages = keys(Pkg.installed())
if !in("Vec", packages)
Pkg.clone("https://github.com/sisl/Vec.jl.git")
Pkg.add(PackageSpec(url="https://github.com/sisl/Vec.jl.git"))
end
warn("Checking out Vec.jl branch 0_6 for compatibility with julia 0.6")
Pkg.checkout("Vec", "0_6")
if !in("Records", packages)
Pkg.clone("https://github.com/sisl/Records.jl.git")
Pkg.add(PackageSpec(url="https://github.com/sisl/Records.jl.git"))
end

2 changes: 1 addition & 1 deletion src/1d/actions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end
Base.show(io::IO, a::LaneFollowingAccel) = @printf(io, "LaneFollowingAccel(%6.3f)", a.a)
Base.length(::Type{LaneFollowingAccel}) = 1
Base.convert(::Type{LaneFollowingAccel}, v::Vector{Float64}) = LaneFollowingAccel(v[1])
function Base.copy!(v::Vector{Float64}, a::LaneFollowingAccel)
function Base.copyto!(v::Vector{Float64}, a::LaneFollowingAccel)
v[1] = a.a
v
end
Expand Down
2 changes: 1 addition & 1 deletion src/2d/actions/accel_desang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ end
Base.show(io::IO, a::AccelDesang) = @printf(io, "AccelDesang(%6.3f,%6.3f)", a.a, a.ϕdes)
Base.length(::Type{AccelDesang}) = 2
Base.convert(::Type{AccelDesang}, v::Vector{Float64}) = AccelDesang(v[1], v[2])
function Base.copy!(v::Vector{Float64}, a::AccelDesang)
function Base.copyto!(v::Vector{Float64}, a::AccelDesang)
v[1] = a.a
v[2] = a.ϕdes
v
Expand Down
2 changes: 1 addition & 1 deletion src/2d/actions/accel_steering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ end
Base.show(io::IO, a::AccelSteeringAngle) = @printf(io, "AccelSteeringAngle(%6.3f,%6.3f)", a.a, a.δ)
Base.length(::Type{AccelSteeringAngle}) = 2
Base.convert(::Type{AccelSteeringAngle}, v::Vector{Float64}) = AccelSteeringAngle(v[1], v[2])
function Base.copy!(v::Vector{Float64}, a::AccelSteeringAngle)
function Base.copyto!(v::Vector{Float64}, a::AccelSteeringAngle)
v[1] = a.a
v[2] = a.δ
v
Expand Down
2 changes: 1 addition & 1 deletion src/2d/actions/accel_turnrate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ end
Base.show(io::IO, a::AccelTurnrate) = @printf(io, "AccelTurnrate(%6.3f,%6.3f)", a.a, a.ω)
Base.length(::Type{AccelTurnrate}) = 2
Base.convert(::Type{AccelTurnrate}, v::Vector{Float64}) = AccelTurnrate(v[1], v[2])
function Base.copy!(v::Vector{Float64}, a::AccelTurnrate)
function Base.copyto!(v::Vector{Float64}, a::AccelTurnrate)
v[1] = a.a
v[2] = a.ω
v
Expand Down
6 changes: 3 additions & 3 deletions src/2d/actions/lat_lon_accel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ end
Base.show(io::IO, a::LatLonAccel) = @printf(io, "LatLonAccel(%6.3f, %6.3f)", a.a_lat, a.a_lon)
Base.length(::Type{LatLonAccel}) = 2
Base.convert(::Type{LatLonAccel}, v::Vector{Float64}) = LatLonAccel(v[1], v[2])
function Base.copy!(v::Vector{Float64}, a::LatLonAccel)
function Base.copyto!(v::Vector{Float64}, a::LatLonAccel)
v[1] = a.a_lat
v[2] = a.a_lon
v
end
function propagate{D<:Union{VehicleDef, BicycleModel}}(veh::Entity{VehicleState, D, Int}, action::LatLonAccel, roadway::Roadway, ΔT::Float64)
function propagate(veh::Entity{VehicleState, D, Int}, action::LatLonAccel, roadway::Roadway, ΔT::Float64) where {D<:Union{VehicleDef, BicycleModel}}

a_lat = action.a_lat
a_lon = action.a_lon
Expand All @@ -33,7 +33,7 @@ function propagate{D<:Union{VehicleDef, BicycleModel}}(veh::Entity{VehicleState,
dt₂ = dt + a_lat*ΔT
speed₂ = sqrt(dt₂*dt₂ + ds₂*ds₂)
v₂ = sqrt(dt₂*dt₂ + ds₂*ds₂) # v is the magnitude of the velocity vector
ϕ₂ = atan2(dt₂, ds₂)
ϕ₂ = atan(dt₂, ds₂)

roadind = move_along(veh.state.posF.roadind, roadway, Δs)
footpoint = roadway[roadind]
Expand Down
2 changes: 1 addition & 1 deletion src/2d/behaviors/lane_change_models/lane_change_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end
Base.show(io::IO, a::LaneChangeChoice) = @printf(io, "LaneChangeChoice(%d)", a.dir)
Base.length(::Type{LaneChangeChoice}) = 1
Base.convert(::Type{LaneChangeChoice}, v::Vector{Float64}) = LaneChangeChoice(convert(Int, v[1]))
function Base.copy!(v::Vector{Float64}, a::LaneChangeChoice)
function Base.copyto!(v::Vector{Float64}, a::LaneChangeChoice)
v[1] = a.dir
v
end
Expand Down
13 changes: 8 additions & 5 deletions src/2d/evaluation/foldsets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ function _find_next_valid_fold_match(foldset::FoldSet, state::Int)
end
state + 1 # returns length(foldset.assignment) + 1 on fail
end
Base.start(foldset::FoldSet) = _find_next_valid_fold_match(foldset, 0)
Base.done(foldset::FoldSet, state::Int) = state > length(foldset.assignment)
function Base.next(foldset::FoldSet, state::Int)

function Base.iterate(foldset::FoldSet, state::Int = _find_next_valid_fold_match(foldset, 0))
if state > length(foldset.assignment)
return nothing
end
@assert(check_fold_match(foldset.assignment[state], foldset))
state, _find_next_valid_fold_match(foldset, state)
return state, _find_next_valid_fold_match(foldset, state)
end

function Base.length(foldset::FoldSet)
len = 0
state = start(foldset)
state = _find_next_valid_fold_match(foldset, 0)
while !done(foldset, state)
item, state = next(foldset, state)
len += 1
Expand Down
10 changes: 5 additions & 5 deletions src/2d/features/feature_extractors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export
abstract type AbstractFeatureExtractor end
rec_length(::AbstractFeatureExtractor) = 1 # length of the SceneRecord for best results
Base.length(::AbstractFeatureExtractor) = error("Not Impemeneted")
pull_features!{F<:AbstractFloat}(::AbstractFeatureExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0) = error("Not Implemented")
pull_features!(::AbstractFeatureExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0) where {F<:AbstractFloat} = error("Not Implemented")

###############################################################
# FeatureExtractor
Expand All @@ -24,7 +24,7 @@ mutable struct FeatureExtractor <: AbstractFeatureExtractor
end
rec_length(ext::FeatureExtractor) = ext.rec_length # length of the SceneRecord for best results
Base.length(ext::FeatureExtractor) = length(ext.features)
function pull_features!{F<:AbstractFloat}(ext::FeatureExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0)
function pull_features!(ext::FeatureExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0) where {F<:AbstractFloat}

# NOTE(tim): this is an interation over an abstract vector
# as such, this will be slow
Expand All @@ -42,10 +42,10 @@ struct SubsetExtractor{F<:AbstractFeatureExtractor, G<:AbstractFloat} <: Abstrac
subset::Vector{Int}
features::Vector{G}
end
SubsetExtractor{G<:AbstractFloat}(extractor::AbstractFeatureExtractor, subset::Vector{Int}, ::Type{G}=Float64) = SubsetExtractor(extractor, subset, Array{G}(length(extractor)))
SubsetExtractor(extractor::AbstractFeatureExtractor, subset::Vector{Int}, ::Type{G}=Float64) where {G<:AbstractFloat} = SubsetExtractor(extractor, subset, Array{G}(length(extractor)))
rec_length(ext::SubsetExtractor) = rec_length(ext.extractor)
Base.length(ext::SubsetExtractor) = length(ext.subset)
function pull_features!{F<:AbstractFloat}(ext::SubsetExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0)
function pull_features!(ext::SubsetExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0) where {F<:AbstractFloat}
pull_features!(ext.extractor, ext.features, rec, roadway, vehicle_index, pastframe)
for (i,j) in enumerate(ext.subset)
features[i] = ext.features[j]
Expand All @@ -63,7 +63,7 @@ struct StandardizingExtractor{F<:AbstractFeatureExtractor} <: AbstractFeatureExt
end
rec_length(ext::StandardizingExtractor) = rec_length(ext.extractor)
Base.length(ext::StandardizingExtractor) = length(ext.extractor)
function pull_features!{F<:AbstractFloat}(ext::StandardizingExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0)
function pull_features!(ext::StandardizingExtractor, features::Vector{F}, rec::SceneRecord, roadway::Roadway, vehicle_index::Int, pastframe::Int=0) where {F<:AbstractFloat}
pull_features!(ext.extractor, features, rec, roadway, vehicle_index, pastframe)
for i in 1 : length(features)
features[i] = (features[i] - ext.μ[i]) / ext.σ[i]
Expand Down
28 changes: 14 additions & 14 deletions src/2d/features/features.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
function Base.get{S<:VehicleState,D,I,R}(::Feature_PosFt, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_PosFt, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
FeatureValue(rec[pastframe][vehicle_index].state.posF.t)
end
function Base.get{S<:VehicleState,D,I,R}(::Feature_PosFyaw, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_PosFyaw, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
FeatureValue(rec[pastframe][vehicle_index].state.posF.ϕ)
end
function Base.get{S<:VehicleState,D,I,R}(::Feature_Speed, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_Speed, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
FeatureValue(rec[pastframe][vehicle_index].state.v)
end
function Base.get{S<:VehicleState,D,I,R}(::Feature_VelFs, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_VelFs, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
veh = rec[pastframe][vehicle_index]
FeatureValue(veh.state.v*cos(veh.state.posF.ϕ))
end
function Base.get{S<:VehicleState,D,I,R}(::Feature_VelFt, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_VelFt, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
veh = rec[pastframe][vehicle_index]
FeatureValue(veh.state.v*sin(veh.state.posF.ϕ))
end

generate_feature_functions("TurnRateG", :turnrateG, Float64, "rad/s")
function Base.get{S<:VehicleState,D,I,R}(::Feature_TurnRateG, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0; frames_back::Int=1)
function Base.get(::Feature_TurnRateG, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0; frames_back::Int=1) where {S<:VehicleState,D,I,R}

id = rec[pastframe][vehicle_index].id

Expand All @@ -28,7 +28,7 @@ function Base.get{S<:VehicleState,D,I,R}(::Feature_TurnRateG, rec::EntityQueueRe
veh_index_curr = vehicle_index
veh_index_prev = findfirst(rec[pastframe2], id)

if veh_index_prev != 0
if veh_index_prev != nothing
curr = rec[pastframe][veh_index_curr].state.posG.θ
past = rec[pastframe2][veh_index_prev].state.posG.θ
Δt = get_elapsed_time(rec, pastframe2, pastframe)
Expand All @@ -39,21 +39,21 @@ function Base.get{S<:VehicleState,D,I,R}(::Feature_TurnRateG, rec::EntityQueueRe
retval
end
generate_feature_functions("TurnRateF", :turnrateF, Float64, "rad/s")
function Base.get{S<:VehicleState,D,I,R}(::Feature_TurnRateF, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_TurnRateF, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
_get_feature_derivative_backwards(POSFYAW, rec, roadway, vehicle_index, pastframe)
end
generate_feature_functions("AngularRateG", :angrateG, Float64, "rad/s²")
function Base.get{S<:VehicleState,D,I,R}(::Feature_AngularRateG, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_AngularRateG, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
_get_feature_derivative_backwards(TURNRATEG, rec, roadway, vehicle_index, pastframe)
end
generate_feature_functions("AngularRateF", :angrateF, Float64, "rad/s²")
function Base.get{S<:VehicleState,D,I,R}(::Feature_AngularRateF, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0)
function Base.get(::Feature_AngularRateF, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0) where {S<:VehicleState,D,I,R}
_get_feature_derivative_backwards(TURNRATEF, rec, roadway, vehicle_index, pastframe)
end
generate_feature_functions("DesiredAngle", :desang, Float64, "rad")
function Base.get{S<:VehicleState,D,I,R}(::Feature_DesiredAngle, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0;
function Base.get(::Feature_DesiredAngle, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0;
kp_desired_angle::Float64 = 1.0,
)
) where {S<:VehicleState,D,I,R}

retval = FeatureValue(0.0, FeatureState.INSUF_HIST)
if pastframe_inbounds(rec, pastframe) && pastframe_inbounds(rec, pastframe-1)
Expand Down Expand Up @@ -464,9 +464,9 @@ end
#############################################

generate_feature_functions("Is_Colliding", :is_colliding, Bool, "-", lowerbound=0.0, upperbound=1.0)
function Base.get{S,D,I,R}(::Feature_Is_Colliding, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0;
function Base.get(::Feature_Is_Colliding, rec::EntityQueueRecord{S,D,I}, roadway::R, vehicle_index::Int, pastframe::Int=0;
mem::CPAMemory=CPAMemory(),
)
) where {S,D,I,R}

scene = rec[pastframe]
is_colliding = convert(Float64, get_first_collision(scene, vehicle_index, mem).is_colliding)
Expand Down
6 changes: 3 additions & 3 deletions src/2d/features/lidar_sensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function LidarSensor(nbeams::Int;
nbeams = 0
end

ranges = Array{Float64}(nbeams)
range_rates = Array{Float64}(nbeams)
ranges = Array{Float64}(undef, nbeams)
range_rates = Array{Float64}(undef, nbeams)
LidarSensor(angles, ranges, range_rates, max_range, ConvexPolygon(4))
end
nbeams(lidar::LidarSensor) = length(lidar.angles)
Expand Down Expand Up @@ -295,7 +295,7 @@ function get_lane_portions(roadway::Roadway, x::Real, y::Real, lane_portion_max_
for lane in seg.lanes
f = curvept -> normsquared(VecE2(curvept.pos - P)) Δ²
i = findfirst(f, lane.curve)
if i != 0
if i != nothing
j = findlast(f, lane.curve)
@assert(j != 0)
push!(lane_portions, LanePortion(lane.tag, i, j))
Expand Down
30 changes: 15 additions & 15 deletions src/2d/roadway/roadway_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export

function gen_straight_curve(A::VecE2, B::VecE2, nsamples::Int)

θ = atan2(B-A)
θ = atan(B-A)
δ = norm(B-A)/(nsamples-1)

s = 0.0
curve = Array{CurvePt}(nsamples)
curve = Array{CurvePt}(undef, nsamples)
for i in 1 : nsamples
t = (i-1)/(nsamples-1)
P = lerp(A,B,t)
Expand All @@ -31,7 +31,7 @@ function gen_straight_segment(seg_id::Int, nlanes::Int, length::Float64=1000.0;
boundary_middle::LaneBoundary=LaneBoundary(:broken, :white),
)

seg = RoadSegment(seg_id, Array{Lane}(nlanes))
seg = RoadSegment(seg_id, Array{Lane}(undef, nlanes))
y = -lane_widths[1]/2
for i in 1 : nlanes
y += lane_widths[i]/2
Expand Down Expand Up @@ -66,13 +66,13 @@ function gen_bezier_curve(A::VecSE2, B::VecSE2, rA::Float64, rB::Float64, nsampl
c = d + polar(-rB, B.θ)

s = 0.0
curve = Array{CurvePt}(nsamples)
curve = Array{CurvePt}(undef, nsamples)
for i in 1 : nsamples
t = (i-1)/(nsamples-1)
P = lerp(a,b,c,d,t)
P′ = 3*(1-t)^2*(b-a) + 6*(1-t)*t*(c-b) + 3*t^2*(d-c)
P′′ = 6*(1-t)*(c-2b+a) + 6t*(d-2*c+b)
θ = atan2(P′)
θ = atan(P′)
κ = (P′.x*P′′.y - P′.y*P′′.x)/(P′.x^2 + P′.y^2)^1.5 # signed curvature

if i > 1
Expand Down Expand Up @@ -116,10 +116,10 @@ Generate a roadway that is a rectangular racetrack with rounded corners.
radius = turn radius [m]
______________________
/ \
/ \\
| |
| |
\______________________/
\\______________________/
"""
function gen_stadium_roadway(nlanes::Int;
length::Float64=100.0,
Expand All @@ -139,15 +139,15 @@ function gen_stadium_roadway(nlanes::Int;
C = VecE2(0.0, width + radius)
D = VecE2(0.0, radius)

seg1 = RoadSegment(1, Array{Lane}(nlanes))
seg2 = RoadSegment(2, Array{Lane}(nlanes))
seg3 = RoadSegment(3, Array{Lane}(nlanes))
seg4 = RoadSegment(4, Array{Lane}(nlanes))
seg1 = RoadSegment(1, Array{Lane}(undef, nlanes))
seg2 = RoadSegment(2, Array{Lane}(undef, nlanes))
seg3 = RoadSegment(3, Array{Lane}(undef, nlanes))
seg4 = RoadSegment(4, Array{Lane}(undef, nlanes))
for i in 1 : nlanes
curvepts1 = Array{CurvePt}(ncurvepts_per_turn)
curvepts2 = Array{CurvePt}(ncurvepts_per_turn)
curvepts3 = Array{CurvePt}(ncurvepts_per_turn)
curvepts4 = Array{CurvePt}(ncurvepts_per_turn)
curvepts1 = Array{CurvePt}(undef, ncurvepts_per_turn)
curvepts2 = Array{CurvePt}(undef, ncurvepts_per_turn)
curvepts3 = Array{CurvePt}(undef, ncurvepts_per_turn)
curvepts4 = Array{CurvePt}(undef, ncurvepts_per_turn)

r = radius + lane_width*(i-1)
for j in 1:ncurvepts_per_turn
Expand Down
Loading

0 comments on commit 9e1878f

Please sign in to comment.