20#include <unordered_map>
32using ObstacleEdge = std::tuple<int, double, double, double, std::string>;
34using SLState = std::pair<std::array<double, 3>, std::array<double, 3>>;
62 const double adc_frenet_s);
72 std::string*
const borrow_lane_type,
bool is_fallback_lanechange,
83 double left_bound,
double right_bound,
BoundType left_type,
84 BoundType right_type, std::string left_id, std::string right_id,
89 double right_bound,
BoundType right_type, std::string right_id,
92 double left_bound,
BoundType left_type, std::string left_id,
102 const std::unordered_map<std::string, double>& obs_id_to_start_s);
109 std::vector<SLPolygon>*
const sl_polygons,
const SLState& init_sl_state,
111 std::string*
const blocking_obstacle_id,
double*
const narrowest_width);
127 size_t idx,
double left_bound,
double right_bound,
128 PathBoundary*
const path_boundaries,
double*
const center_line);
146 const double s,
double* ptr_l_min,
174 const double extend_buffer,
181 const double y,
const PathBound& path_bound);
183 std::vector<SLPolygon>* polygons,
187 std::vector<SLPolygon>*
const sl_polygon,
const SLState& init_sl_state,
188 PathBoundary*
const path_boundary, std::string*
const blocked_id,
189 double*
const narrowest_width);
190 static bool AddCornerPoint(
double s,
double l_lower,
double l_upper,
195 bool is_left, std::string obs_id,
201 bool is_left,
double init_l,
double heading,
202 double delta_s,
double init_frenet_kappa,
212 std::string*
const blocked_id);
214 PathBoundary*
const path_boundary, std::string*
const blocked_id);
This is the class that associates an Obstacle with its path properties.
static bool GetBoundaryFromSelfLane(const ReferenceLineInfo &reference_line_info, const SLState &init_sl_state, PathBoundary *const path_bound)
generate path bound by self lane and adc position
static bool ComputeSLBoundaryIntersection(const SLBoundary &sl_boundary, const double s, double *ptr_l_min, double *ptr_l_max)
Check is sl range has intersection with sl_boundary
static bool RelaxObsCornerBoundary(PathBoundary *const path_boundary, const SLState &init_sl_state)
static bool UpdatePathBoundaryBySLPolygon(const ReferenceLineInfo &reference_line_info, std::vector< SLPolygon > *const sl_polygon, const SLState &init_sl_state, PathBoundary *const path_boundary, std::string *const blocked_id, double *const narrowest_width)
static bool ExtendBoundaryByADC(const ReferenceLineInfo &reference_line_info, const SLState &init_sl_state, const double extend_buffer, PathBoundary *const path_bound)
extend boundary to include adc
static bool UpdatePathBoundaryAndCenterLineWithBuffer(size_t idx, double left_bound, double right_bound, PathBoundary *const path_boundaries, double *const center_line)
Update the path_boundary at "idx", as well as the new center-line.
static bool UpdateLeftPathBoundaryWithBuffer(double left_bound, BoundType left_type, std::string left_id, PathBoundPoint *const bound_point)
static bool RelaxEgoPathBoundary(PathBoundary *const path_boundary, const SLState &init_sl_state)
static void AddCornerBounds(const std::vector< SLPolygon > &sl_polygons, PathBoundary *const path_boundary)
static bool AddExtraPathBound(const std::vector< SLPolygon > &sl_polygons, PathBoundary *const path_boundary, const SLState &init_sl_state, std::string *const blocked_id)
static std::vector< ObstacleEdge > SortObstaclesForSweepLine(const IndexedList< std::string, Obstacle > &indexed_obstacles, const SLState &init_sl_state)
static bool AddCornerPoint(double s, double l_lower, double l_upper, const PathBoundary &path_boundary, ObsCornerConstraints *extra_constraints)
static void ConvertBoundarySAxisFromLaneCenterToRefLine(const ReferenceLineInfo &reference_line_info, PathBoundary *const path_bound)
static std::string FindFarthestBlockObstaclesId(const std::unordered_map< std::string, double > &obs_id_to_start_s)
Find the farthest obstacle's id which ADC is blocked by
static bool GetBoundaryFromStaticObstacles(const ReferenceLineInfo &reference_line_info, std::vector< SLPolygon > *const sl_polygons, const SLState &init_sl_state, PathBoundary *const path_boundaries, std::string *const blocking_obstacle_id, double *const narrowest_width)
Refine the boundary based on static obstacles.
static int IsPointWithinPathBound(const ReferenceLineInfo &reference_line_info, const double x, const double y, const PathBound &path_bound)
static bool GetBoundaryFromRoad(const ReferenceLineInfo &reference_line_info, const SLState &init_sl_state, PathBoundary *const path_bound)
static bool GetBoundaryFromLanesAndADC(const ReferenceLineInfo &reference_line_info, const LaneBorrowInfo &lane_borrow_info, bool is_extend_adc, double ADC_buffer, PathBoundary *const path_bound, std::string *const borrow_lane_type, bool is_fallback_lanechange, const SLState &init_sl_state)
Refine the boundary based on lane-info and ADC's location.
static void AddAdcVertexBounds(PathBoundary *const path_boundary)
static bool UpdateBlockInfoWithObsCornerBoundary(PathBoundary *const path_boundary, std::string *const blocked_id)
static common::TrajectoryPoint InferFrontAxeCenterFromRearAxeCenter(const common::TrajectoryPoint &traj_point)
static void GetStartPoint(common::TrajectoryPoint planning_start_point, const ReferenceLine &reference_line, SLState *init_sl_state)
Starting from ADC's current position, increment until the horizon, and and set lateral bounds to be i...
static void TrimPathBounds(const int path_blocked_idx, PathBoundary *const path_boundaries)
static bool RelaxBoundaryPoint(PathBoundPoint *const path_bound_point, bool is_left, double init_l, double heading, double delta_s, double init_frenet_kappa, double min_radius)
static bool UpdatePathBoundaryWithBuffer(double left_bound, double right_bound, BoundType left_type, BoundType right_type, std::string left_id, std::string right_id, PathBoundPoint *const bound_point)
Update the path_boundary at "idx" It also checks if ADC is blocked (lmax < lmin).
static double GetBufferBetweenADCCenterAndEdge()
Get the distance between ADC's center and its edge.
static void GetSLPolygons(const ReferenceLineInfo &reference_line_info, std::vector< SLPolygon > *polygons, const SLState &init_sl_state)
static double GetADCLaneWidth(const ReferenceLine &reference_line, const double adc_frenet_s)
Get lane width in init_sl_state.
static bool IsWithinPathDeciderScopeObstacle(const Obstacle &obstacle)
Is obstacle should be considered in path decision
static bool InitPathBoundary(const ReferenceLineInfo &reference_line_info, PathBoundary *const path_bound, SLState init_sl_state)
Starting from ADC's current position, increment until the path length, and set lateral bounds to be i...
static bool UpdateRightPathBoundaryWithBuffer(double right_bound, BoundType right_type, std::string right_id, PathBoundPoint *const bound_point)
Trim the path bounds starting at the idx where path is blocked.
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
std::pair< std::array< double, 3 >, std::array< double, 3 > > SLState
std::vector< PathBoundPoint > PathBound
std::tuple< int, double, double, double, std::string > ObstacleEdge