Apollo  6.0
Open source self driving car software
Static Public Member Functions | List of all members
apollo::prediction::PredictionMap Class Reference

#include <prediction_map.h>

Collaboration diagram for apollo::prediction::PredictionMap:
Collaboration graph

Static Public Member Functions

static bool Ready ()
 Check if map is ready. More...
 
static Eigen::Vector2d PositionOnLane (const std::shared_ptr< const hdmap::LaneInfo > lane_info, const double s)
 Get the position of a point on a specific distance along a lane. More...
 
static double HeadingOnLane (const std::shared_ptr< const hdmap::LaneInfo > lane_info, const double s)
 Get the heading of a point on a specific distance along a lane. More...
 
static double CurvatureOnLane (const std::string &lane_id, const double s)
 Get the curvature of a point on a specific distance along a lane. More...
 
static double LaneTotalWidth (const std::shared_ptr< const hdmap::LaneInfo > lane_info, const double s)
 Get the width on a specified distance on a lane. More...
 
static std::shared_ptr< const hdmap::LaneInfoLaneById (const std::string &id)
 Get a shared pointer to a lane by lane ID. More...
 
static std::shared_ptr< const hdmap::JunctionInfoJunctionById (const std::string &id)
 Get a shared pointer to a junction by junction ID. More...
 
static std::shared_ptr< const hdmap::OverlapInfoOverlapById (const std::string &id)
 Get a shared pointer to an overlap by overlap ID. More...
 
static bool GetProjection (const Eigen::Vector2d &position, const std::shared_ptr< const hdmap::LaneInfo > lane_info, double *s, double *l)
 Get the frenet coordinates (s, l) on a lane by a position. More...
 
static bool HasNearbyLane (const double x, const double y, const double radius)
 If there is a lane in the range with radius. More...
 
static bool ProjectionFromLane (std::shared_ptr< const hdmap::LaneInfo > lane_info, const double s, hdmap::MapPathPoint *path_point)
 Get the nearest path point to a longitudinal coordinate on a lane. More...
 
static bool IsVirtualLane (const std::string &lane_id)
 Determine if a lane is a virtual lane. More...
 
static bool OnVirtualLane (const Eigen::Vector2d &position, const double radius)
 Determine if a point is on a virtual lane. More...
 
static void OnLane (const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &prev_lanes, const Eigen::Vector2d &point, const double heading, const double radius, const bool on_lane, const int max_num_lane, const double max_lane_angle_diff, std::vector< std::shared_ptr< const hdmap::LaneInfo >> *lanes)
 Get the connected lanes from some specified lanes. More...
 
static std::shared_ptr< const apollo::hdmap::LaneInfoGetMostLikelyCurrentLane (const common::PointENU &position, const double radius, const double heading, const double angle_diff_threshold)
 Get the lane that the position is on with minimal angle diff. More...
 
static bool IsProjectionApproximateWithinLane (const Eigen::Vector2d &ego_position, const std::string &lane_id)
 Check whether the projection of ego vehicle is on the target lane. Note: the direction of the lane is approximated by the terminal points. More...
 
static bool NearJunction (const Eigen::Vector2d &point, const double radius)
 Check if there are any junctions within the range centered at a certain point with a radius. More...
 
static bool IsPointInJunction (const double x, const double y, const std::shared_ptr< const hdmap::JunctionInfo > junction_info_ptr)
 Check if a point with coord x and y is in the junction. More...
 
static bool InJunction (const Eigen::Vector2d &point, const double radius)
 Check if the obstacle is in a junction. More...
 
static bool IsLaneInJunction (const std::shared_ptr< const hdmap::LaneInfo > lane_info, const std::string &junction_id)
 Check if a lane is in a junction. More...
 
static std::vector< std::shared_ptr< const apollo::hdmap::JunctionInfo > > GetJunctions (const Eigen::Vector2d &point, const double radius)
 Get a list of junctions given a point and a search radius. More...
 
