Helpers

Helpers

Some helpers function including a collision checker and occlusion checker.

get_conflict_lanes(crosswalk::Lane, roadway::Roadway)

Find the lanes in roadway that intersects with a crosswalk

source

return the ego vehicle from a given scene

source
get_end(lane::Lane)

return the end longitudinal position of a lane

source

return the list of exit lanes, i.e. the one that does not have any exits

source

Given a list of lanes returns the list of exits

source
get_lane(roadway::Roadway, vehicle::Vehicle)
get_lane(roadway::Roadway, vehicle::VehicleState)

return the lane where vehicle is in.

source
get_lanes(roadway::Roadway)

return all the lanes in a roadway that are not crosswalk and not in the ego path

source

return the list of entrance lanes, i.e. the one that does not have any entrances

source
is_crash(scene::Scene)

return true if the ego car is in collision in the given scene, do not check for collisions between other participants

source
random_route(rng::AbstractRNG, roadway::Roadway, start_lane::Lane)

Generate a random route starting from start_lane to a random end node

source
is_observable_dyna(ego::Vehicle, car::Vehicle, scene::Scene)

Occlusion checker verifying is car is observable from ego It considers only other vehicles (not pedestrians, not fixed obstacles)

source
is_observable_fixed(ego::VehicleState, car::VehicleState, env::OccludedEnv)
is_observable_fixed(x::Float64, y::Float64, ego::VehicleState, env::OccludedEnv)

Occlusion checker considering only fixed obstacles in the environment:

  • isobservablefixed(ego::VehicleState, car::VehicleState, env::OccludedEnv) check if car is observable from ego
  • isobservablefixed(x::Float64, y::Float64, ego::VehicleState, env::OccludedEnv) check if x, y is observable from ego
source

Heuristic to check if a vehicle can be added to a given scene

source

Remove vehicles that have reached an end scene or that have collided

source
get_all_lanes(roadway::Roadway)

returns a list of all the lanes present in roadway

source

Returns a Frenet object of the end of the road Args: Roadway, LaneTag Returns: Frenet

source
is_crosswalk(lane::Lane)

returns true if a lane is a crosswalk

source
lane_to_segment(lane::Lane, roadway::Roadway)

Converts a lane to a LineSegment. It only works for straight lanes!

source
is_observable(ego::Vehicle, car::Vehicle, scene::Scene, env::OccludedEnv)

Check if car is observable from ego, by considering both fixed and dynamic obstacles

source