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

#include <st_boundary.h>

Inheritance diagram for apollo::planning::STBoundary:
Inheritance graph
Collaboration diagram for apollo::planning::STBoundary:
Collaboration graph

Public Types

enum  BoundaryType {
  BoundaryType::UNKNOWN, BoundaryType::STOP, BoundaryType::FOLLOW, BoundaryType::YIELD,
  BoundaryType::OVERTAKE, BoundaryType::KEEP_CLEAR
}
 

Public Member Functions

 STBoundary ()=default
 
 STBoundary (const std::vector< std::pair< STPoint, STPoint >> &point_pairs, bool is_accurate_boundary=false)
 
 STBoundary (const common::math::Box2d &box)=delete
 
 STBoundary (std::vector< common::math::Vec2d > points)=delete
 
 ~STBoundary ()=default
 Default destructor. More...
 
bool IsEmpty () const
 
bool GetUnblockSRange (const double curr_time, double *s_upper, double *s_lower) const
 
bool GetBoundarySRange (const double curr_time, double *s_upper, double *s_lower) const
 
bool GetBoundarySlopes (const double curr_time, double *ds_upper, double *ds_lower) const
 
BoundaryType boundary_type () const
 
const std::string & id () const
 
double characteristic_length () const
 
void set_id (const std::string &id)
 
void SetBoundaryType (const BoundaryType &boundary_type)
 
void SetCharacteristicLength (const double characteristic_length)
 
double min_s () const
 
double min_t () const
 
double max_s () const
 
double max_t () const
 
std::vector< STPointupper_points () const
 
std::vector< STPointlower_points () const
 
bool IsPointInBoundary (const STPoint &st_point) const
 
STBoundary ExpandByS (const double s) const
 
STBoundary ExpandByT (const double t) const
 
STBoundary CutOffByT (const double t) const
 
STPoint upper_left_point () const
 
STPoint upper_right_point () const
 
STPoint bottom_left_point () const
 
STPoint bottom_right_point () const
 
void set_upper_left_point (STPoint st_point)
 
void set_upper_right_point (STPoint st_point)
 
void set_bottom_left_point (STPoint st_point)
 
void set_bottom_right_point (STPoint st_point)
 
void set_obstacle_road_right_ending_t (double road_right_ending_t)
 
double obstacle_road_right_ending_t () const
 
- Public Member Functions inherited from apollo::common::math::Polygon2d
 Polygon2d ()=default
 Empty constructor. More...
 
 Polygon2d (const Box2d &box)
 Constructor which takes a box. More...
 
 Polygon2d (std::vector< Vec2d > points)
 Constructor which takes a vector of points as its vertices. More...
 
const std::vector< Vec2d > & points () const
 Get the vertices of the polygon. More...
 
const std::vector< LineSegment2d > & line_segments () const
 Get the edges of the polygon. More...
 
int num_points () const
 Get the number of vertices of the polygon. More...
 
bool is_convex () const
 Check if the polygon is convex. More...
 
double area () const
 Get the area of the polygon. More...
 
double DistanceToBoundary (const Vec2d &point) const
 Compute the distance from a point to the boundary of the polygon. This distance is equal to the minimal distance from the point to the edges of the polygon. More...
 
double DistanceTo (const Vec2d &point) const
 Compute the distance from a point to the polygon. If the point is within the polygon, return 0. Otherwise, this distance is the minimal distance from the point to the edges of the polygon. More...
 
double DistanceTo (const LineSegment2d &line_segment) const
 Compute the distance from a line segment to the polygon. If the line segment is within the polygon, or it has intersect with the polygon, return 0. Otherwise, this distance is the minimal distance between the distances from the two ends of the line segment to the polygon. More...
 
double DistanceTo (const Box2d &box) const
 Compute the distance from a box to the polygon. If the box is within the polygon, or it has overlap with the polygon, return 0. Otherwise, this distance is the minimal distance among the distances from the edges of the box to the polygon. More...
 
double DistanceTo (const Polygon2d &polygon) const
 Compute the distance from another polygon to the polygon. If the other polygon is within this polygon, or it has overlap with this polygon, return 0. Otherwise, this distance is the minimal distance among the distances from the edges of the other polygon to this polygon. More...
 
double DistanceSquareTo (const Vec2d &point) const
 Compute the square of distance from a point to the polygon. If the point is within the polygon, return 0. Otherwise, this square of distance is the minimal square of distance from the point to the edges of the polygon. More...
 
bool IsPointIn (const Vec2d &point) const
 Check if a point is within the polygon. More...
 