static std::vector< std::shared_ptr< const apollo::hdmap::PNCJunctionInfo > > GetPNCJunctions (const Eigen::Vector2d &point, const double radius)
 Get a list of junctions given a point and a search radius. More...
 
static double PathHeading (std::shared_ptr< const hdmap::LaneInfo > lane_info, const common::PointENU &point)
 Get the lane heading on a point. More...
 
static bool SmoothPointFromLane (const std::string &id, const double s, const double l, Eigen::Vector2d *point, double *heading)
 Get the smooth point on a lane by a longitudinal coordinate. More...
 
static void NearbyLanesByCurrentLanes (const Eigen::Vector2d &point, const double heading, const double radius, const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lanes, const int max_num_lane, std::vector< std::shared_ptr< const hdmap::LaneInfo >> *nearby_lanes)
 Get nearby lanes by a position and current lanes. More...
 
static std::shared_ptr< const hdmap::LaneInfoGetLeftNeighborLane (const std::shared_ptr< const hdmap::LaneInfo > &ptr_ego_lane, const Eigen::Vector2d &ego_position, const double threshold)
 
static std::shared_ptr< const hdmap::LaneInfoGetRightNeighborLane (const std::shared_ptr< const hdmap::LaneInfo > &ptr_ego_lane, const Eigen::Vector2d &ego_position, const double threshold)
 
static std::vector< std::string > NearbyLaneIds (const Eigen::Vector2d &point, const double radius)
 Get nearby lanes by a position. More...
 
static bool IsLeftNeighborLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, std::shared_ptr< const hdmap::LaneInfo > curr_lane)
 Check if a lane is a left neighbor of another lane. More...
 
static bool IsLeftNeighborLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lanes)
 Check if the target lane is a left neighbor of one of some lanes. More...
 
static bool IsRightNeighborLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, std::shared_ptr< const hdmap::LaneInfo > curr_lane)
 Check if a lane is a right neighbor of another lane. More...
 
static bool IsRightNeighborLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lanes)
 Check if the target lane is a right neighbor of one of some lanes. More...
 
static bool IsSuccessorLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, std::shared_ptr< const hdmap::LaneInfo > curr_lane)
 Check if the target lane is a successor of another lane. More...
 
static bool IsSuccessorLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lanes)
 Check if the target lane is a successor of one of some lanes. More...
 
static bool IsPredecessorLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, std::shared_ptr< const hdmap::LaneInfo > curr_lane)
 Check if the target lane is a predecessor of another lane. More...
 
static bool IsPredecessorLane (std::shared_ptr< const hdmap::LaneInfo > target_lane, const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lanes)
 Check if the target lane is a predecessor of one of some lanes. More...
 
static bool IsIdenticalLane (std::shared_ptr< const hdmap::LaneInfo > other_lane, std::shared_ptr< const hdmap::LaneInfo > curr_lane)
 Check if two lanes are identical. More...
 
static bool IsIdenticalLane (std::shared_ptr< const hdmap::LaneInfo > other_lane, const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lanes)
 Check if a lane is identical to one of some lanes. More...
 
static int LaneTurnType (const std::string &lane_id)
 Get lane turn type. More...
 
static std::vector< std::shared_ptr< const hdmap::LaneInfo > > GetNearbyLanes (const common::PointENU &position, const double nearby_radius)
 Get all nearby lanes within certain radius given a position. More...
 
static std::shared_ptr< const hdmap::LaneInfoLaneWithSmallestAverageCurvature (const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &lane_infos)
 Get the pointer to the lane with the smallest average curvature. More...
 
static double AverageCurvature (const std::string &lane_id, const size_t sample_size)
 Get the average curvature along a lane with the ID lane_id. More...
 

Member Function Documentation

◆ AverageCurvature()

static double apollo::prediction::PredictionMap::AverageCurvature ( const std::string &  lane_id,
const size_t  sample_size 
)
static

Get the average curvature along a lane with the ID lane_id.

