verse.map.lane_segment_3d.StraightLane_3d
- class verse.map.lane_segment_3d.StraightLane_3d(id: str, start: ndarray | Sequence[float], end: ndarray | Sequence[float], width: float = 4, line_types: Tuple[LineType_3d, LineType_3d] = None, forbidden: bool = False, speed_limit: float = 20, priority: int = 0)
Bases:
AbstractLane_3d
A lane going in straight line.
Methods
altitude
()Get the lane altitude (avg z of the start and end point)
distance
(position)Compute the L1 distance [m] from a position to the lane.
distance_with_heading
(position, heading[, ...])Compute a weighted distance in position and heading to the lane.
from_config
(config)Create lane instance from config
heading_at
(longitudinal)Get the lane heading at a given longitudinal lane coordinate.
is_reachable_from
(position)Whether the lane is reachable from a given world position
local_coordinates
(position)Convert a world position to local lane coordinates.
alias of
ABCMeta
on_lane
(position[, longitudinal, lateral, ...])Whether a given world position is on the lane.
position
(longitudinal, lateral, theta)Convert local lane coordinates to a world position.
Write lane parameters to dict which can be serialized to json
width_at
(longitudinal)Get the lane width at a given longitudinal lane coordinate.
after_end
get_lane_center
get_sample_points
get_tang
- __init__(id: str, start: ndarray | Sequence[float], end: ndarray | Sequence[float], width: float = 4, line_types: Tuple[LineType_3d, LineType_3d] = None, forbidden: bool = False, speed_limit: float = 20, priority: int = 0) None
New straight lane.
- Parameters:
start – the lane starting position [m]
end – the lane ending position [m]
width – the lane width [m]
line_types – the type of lines on both sides of the lane
forbidden – is changing to this lane forbidden
priority – priority level of the lane, for determining who has right of way
- altitude()
Get the lane altitude (avg z of the start and end point)
- Returns:
the lane altitude [m]
- distance(position: ndarray)
Compute the L1 distance [m] from a position to the lane.
- distance_with_heading(position: ndarray, heading: float | None, heading_weight: float = 1.0)
Compute a weighted distance in position and heading to the lane.
- classmethod from_config(config: dict)
Create lane instance from config
- Parameters:
config – json dict with lane parameters
- abstract heading_at(longitudinal: float) float
Get the lane heading at a given longitudinal lane coordinate.
- Parameters:
longitudinal – longitudinal lane coordinate [m]
- Returns:
the lane heading [rad]
- is_reachable_from(position: ndarray) bool
Whether the lane is reachable from a given world position
- Parameters:
position – the world position [m]
- Returns:
is the lane reachable?
- local_coordinates(position: ndarray) Tuple[float, float, float]
Convert a world position to local lane coordinates.
- Parameters:
position – a world position [m]
- Returns:
the (longitudinal, lateral) lane coordinates [m]
- metaclass__
alias of
ABCMeta
- on_lane(position: ndarray, longitudinal: float = None, lateral: float = None, margin: float = 0) bool
Whether a given world position is on the lane.
- Parameters:
position – a world position [m]
longitudinal – (optional) the corresponding longitudinal lane coordinate, if known [m]
lateral – (optional) the corresponding lateral lane coordinate, if known [m]
margin – (optional) a supplementary margin around the lane width
- Returns:
is the position on the lane?
- position(longitudinal: float, lateral: float, theta: float) ndarray
Convert local lane coordinates to a world position.
- Parameters:
longitudinal – longitudinal lane coordinate [m]
lateral – lateral lane coordinate [m]
- Returns:
the corresponding world position [m]
- to_config() dict
Write lane parameters to dict which can be serialized to json
- Returns:
dict of lane parameters
- width_at(longitudinal: float) float
Get the lane width at a given longitudinal lane coordinate.
- Parameters:
longitudinal – longitudinal lane coordinate [m]
- Returns:
the lane width [m]