bool IsPointOnBoundary (const Vec2d &point) const
 Check if a point is on the boundary of the polygon. More...
 
bool Contains (const LineSegment2d &line_segment) const
 Check if the polygon contains a line segment. More...
 
bool Contains (const Polygon2d &polygon) const
 Check if the polygon contains another polygon. More...
 
bool HasOverlap (const LineSegment2d &line_segment) const
 Check if a line segment has overlap with this polygon. More...
 
bool GetOverlap (const LineSegment2d &line_segment, Vec2d *const first, Vec2d *const last) const
 Get the overlap of a line segment and this polygon. If they have overlap, output the two ends of the overlapped line segment. More...
 
void GetAllVertices (std::vector< Vec2d > *const vertices) const
 Get all vertices of the polygon. More...
 
std::vector< Vec2dGetAllVertices () const
 Get all vertices of the polygon. More...
 
std::vector< LineSegment2dGetAllOverlaps (const LineSegment2d &line_segment) const
 Get all overlapped line segments of a line segment and this polygon. There are possibly multiple overlapped line segments if this polygon is not convex. More...
 
bool HasOverlap (const Polygon2d &polygon) const
 Check if this polygon has overlap with another polygon. More...
 
bool ComputeOverlap (const Polygon2d &other_polygon, Polygon2d *const overlap_polygon) const
 Compute the overlap of this polygon and the other polygon if any. Note: this function only works for computing overlap between two convex polygons. More...
 
double ComputeIoU (const Polygon2d &other_polygon) const
 Compute intersection over union ratio of this polygon and the other polygon. Note: this function only works for computing overlap between two convex polygons. More...
 
AABox2d AABoundingBox () const
 Get the axis-aligned bound box of the polygon. More...
 
Box2d BoundingBoxWithHeading (const double heading) const
 Get the bound box according to a heading. More...
 
Box2d MinAreaBoundingBox () const
 Get the bounding box with the minimal area. More...
 
void ExtremePoints (const double heading, Vec2d *const first, Vec2d *const last) const
 Get the extreme points along a heading direction. More...
 
Polygon2d ExpandByDistance (const double distance) const
 Expand this polygon by a distance. More...
 
std::string DebugString () const
 Get a string containing essential information about the polygon for debugging purpose. More...
 
double min_x () const
 
double max_x () const
 
double min_y () const
 
double max_y () const
 

Static Public Member Functions

static STBoundary CreateInstance (const std::vector< STPoint > &lower_points, const std::vector< STPoint > &upper_points)
 Wrapper of the constructor (old). More...
 
static STBoundary CreateInstanceAccurate (const std::vector< STPoint > &lower_points, const std::vector< STPoint > &upper_points)
 Wrapper of the constructor. It doesn't use RemoveRedundantPoints and generates an accurate ST-boundary. More...
 
static std::string TypeName (BoundaryType type)
 
- Static Public Member Functions inherited from apollo::common::math::Polygon2d
static bool ComputeConvexHull (const std::vector< Vec2d > &points, Polygon2d *const polygon)
 Compute the convex hull of a group of points. More...
 

Additional Inherited Members

- Protected Member Functions inherited from apollo::common::math::Polygon2d
void BuildFromPoints ()
 
int Next (int at) const
 
int Prev (int at) const
 
- Static Protected Member Functions inherited from apollo::common::math::Polygon2d
static bool ClipConvexHull (const LineSegment2d &line_segment, std::vector< Vec2d > *const points)
 
- Protected Attributes inherited from apollo::common::math::Polygon2d
std::vector< Vec2dpoints_
 
int num_points_ = 0
 
std::vector< LineSegment2dline_segments_
 
bool is_convex_ = false
 
double area_ = 0.0
 
double min_x_ = 0.0
 
double max_x_ = 0.0
 
double min_y_ = 0.0
 
double max_y_ = 0.0
 

Member Enumeration Documentation

◆ BoundaryType

Enumerator
UNKNOWN 
STOP 
FOLLOW 
YIELD 
OVERTAKE 
KEEP_CLEAR 

Constructor & Destructor Documentation

◆ STBoundary() [1/4]

apollo::planning::STBoundary::STBoundary ( )
default

Constructors: STBoundary must be initialized with a vector of ST-point pairs. Each pair refers to a time t, with (lower_s, upper_s).

◆ STBoundary() [2/4]

apollo::planning::STBoundary::STBoundary ( const std::vector< std::pair< STPoint, STPoint >> &  point_pairs,
bool  is_accurate_boundary = false 
)
explicit

