Skip to content

Commit

Permalink
Merge 5dd74b7 into b1fc10f
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeBouton committed Aug 10, 2020
2 parents b1fc10f + 5dd74b7 commit 334bb17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Project.toml
@@ -1,7 +1,7 @@
name = "AutomotiveSimulator"
uuid = "6aa42d20-6c96-11ea-1103-339224409280"
repo = "https://github.com/sisl/AutomotiveSimulator.jl.git"
version = "0.1.0"
version = "0.1.1"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -21,7 +21,7 @@ Parameters = "0.12"
Reexport = "0.2"
StaticArrays = "0.12"
Tricks = "0.1"
julia = "1.3, 1.4"
julia = "1.3, 1.4, 1.5"

[extras]
AutomotiveVisualization = "0faf7fd0-6c98-11ea-1740-03605baa3b07"
Expand Down
8 changes: 6 additions & 2 deletions src/feature-extraction/neighbors_features.jl
Expand Up @@ -57,6 +57,7 @@ const VEHICLE_TARGET_POINT_CENTER = VehicleTargetPointCenter()
find_neighbor(scene::Scene, roadway::Roawday, ego::Entity; kwargs...)
Search through lanes and road segments to find a neighbor of `ego` in the `scene`.
Returns a `NeighborLongitudinalResult` object with the index of the neighbor in the scene and its relative distance.
# Arguments
Expand All @@ -81,15 +82,18 @@ function find_neighbor(scene::Scene, roadway::Roadway, ego::Entity{S,D,I};
ids_to_ignore::Union{Nothing, Set{I}} = nothing) where {S,D,I}


if lane == nothing
if lane === nothing
return NeighborLongitudinalResult(nothing, max_distance)
elseif get_lane(roadway, ego).tag == lane.tag
tag_start = lane.tag
s_start = posf(ego.state).s
else # project ego on desired lane
roadproj = proj(posg(ego.state), lane, roadway)
roadind = RoadIndex(roadproj)
tag_start = roadproj.tag
s_start = roadway[roadind].s
end
s_base = posf(ego.state).s + targetpoint_delta(targetpoint_ego, ego)
s_base = s_start + targetpoint_delta(targetpoint_ego, ego)

tag_target = tag_start
best_ind = nothing
Expand Down

0 comments on commit 334bb17

Please sign in to comment.