42 std::vector<std::pair<double, double>>
boundary;
43 for (
auto iter = begin(); iter != end(); iter++) {
44 boundary.emplace_back(iter->l_lower.l, iter->l_upper.l);
54 blocking_obstacle_id_ = obs_id;
58 std::string lower_name = name +
"_lower";
59 std::string upper_name = name +
"_upper";
60 for (
auto iter = begin(); iter != end(); iter++) {
61 print_curves.
AddPoint(lower_name, iter->s, iter->l_lower.l);
62 print_curves.
AddPoint(upper_name, iter->s, iter->l_upper.l);
68 return blocking_obstacle_id_;
75 size_t* right_index)
const {
76 if (s < front().s || s > back().s) {
80 const auto iter = std::lower_bound(begin(), end(), cmp);
81 auto last_iter = std::prev(iter);
82 *left_index = std::distance(begin(), last_iter);
83 *right_index = *left_index + 1;
84 if (*left_index > size() - 1 || *right_index > size() - 1) {
88 (at(*right_index).s - s) / (at(*right_index).s - at(*left_index).s);
89 *right_weight = 1.0 - *left_weight;
95 return front().l_lower.l;
98 return back().l_lower.l;
100 double l_weight = 0.0;
101 double r_weight = 0.0;
106 return at(l_index).l_lower.l * l_weight + at(r_index).l_lower.l * r_weight;
110 if (s <= front().s) {
111 return front().l_upper.l;
114 return back().l_upper.l;
116 double l_weight = 0.0;
117 double r_weight = 0.0;
122 return at(l_index).l_upper.l * l_weight + at(r_index).l_upper.l * r_weight;
126 double left_weight,
double right_weight,
size_t left_index,
127 size_t right_index)
const {
128 if (left_index < 0) {
129 return front().l_lower.l;
130 }
else if (right_index >= size()) {
131 return back().l_lower.l;
133 return at(left_index).l_lower.l * left_weight +
134 at(right_index).l_lower.l * right_weight;
138 double left_weight,
double right_weight,
size_t left_index,
139 size_t right_index)
const {
140 if (left_index < 0) {
141 return front().l_upper.l;
142 }
else if (right_index >= size()) {
143 return back().l_upper.l;
145 return at(left_index).l_upper.l * left_weight +
146 at(right_index).l_upper.l * right_weight;
void set_label(const std::string &label)
void DebugString(std::string name)
void set_blocking_obstacle_id(const std::string &obs_id)
double get_upper_bound_by_interpolated_index(double left_weight, double right_weight, size_t left_index, size_t right_index) const
bool get_interpolated_s_weight(const double s, double *left_weight, double *right_weight, size_t *left_index, size_t *right_index) const
const std::string & blocking_obstacle_id() const
void set_delta_s(double s)
const std::string & label() const
std::vector< std::pair< double, double > > boundary() const
double get_lower_bound_by_interpolated_index(double left_weight, double right_weight, size_t left_index, size_t right_index) const
double get_lower_bound_by_s(const double s)
double get_upper_bound_by_s(const double s)
void AddPoint(std::string key, double x, double y)
add point to curve key
Planning module main class.