◆ STBoundary() [3/4]

apollo::planning::STBoundary::STBoundary ( const common::math::Box2d box)
explicitdelete

◆ STBoundary() [4/4]

apollo::planning::STBoundary::STBoundary ( std::vector< common::math::Vec2d points)
explicitdelete

◆ ~STBoundary()

apollo::planning::STBoundary::~STBoundary ( )
default

Default destructor.

Member Function Documentation

◆ bottom_left_point()

STPoint apollo::planning::STBoundary::bottom_left_point ( ) const

◆ bottom_right_point()

STPoint apollo::planning::STBoundary::bottom_right_point ( ) const

◆ boundary_type()

BoundaryType apollo::planning::STBoundary::boundary_type ( ) const

◆ characteristic_length()

double apollo::planning::STBoundary::characteristic_length ( ) const

◆ CreateInstance()

static STBoundary apollo::planning::STBoundary::CreateInstance ( const std::vector< STPoint > &  lower_points,
const std::vector< STPoint > &  upper_points 
)
static

Wrapper of the constructor (old).

◆ CreateInstanceAccurate()

static STBoundary apollo::planning::STBoundary::CreateInstanceAccurate ( const std::vector< STPoint > &  lower_points,
const std::vector< STPoint > &  upper_points 
)
static

Wrapper of the constructor. It doesn't use RemoveRedundantPoints and generates an accurate ST-boundary.

◆ CutOffByT()

STBoundary apollo::planning::STBoundary::CutOffByT ( const double  t) const

◆ ExpandByS()

STBoundary apollo::planning::STBoundary::ExpandByS ( const double  s) const

◆ ExpandByT()

STBoundary apollo::planning::STBoundary::ExpandByT ( const double  t) const

◆ GetBoundarySlopes()

bool apollo::planning::STBoundary::GetBoundarySlopes ( const double  curr_time,
double *  ds_upper,
double *  ds_lower 
) const

◆ GetBoundarySRange()

bool apollo::planning::STBoundary::GetBoundarySRange ( const double  curr_time,
double *  s_upper,
double *  s_lower 
) const

◆ GetUnblockSRange()

bool apollo::planning::STBoundary::GetUnblockSRange ( const double  curr_time,
double *  s_upper,
double *  s_lower 
) const

◆ id()

const std::string& apollo::planning::STBoundary::id ( ) const

◆ IsEmpty()

bool apollo::planning::STBoundary::IsEmpty ( ) const
inline

◆ IsPointInBoundary()

bool apollo::planning::STBoundary::IsPointInBoundary ( const STPoint st_point) const

◆ lower_points()

std::vector<STPoint> apollo::planning::STBoundary::lower_points ( ) const
inline

◆ max_s()

double apollo::planning::STBoundary::max_s ( ) const

◆ max_t()

double apollo::planning::STBoundary::max_t ( ) const

◆ min_s()

double apollo::planning::STBoundary::min_s ( ) const

◆ min_t()

double apollo::planning::STBoundary::min_t ( ) const

◆ obstacle_road_right_ending_t()

double apollo::planning::STBoundary::obstacle_road_right_ending_t ( ) const
inline

◆ set_bottom_left_point()

void apollo::planning::STBoundary::set_bottom_left_point ( STPoint  st_point)

◆ set_bottom_right_point()

void apollo::planning::STBoundary::set_bottom_right_point ( STPoint  st_point)

◆ set_id()

void apollo::planning::STBoundary::set_id ( const std::string &  id)

◆ set_obstacle_road_right_ending_t()

void apollo::planning::STBoundary::set_obstacle_road_right_ending_t ( double  road_right_ending_t)
inline

◆ set_upper_left_point()

void apollo::planning::STBoundary::set_upper_left_point ( STPoint  st_point)

◆ set_upper_right_point()

void apollo::planning::STBoundary::set_upper_right_point ( STPoint  st_point)

◆ SetBoundaryType()

void apollo::planning::STBoundary::SetBoundaryType ( const BoundaryType boundary_type)

◆ SetCharacteristicLength()

void apollo::planning::STBoundary::SetCharacteristicLength ( const double  characteristic_length)

◆ TypeName()

static std::string apollo::planning::STBoundary::TypeName ( BoundaryType  type)
static

◆ upper_left_point()

STPoint apollo::planning::STBoundary::upper_left_point ( ) const

◆ upper_points()

std::vector<STPoint> apollo::planning::STBoundary::upper_points ( ) const
inline

◆ upper_right_point()

STPoint apollo::planning::STBoundary::upper_right_point ( ) const

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