Parameters
TheID of the lane
Thesize of samples alone the lane to compute the average curvature
Returns
The average curvature

◆ CurvatureOnLane()

static double apollo::prediction::PredictionMap::CurvatureOnLane ( const std::string &  lane_id,
const double  s 
)
static

Get the curvature of a point on a specific distance along a lane.

Parameters
lane_iidThe id of the lane to get a curvature.
sThe distance along the lane.
Returns
The curvature of the point.

◆ GetJunctions()

static std::vector<std::shared_ptr<const apollo::hdmap::JunctionInfo> > apollo::prediction::PredictionMap::GetJunctions ( const Eigen::Vector2d &  point,
const double  radius 
)
static

Get a list of junctions given a point and a search radius.

Parameters
Point
Searchradius
Returns
A list of junctions

◆ GetLeftNeighborLane()

static std::shared_ptr<const hdmap::LaneInfo> apollo::prediction::PredictionMap::GetLeftNeighborLane ( const std::shared_ptr< const hdmap::LaneInfo > &  ptr_ego_lane,
const Eigen::Vector2d &  ego_position,
const double  threshold 
)
static

◆ GetMostLikelyCurrentLane()

static std::shared_ptr<const apollo::hdmap::LaneInfo> apollo::prediction::PredictionMap::GetMostLikelyCurrentLane ( const common::PointENU &  position,
const double  radius,
const double  heading,
const double  angle_diff_threshold 
)
static

Get the lane that the position is on with minimal angle diff.

Parameters
positionthe position of an obstacle
radiusThe searching radius
headingThe specified heading
angle_diff_thresholdThreshold of angle diff
Returns
A pointer to a lane info

◆ GetNearbyLanes()

static std::vector<std::shared_ptr<const hdmap::LaneInfo> > apollo::prediction::PredictionMap::GetNearbyLanes ( const common::PointENU &  position,
const double  nearby_radius 
)
static

Get all nearby lanes within certain radius given a position.

Parameters
positionPosition in ENU frame
nearyby_radiusSearch radius around the given position
Returns
All nearby lanes within the radius

◆ GetPNCJunctions()

static std::vector<std::shared_ptr<const apollo::hdmap::PNCJunctionInfo> > apollo::prediction::PredictionMap::GetPNCJunctions ( const Eigen::Vector2d &  point,
const double  radius 
)
static

Get a list of junctions given a point and a search radius.

Parameters
Point
Searchradius
Returns
A list of junctions

◆ GetProjection()

static bool apollo::prediction::PredictionMap::GetProjection ( const Eigen::Vector2d &  position,
const std::shared_ptr< const hdmap::LaneInfo lane_info,
double *  s,
double *  l 
)
static

Get the frenet coordinates (s, l) on a lane by a position.

Parameters
positionThe position to get its frenet coordinates.
lane_infoThe lane on which to get the frenet coordinates.
sThe longitudinal coordinate of the position.
lThe lateral coordinate of the position.

◆ GetRightNeighborLane()

static std::shared_ptr<const hdmap::LaneInfo> apollo::prediction::PredictionMap::GetRightNeighborLane ( const std::shared_ptr< const hdmap::LaneInfo > &  ptr_ego_lane,
const Eigen::Vector2d &  ego_position,
const double  threshold 
)
static

◆ HasNearbyLane()

static bool apollo::prediction::PredictionMap::HasNearbyLane ( const double  x,
const double  y,
const double  radius 
)
static

If there is a lane in the range with radius.

Parameters
xx-axis coordinate
yy-axis coordinate
radiusrange radius
Returns
If there is a lane in the range with radius

◆ HeadingOnLane()

static double apollo::prediction::PredictionMap::HeadingOnLane ( const std::shared_ptr< const hdmap::LaneInfo lane_info,
const double  s 
)
static

Get the heading of a point on a specific distance along a lane.

Parameters
lane_infoThe lane to get a heading.
sThe distance along the lane.
Returns
The heading of the point.

