65 {
66
67 CHECK_GT(planning_max_time_, 0.0);
69 AERROR <<
"Fail to get params because of too few path points. path points "
70 "size: "
72 return Status(ErrorCode::PLANNING_ERROR,
73 "Fail to get params because of too few path points");
74 }
75
76
77 Obstacle* stop_obstacle = nullptr;
78 ObjectDecisionType stop_decision;
79 double min_stop_s = std::numeric_limits<double>::max();
80 for (const auto* ptr_obstacle_item : path_decision->obstacles().Items()) {
81 Obstacle* ptr_obstacle = path_decision->Find(ptr_obstacle_item->Id());
82 ACHECK(ptr_obstacle !=
nullptr);
83
84
85 if (!ptr_obstacle->HasLongitudinalDecision()) {
87 continue;
88 }
89
90
91 const auto& decision = ptr_obstacle->LongitudinalDecision();
92 if (decision.has_stop()) {
93
94
95 common::SLPoint stop_sl_point;
96 reference_line_.
XYToSL(decision.stop().stop_point(), &stop_sl_point);
97 const double stop_s = stop_sl_point.s();
98
99 if (stop_s < min_stop_s) {
100 stop_obstacle = ptr_obstacle;
101 min_stop_s = stop_s;
102 stop_decision = decision;
103 }
104 } else if (decision.has_follow() || decision.has_overtake() ||
105 decision.has_yield()) {
106
107
108 ComputeSTBoundaryWithDecision(ptr_obstacle, decision);
109 } else if (!decision.has_ignore()) {
110
111 AWARN <<
"No mapping for decision: " << decision.DebugString();
112 }
113 }
114 if (stop_obstacle) {
115 bool success = MapStopDecision(stop_obstacle, stop_decision);
116 if (!success) {
117 const std::string msg = "Fail to MapStopDecision.";
119 return Status(ErrorCode::PLANNING_ERROR, msg);
120 }
121 }
122
124}
static Status OK()
generate a success status.
const DiscretizedPath & discretized_path() const
bool XYToSL(const common::math::Vec2d &xy_point, common::SLPoint *const sl_point, double warm_start_s=-1.0) const
Transvert Cartesian coordinates to Frenet.
common::Status ComputeSTBoundary(PathDecision *path_decision) const