95 {
96 static constexpr double kBounadryEpsilon = 1e-2;
97 for (const auto& boundary : st_graph_data_.st_boundaries()) {
98
100 continue;
101 }
102
103 if (boundary->IsPointInBoundary({0.0, 0.0}) ||
104 (std::fabs(boundary->min_t()) < kBounadryEpsilon &&
105 std::fabs(boundary->min_s()) < kBounadryEpsilon)) {
106 dimension_t_ = static_cast<uint32_t>(std::ceil(
107 total_length_t_ / static_cast<double>(unit_t_))) +
108 1;
109 std::vector<SpeedPoint> speed_profile;
110 double t = 0.0;
111 for (uint32_t i = 0; i < dimension_t_; ++i, t += unit_t_) {
113 }
114 *speed_data = SpeedData(speed_profile);
116 }
117 }
118
119 if (!InitCostTable().ok()) {
120 const std::string msg = "Initialize cost table failed.";
122 return Status(ErrorCode::PLANNING_ERROR, msg);
123 }
124
125 if (!InitSpeedLimitLookUp().ok()) {
126 const std::string msg = "Initialize speed limit lookup table failed.";
128 return Status(ErrorCode::PLANNING_ERROR, msg);
129 }
130
131 if (!CalculateTotalCost().ok()) {
132 const std::string msg = "Calculate total cost failed.";
134 return Status(ErrorCode::PLANNING_ERROR, msg);
135 }
136
137 if (!RetrieveSpeedProfile(speed_data).ok()) {
138 const std::string msg = "Retrieve best speed profile failed.";
140 return Status(ErrorCode::PLANNING_ERROR, msg);
141 }
143}
static Status OK()
generate a success status.
static SpeedPoint ToSpeedPoint(const double s, const double t, const double v=0, const double a=0, const double da=0)