◆ InJunction()

static bool apollo::prediction::PredictionMap::InJunction ( const Eigen::Vector2d &  point,
const double  radius 
)
static

Check if the obstacle is in a junction.

Parameters
pointposition
radiusthe radius to search candidate junctions
Returns
If the obstacle is in a junction.

◆ IsIdenticalLane() [1/2]

static bool apollo::prediction::PredictionMap::IsIdenticalLane ( std::shared_ptr< const hdmap::LaneInfo other_lane,
std::shared_ptr< const hdmap::LaneInfo curr_lane 
)
static

Check if two lanes are identical.

Parameters
other_laneThe other lane.
curr_laneThe current lane.
Returns
If other_lane is identical to curr_lane.

◆ IsIdenticalLane() [2/2]

static bool apollo::prediction::PredictionMap::IsIdenticalLane ( std::shared_ptr< const hdmap::LaneInfo other_lane,
const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lanes 
)
static

Check if a lane is identical to one of some lanes.

Parameters
other_laneThe other lane.
lanesThe lanes.
Returns
If other_lane is identical to one of lanes.

◆ IsLaneInJunction()

static bool apollo::prediction::PredictionMap::IsLaneInJunction ( const std::shared_ptr< const hdmap::LaneInfo lane_info,
const std::string &  junction_id 
)
static

Check if a lane is in a junction.

Parameters
lane
junctionid
Returns
If the lane is in the junction

◆ IsLeftNeighborLane() [1/2]

static bool apollo::prediction::PredictionMap::IsLeftNeighborLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
std::shared_ptr< const hdmap::LaneInfo curr_lane 
)
static

Check if a lane is a left neighbor of another lane.

Parameters
target_laneThe lane to check if it is a left neighbor.
curr_laneThe current lane.
Returns
If left_lane is a left neighbor of curr_lane.

◆ IsLeftNeighborLane() [2/2]

static bool apollo::prediction::PredictionMap::IsLeftNeighborLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lanes 
)
static

Check if the target lane is a left neighbor of one of some lanes.

Parameters
target_laneThe lane to check if it is a left neighbor.
lanesThe current lanes.
Returns
If left_lane is a left neighbor of one of lanes.

◆ IsPointInJunction()

static bool apollo::prediction::PredictionMap::IsPointInJunction ( const double  x,
const double  y,
const std::shared_ptr< const hdmap::JunctionInfo junction_info_ptr 
)
static

Check if a point with coord x and y is in the junction.

Parameters
Xaxis coordinate.
Yaxis coordinate.
Apointer to junction info.
Returns
If the point is in the junction.

◆ IsPredecessorLane() [1/2]

static bool apollo::prediction::PredictionMap::IsPredecessorLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
std::shared_ptr< const hdmap::LaneInfo curr_lane 
)
static

Check if the target lane is a predecessor of another lane.

Parameters
target_laneThe lane to check if it is a predecessor.
curr_laneThe current lane.
Returns
If pred_lane is a predecessor of curr_lane.

◆ IsPredecessorLane() [2/2]

static bool apollo::prediction::PredictionMap::IsPredecessorLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lanes 
)
static

Check if the target lane is a predecessor of one of some lanes.

Parameters
target_laneThe lane to check if it is a predecessor.
lanesThe current lanes.
Returns
If pred_lane is a predecessor of one of lanes.

◆ IsProjectionApproximateWithinLane()

static bool apollo::prediction::PredictionMap::IsProjectionApproximateWithinLane ( const Eigen::Vector2d &  ego_position,
const std::string &  lane_id 
)
static

Check whether the projection of ego vehicle is on the target lane. Note: the direction of the lane is approximated by the terminal points.

Parameters
ego_positionThe position of the ego vehicle
lane_idThe target lane to project
Returns
true if the projection of ego vehicle is within the lane range; false otherwise.

◆ IsRightNeighborLane() [1/2]

