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

class RouteSegments More...

#include <route_segments.h>

Inheritance diagram for apollo::hdmap::RouteSegments:
Inheritance graph
Collaboration diagram for apollo::hdmap::RouteSegments:
Collaboration graph

Public Member Functions

 RouteSegments ()=default
 
routing::ChangeLaneType NextAction () const
 
void SetNextAction (routing::ChangeLaneType action)
 
routing::ChangeLaneType PreviousAction () const
 
void SetPreviousAction (routing::ChangeLaneType action)
 
bool CanExit () const
 
void SetCanExit (bool can_exit)
 
bool GetProjection (const common::PointENU &point_enu, common::SLPoint *sl_point, LaneWaypoint *waypoint) const
 
bool GetProjection (const common::math::Vec2d &point, common::SLPoint *sl_point, LaneWaypoint *waypoint) const
 
bool GetWaypoint (const double s, LaneWaypoint *waypoint) const
 
bool CanDriveFrom (const LaneWaypoint &waypoint) const
 Check whether the map allows a vehicle can reach current RouteSegment from a point on a lane (LaneWaypoint). More...
 
const LaneWaypointRouteEndWaypoint () const
 
void SetRouteEndWaypoint (const LaneWaypoint &waypoint)
 
bool Stitch (const RouteSegments &other)
 
bool Shrink (const common::math::Vec2d &point, const double look_backward, const double look_forward)
 
bool Shrink (const double s, const double look_backward, const double look_forward)
 
bool Shrink (const double s, const LaneWaypoint &waypoint, const double look_backward, const double look_forward)
 
bool IsOnSegment () const
 
void SetIsOnSegment (bool on_segment)
 
bool IsNeighborSegment () const
 
void SetIsNeighborSegment (bool is_neighbor)
 
void SetId (const std::string &id)
 
const std::string & Id () const
 
LaneWaypoint FirstWaypoint () const
 
LaneWaypoint LastWaypoint () const
 
bool IsWaypointOnSegment (const LaneWaypoint &waypoint) const
 Check if a waypoint is on segment. More...
 
bool IsConnectedSegment (const RouteSegments &other) const
 Check if we can reach the other segment from current segment just by following lane. More...
 
bool StopForDestination () const
 
void SetStopForDestination (bool stop_for_destination)
 
void SetProperties (const RouteSegments &other)
 Copy the properties of other segments to current one. More...
 

Static Public Member Functions

static bool WithinLaneSegment (const LaneSegment &lane_segment, const LaneWaypoint &waypoint)
 
static bool WithinLaneSegment (const LaneSegment &lane_segment, const routing::LaneWaypoint &waypoint)
 
static bool WithinLaneSegment (const routing::LaneSegment &lane_segment, const LaneWaypoint &waypoint)
 
static bool WithinLaneSegment (const routing::LaneSegment &lane_segment, const routing::LaneWaypoint &waypoint)
 
static double Length (const RouteSegments &segments)
 

Detailed Description

class RouteSegments

This class is a representation of the Passage type in routing.proto. It is extended from a passage region, but keeps some properties of the passage, such as the last end LaneWaypoint of the original passage region (route_end_waypoint), whether the passage can lead to another passage in routing (can_exit_). This class contains the original data that can be used to generate hdmap::Path.

Constructor & Destructor Documentation

◆ RouteSegments()

apollo::hdmap::RouteSegments::RouteSegments ( )
default

The default constructor.

Member Function Documentation

◆ CanDriveFrom()

bool apollo::hdmap::RouteSegments::CanDriveFrom ( const LaneWaypoint waypoint) const

Check whether the map allows a vehicle can reach current RouteSegment from a point on a lane (LaneWaypoint).

Parameters
waypointthe start waypoint
Returns
true if the map allows a vehicle to drive from waypoint to current RouteSegment. Otherwise false.

◆ CanExit()

bool apollo::hdmap::RouteSegments::CanExit ( ) const

Whether the passage region that generate this route segment can lead to another passage region in route.

◆ FirstWaypoint()

LaneWaypoint apollo::hdmap::RouteSegments::FirstWaypoint ( ) const

Get the first waypoint from the lane segments.

◆ GetProjection() [1/2]

bool apollo::hdmap::RouteSegments::GetProjection ( const common::PointENU &  point_enu,
common::SLPoint *  sl_point,
LaneWaypoint waypoint 
) const

Project a point to this route segment.

Parameters
point_enua map point, or point, which is a Vec2d point
sreturn the longitudinal s relative to the route segment.
lreturn the lateral distance relative to the route segment.
waypointreturn the LaneWaypoint, which has lane and lane_s on the route segment.
Returns
false if error happened or projected outside of the lane segments.

◆ GetProjection() [2/2]

bool apollo::hdmap::RouteSegments::GetProjection ( const common::math::Vec2d point,
common::SLPoint *  sl_point,
LaneWaypoint waypoint 
) const

◆ GetWaypoint()

bool apollo::hdmap::RouteSegments::GetWaypoint ( const double  s,
LaneWaypoint waypoint 
) const

◆ Id()

const std::string& apollo::hdmap::RouteSegments::Id ( ) const

◆ IsConnectedSegment()

bool apollo::hdmap::RouteSegments::IsConnectedSegment ( const RouteSegments other) const

