The data structure to represent roadways can be decomposed as follows:
- Roadway The high level type containing all the information. It contains a list of
RoadSegment
.- RoadSegment: a vector of lanes
- Lane: A driving lane on a roadway. It identified by a
LaneTag
. A lane is defined by a curve which represents a center line and a width. In addition it has attributed like speed limit. A lane can be connected to other lane in the roadway, the connection are specified in the exits and entrances fields.
- Lane: A driving lane on a roadway. It identified by a
- RoadSegment: a vector of lanes
Lower level types:
- Curves: A curve is a list of
CurvePt
- CurvePt: the lowest level type. It represents a point on a curve by its global position, position along the curve, curvature at this point and derivative of the curvature at this point. Other types like
CurveIndex
orCurveProjection
are used to identify a curve point along a curve.
Roadway
RoadSegment
move_along
AutomotiveDrivingModels.jl
provide high level functions to generate road networks by drawing straight road segment and circular curves. Two predefined road network can be generated easily: multi-lane straight roadway sections and a multi-lane stadium shaped roadway.
gen_straight_curve
gen_straight_segment
gen_bezier_curve
gen_straight_roadway
gen_stadium_roadway
The Lane
data structure represent a driving lane in the roadway. The default lane width is 3m. It contains all the low level geometry information.
Lane
LaneTag
lanes
lanetags
SpeedLimit
LaneBoundary
LaneConnection
is_in_exits
is_in_entrances
connect!
is_between_segments_hi
is_between_segments
has_segment
has_lanetag
next_lane
prev_lane
has_next
has_prev
next_lane_point
prev_lane_point
n_lanes_left(roadway::Roadway, lane::Lane)
n_lanes_right(roadway::Roadway, lane::Lane)
leftlane(::Roadway, ::Lane)
rightlane(::Roadway, ::Lane)
The Frenet frame is a lane relative frame to represent a position on the road network.
Frenet
The main roadway
object can be indexed by different object to access different elements
such as lane or curve points:
LaneTag
: indexing roadway by a lane tag will return the lane associated to the lane tagRoadIndex
: indexing roadway by a road index will return the curve point associated to this index
RoadIndex
CurveIndex
RoadProjection
proj(posG::VecSE2{T}, lane::Lane{T}, roadway::Roadway{T};move_along_curves::Bool = true ) where T<: Real
proj(posG::VecSE2{T}, seg::RoadSegment, roadway::Roadway) where T<: Real
proj(posG::VecSE2{T}, roadway::Roadway) where T<: Real
Base.getindex(lane::Lane{T}, ind::CurveIndex{I,T}, roadway::Roadway{T}) where{I<:Integer, T<:Real}
Base.getindex(roadway::Roadway, segid::Int)
Base.getindex(roadway::Roadway, tag::LaneTag)
Curve
CurvePt
CurveProjection
is_at_curve_end
get_lerp_time
index_closest_to_point
get_curve_index
lerp(A::VecE2{T}, B::VecE2{T}, C::VecE2{T}, D::VecE2{T}, t::T) where T<:Real
lerp(A::VecE2{T}, B::VecE2{T}, C::VecE2{T}, t::T) where T<:Real
Base.read(io::IO, ::Type{Roadway})
Base.write(io::IO, roadway::Roadway)