static bool apollo::prediction::PredictionMap::IsRightNeighborLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
std::shared_ptr< const hdmap::LaneInfo curr_lane 
)
static

Check if a lane is a right neighbor of another lane.

Parameters
target_laneThe lane to check if it is a right neighbor.
curr_laneThe current lane.
Returns
If right_lane is a right neighbor of curr_lane.

◆ IsRightNeighborLane() [2/2]

static bool apollo::prediction::PredictionMap::IsRightNeighborLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lanes 
)
static

Check if the target lane is a right neighbor of one of some lanes.

Parameters
target_laneThe lane to check if it is a right neighbor.
lanesThe current lanes.
Returns
If right_lane is a right neighbor of one of lanes.

◆ IsSuccessorLane() [1/2]

static bool apollo::prediction::PredictionMap::IsSuccessorLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
std::shared_ptr< const hdmap::LaneInfo curr_lane 
)
static

Check if the target lane is a successor of another lane.

Parameters
target_laneThe lane to check if it is a successor.
curr_laneThe current lane.
Returns
If succ_lane is a successor of curr_lane.

◆ IsSuccessorLane() [2/2]

static bool apollo::prediction::PredictionMap::IsSuccessorLane ( std::shared_ptr< const hdmap::LaneInfo target_lane,
const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lanes 
)
static

Check if the target lane is a successor of one of some lanes.

Parameters
target_laneThe lane to check if it is a successor.
lanesThe current lanes.
Returns
If succ_lane is a successor of one of lanes.

◆ IsVirtualLane()

static bool apollo::prediction::PredictionMap::IsVirtualLane ( const std::string &  lane_id)
static

Determine if a lane is a virtual lane.

Parameters
Thelane ID of the lane.
Returns
If the lane is a virtual lane.

◆ JunctionById()

static std::shared_ptr<const hdmap::JunctionInfo> apollo::prediction::PredictionMap::JunctionById ( const std::string &  id)
static

Get a shared pointer to a junction by junction ID.

Parameters
idThe ID of the target junction ID in the form of string.
Returns
A shared pointer to the junction with the input junction ID.

◆ LaneById()

static std::shared_ptr<const hdmap::LaneInfo> apollo::prediction::PredictionMap::LaneById ( const std::string &  id)
static

Get a shared pointer to a lane by lane ID.

Parameters
idThe ID of the target lane ID in the form of string.
Returns
A shared pointer to the lane with the input lane ID.

◆ LaneTotalWidth()

static double apollo::prediction::PredictionMap::LaneTotalWidth ( const std::shared_ptr< const hdmap::LaneInfo lane_info,
const double  s 
)
static

Get the width on a specified distance on a lane.

Parameters
lane_infoThe lane to get the width.
sThe distance along the lane.
Returns
The width on the distance s.

◆ LaneTurnType()

static int apollo::prediction::PredictionMap::LaneTurnType ( const std::string &  lane_id)
static

Get lane turn type.

Parameters
lane_idThe lane ID.
Returns
Integer corresponding to the lane turn type.

◆ LaneWithSmallestAverageCurvature()

static std::shared_ptr<const hdmap::LaneInfo> apollo::prediction::PredictionMap::LaneWithSmallestAverageCurvature ( const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lane_infos)
static

Get the pointer to the lane with the smallest average curvature.

Parameters
Thevector of lane infos
Returns
The pointer to the lane with the smallest average curvature

◆ NearbyLaneIds()

static std::vector<std::string> apollo::prediction::PredictionMap::NearbyLaneIds ( const Eigen::Vector2d &  point,
const double  radius 
)
static

Get nearby lanes by a position.

Parameters
pointThe position to search its nearby lanes.
radiusThe searching radius.
Returns
A vector of nearby lane IDs.

◆ NearbyLanesByCurrentLanes()