Check if we can reach the other segment from current segment just by following lane.

Parameters
otherAnother route segment

◆ IsNeighborSegment()

bool apollo::hdmap::RouteSegments::IsNeighborSegment ( ) const

◆ IsOnSegment()

bool apollo::hdmap::RouteSegments::IsOnSegment ( ) const

◆ IsWaypointOnSegment()

bool apollo::hdmap::RouteSegments::IsWaypointOnSegment ( const LaneWaypoint waypoint) const

Check if a waypoint is on segment.

◆ LastWaypoint()

LaneWaypoint apollo::hdmap::RouteSegments::LastWaypoint ( ) const

Get the last waypoint from the lane segments.

◆ Length()

static double apollo::hdmap::RouteSegments::Length ( const RouteSegments segments)
static

◆ NextAction()

routing::ChangeLaneType apollo::hdmap::RouteSegments::NextAction ( ) const

Get the next change lane action need to take by the vehicle, if the vehicle is on this RouteSegments. — If the vehicle does not need to change lane, then change_lane_type == routing::FORWARD; — If the vehicle need to change to left lane according to routing, then change_lane_type_ == routing::LEFT; — If the vehicle need to change to right lane according to routing, then change_lane_type_ == routing::RIGHT;

◆ PreviousAction()

routing::ChangeLaneType apollo::hdmap::RouteSegments::PreviousAction ( ) const

Get the previous change lane action need to take by the vehicle to reach current segment, if the vehicle is not on this RouteSegments. If the vehicle is already on this segment, or does not need to change lane to reach this segment, then change_lane_type = routing::FORWARD; If the vehicle need to change to left to reach this segment, then change_lane_type_ = routing::LEFT; If the vehicle need to change to right to reach this segment, then change_lane_type_ = routing::RIGHT;

◆ RouteEndWaypoint()

const LaneWaypoint& apollo::hdmap::RouteSegments::RouteEndWaypoint ( ) const

◆ SetCanExit()

void apollo::hdmap::RouteSegments::SetCanExit ( bool  can_exit)

◆ SetId()

void apollo::hdmap::RouteSegments::SetId ( const std::string &  id)

◆ SetIsNeighborSegment()

void apollo::hdmap::RouteSegments::SetIsNeighborSegment ( bool  is_neighbor)

◆ SetIsOnSegment()

void apollo::hdmap::RouteSegments::SetIsOnSegment ( bool  on_segment)

◆ SetNextAction()

void apollo::hdmap::RouteSegments::SetNextAction ( routing::ChangeLaneType  action)

◆ SetPreviousAction()

void apollo::hdmap::RouteSegments::SetPreviousAction ( routing::ChangeLaneType  action)

◆ SetProperties()

void apollo::hdmap::RouteSegments::SetProperties ( const RouteSegments other)

Copy the properties of other segments to current one.

◆ SetRouteEndWaypoint()

void apollo::hdmap::RouteSegments::SetRouteEndWaypoint ( const LaneWaypoint waypoint)

◆ SetStopForDestination()

void apollo::hdmap::RouteSegments::SetStopForDestination ( bool  stop_for_destination)

◆ Shrink() [1/3]

bool apollo::hdmap::RouteSegments::Shrink ( const common::math::Vec2d point,
const double  look_backward,
const double  look_forward 
)

◆ Shrink() [2/3]

bool apollo::hdmap::RouteSegments::Shrink ( const double  s,
const double  look_backward,
const double  look_forward 
)

◆ Shrink() [3/3]

bool apollo::hdmap::RouteSegments::Shrink ( const double  s,
const LaneWaypoint waypoint,
const double  look_backward,
const double  look_forward 
)

◆ Stitch()

bool apollo::hdmap::RouteSegments::Stitch ( const RouteSegments other)

Stitch current route segments with the other route segment. Example 1 this: |-----—A--—x--—B---—| other: |--—B---—x-----—C----—| Result: |-----—A--—x--—B---—x-----—C----—| In the above example, A-B is current route segments, and B-C is the other route segments. We update current route segments to A-B-C.

Example 2 this: |--—A---—x-----—B----—| other: |-----—C--—x--—A---—| Result: |-----—C--—x--—A---—x-----—B----—| In the above example, A-B is current route segments, and C-A is the other route segments. We update current route segments to C-A-B

Returns
false if these two reference line cannot be stitched

◆ StopForDestination()

bool apollo::hdmap::RouteSegments::StopForDestination ( ) const

◆ WithinLaneSegment() [1/4]

static bool apollo::hdmap::RouteSegments::WithinLaneSegment ( const LaneSegment lane_segment,
const LaneWaypoint waypoint 
)
static

◆ WithinLaneSegment() [2/4]

static bool apollo::hdmap::RouteSegments::WithinLaneSegment ( const LaneSegment lane_segment,
const routing::LaneWaypoint &  waypoint 
)
static

◆ WithinLaneSegment() [3/4]

static bool apollo::hdmap::RouteSegments::WithinLaneSegment ( const routing::LaneSegment &  lane_segment,
const LaneWaypoint waypoint 
)
static

◆ WithinLaneSegment() [4/4]

static bool apollo::hdmap::RouteSegments::WithinLaneSegment ( const routing::LaneSegment &  lane_segment,
const routing::LaneWaypoint &  waypoint 
)
static

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