25 #include <unordered_map> 29 #include "modules/common/configs/proto/vehicle_config.pb.h" 37 #include "modules/planning/proto/decision.pb.h" 52 void Init(
const double planning_distance,
const double planning_time,
74 std::vector<std::pair<double, double>>*
const available_s_bounds,
76 std::vector<std::pair<std::string, ObjectDecisionType>>>*
const 77 available_obs_decisions);
86 double t, std::pair<double, double>*
const limiting_speed_info);
91 const ObjectDecisionType& obs_decision);
96 const std::vector<std::pair<std::string, ObjectDecisionType>>&
106 bool ComputeObstacleSTBoundary(
const Obstacle& obstacle,
107 std::vector<STPoint>*
const lower_points,
108 std::vector<STPoint>*
const upper_points,
109 bool*
const is_caution_obstacle,
110 double*
const obs_caution_end_t);
120 bool GetOverlappingS(
const std::vector<common::PathPoint>& adc_path_points,
122 const double adc_l_buffer,
123 std::pair<double, double>*
const overlapping_s);
136 int GetSBoundingPathPointIndex(
137 const std::vector<common::PathPoint>& adc_path_points,
139 const bool is_before,
const int start_idx,
const int end_idx);
151 bool IsPathPointAwayFromObstacle(
const common::PathPoint& path_point,
152 const common::PathPoint& direction_point,
154 const double s_thresh,
const bool is_before);
163 bool IsADCOverlappingWithObstacle(
const common::PathPoint& adc_path_point,
165 const double l_buffer)
const;
173 std::vector<std::pair<double, double>> FindSGaps(
174 const std::vector<std::tuple<int, double, double, double, std::string>>&
176 double s_min,
double s_max);
185 ObjectDecisionType DetermineObstacleDecision(
const double obs_s_min,
186 const double obs_s_max,
187 const double s)
const;
193 bool IsSWithinADCLowRoadRightSegment(
const double s)
const;
196 double planning_time_;
197 double planning_distance_;
199 common::VehicleParam vehicle_param_;
200 double adc_path_init_s_;
205 std::vector<std::tuple<int, double, double, double, std::string>>
207 int obs_t_edges_idx_;
209 std::unordered_map<std::string, STBoundary> obs_id_to_st_boundary_;
210 std::unordered_map<std::string, ObjectDecisionType> obs_id_to_decision_;
212 std::vector<std::tuple<std::string, STBoundary, Obstacle*>>
213 candidate_clear_zones_;
215 std::unordered_map<std::string, STBoundary>
216 obs_id_to_alternative_st_boundary_;
218 std::vector<std::pair<double, double>> adc_low_road_right_segments_;
This is the class that associates an Obstacle with its path properties. An obstacle's path properties...
Definition: obstacle.h:60
PathDecision represents all obstacle decisions on one path.
Definition: path_decision.h:38
std::unordered_map< std::string, STBoundary > GetAllSTBoundaries()
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
virtual ~STObstaclesProcessor()=default
Planning module main class. It processes GPS and IMU as input, to generate planning info...
bool GetLimitingSpeedInfo(double t, std::pair< double, double > *const limiting_speed_info)
Provided that decisions for all existing obstacles are made, get the speed limiting info from limitin...
Rectangular (undirected) bounding box in 2-D.
Definition: box2d.h:52
Definition: path_data.h:36
constexpr double kADCSafetyLBuffer
Definition: st_obstacles_processor.h:43
common::Status MapObstaclesToSTBoundaries(PathDecision *const path_decision)
Definition: st_obstacles_processor.h:48
void Init(const double planning_distance, const double planning_time, const PathData &path_data, PathDecision *const path_decision, History *const history)
bool GetSBoundsFromDecisions(double t, std::vector< std::pair< double, double >> *const available_s_bounds, std::vector< std::vector< std::pair< std::string, ObjectDecisionType >>> *const available_obs_decisions)
Given a time t, get the lower and upper s-boundaries. If the boundary is well-defined based on decisi...
constexpr double kSIgnoreThreshold
Definition: st_obstacles_processor.h:44
A general class to denote the return status of an API call. It can either be an OK status for success...
Definition: status.h:43
STObstaclesProcessor()
Definition: st_obstacles_processor.h:50
void SetObstacleDecision(const std::string &obs_id, const ObjectDecisionType &obs_decision)
Set the decision for a given obstacle.
constexpr double kTIgnoreThreshold
Definition: st_obstacles_processor.h:45
constexpr double kOvertakenObsCautionTime
Definition: st_obstacles_processor.h:46