static void apollo::prediction::PredictionMap::NearbyLanesByCurrentLanes ( const Eigen::Vector2d &  point,
const double  heading,
const double  radius,
const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  lanes,
const int  max_num_lane,
std::vector< std::shared_ptr< const hdmap::LaneInfo >> *  nearby_lanes 
)
static

Get nearby lanes by a position and current lanes.

Parameters
pointThe position to search its nearby lanes.
headingThe heading of an obstacle.
radiusThe searching radius.
lanesThe current lanes.
nearby_lanesThe searched nearby lanes.

◆ NearJunction()

static bool apollo::prediction::PredictionMap::NearJunction ( const Eigen::Vector2d &  point,
const double  radius 
)
static

Check if there are any junctions within the range centered at a certain point with a radius.

Parameters
pointThe position.
radiusThe radius to search junctions.
Returns
If any junctions exist.

◆ OnLane()

static void apollo::prediction::PredictionMap::OnLane ( const std::vector< std::shared_ptr< const hdmap::LaneInfo >> &  prev_lanes,
const Eigen::Vector2d &  point,
const double  heading,
const double  radius,
const bool  on_lane,
const int  max_num_lane,
const double  max_lane_angle_diff,
std::vector< std::shared_ptr< const hdmap::LaneInfo >> *  lanes 
)
static

Get the connected lanes from some specified lanes.

Parameters
prev_lanesThe lanes from which to search their connected lanes.
headingThe specified heading.
radiusThe searching radius.
on_laneIf the position is on lane.
lanesThe searched lanes.

◆ OnVirtualLane()

static bool apollo::prediction::PredictionMap::OnVirtualLane ( const Eigen::Vector2d &  position,
const double  radius 
)
static

Determine if a point is on a virtual lane.

Parameters
Thepoint coordinate.
Returns
If the point is on a virtual lane.

◆ OverlapById()

static std::shared_ptr<const hdmap::OverlapInfo> apollo::prediction::PredictionMap::OverlapById ( const std::string &  id)
static

Get a shared pointer to an overlap by overlap ID.

Parameters
idThe ID of the target overlap ID in the form of string.
Returns
A shared pointer to the overlap with the input overlap ID.

◆ PathHeading()

static double apollo::prediction::PredictionMap::PathHeading ( std::shared_ptr< const hdmap::LaneInfo lane_info,
const common::PointENU &  point 
)
static

Get the lane heading on a point.

Parameters
lane_infoThe target lane.
pointThe point to get the heading.
Returns
The heading of the input point on the input lane.

◆ PositionOnLane()

static Eigen::Vector2d apollo::prediction::PredictionMap::PositionOnLane ( const std::shared_ptr< const hdmap::LaneInfo lane_info,
const double  s 
)
static

Get the position of a point on a specific distance along a lane.

Parameters
lane_infoThe lane to get a position.
sThe distance along the lane.
Returns
The position with coordinates.

◆ ProjectionFromLane()

static bool apollo::prediction::PredictionMap::ProjectionFromLane ( std::shared_ptr< const hdmap::LaneInfo lane_info,
const double  s,
hdmap::MapPathPoint path_point 
)
static

Get the nearest path point to a longitudinal coordinate on a lane.

Parameters
lane_infoThe lane on which to get the projected point.
sThe longitudinal coordinate.
path_pointThe nearest path point.
Ifthe process is successful.

◆ Ready()

static bool apollo::prediction::PredictionMap::Ready ( )
static

Check if map is ready.

Returns
True if map is ready

◆ SmoothPointFromLane()

static bool apollo::prediction::PredictionMap::SmoothPointFromLane ( const std::string &  id,
const double  s,
const double  l,
Eigen::Vector2d *  point,
double *  heading 
)
static

Get the smooth point on a lane by a longitudinal coordinate.

Parameters
idThe lane ID.
sThe longitudinal coordinate along the lane.
lThe lateral coordinate of the position.
pointThe point corresponding to the s,l-value coordinate.
headingThe lane heading on the point.
Returns
If the process is successful.

The documentation for this class was generated from the following file: