37 is_merge_block_obs_ = is_merge;
40 return is_merge_block_obs_;
44 return tracking_nudge_obs_info_;
48 return &tracking_nudge_obs_info_;
52 return block_sl_polygons_;
55 return &block_sl_polygons_;
66 return extra_nudge_key_points_;
69 return &extra_nudge_key_points_;
77 if (update_ids_.find(obs_id) != update_ids_.end()) {
89 if (extra_nudge_key_points_.size() < 2 || extra_nudge_key_points_.at(0).size() < 2) {
93 if (update_ids_.find(obs_id) == update_ids_.end()
94 && obs_start_s - extra_nudge_key_points_.at(0).at(1).s() > check_dis) {
102 if (obs_id.empty()) {
105 if (update_ids_.find(obs_id) != update_ids_.end() && block_sl_polygons_.size() > 0 && is_merge_block_obs_
106 && block_sl_polygons_.at(0).id().find(obs_id) != std::string::npos) {
107 *obs_sl_polygon = block_sl_polygons_.at(0);
112 sort(block_sl_polygons_.begin(), block_sl_polygons_.end(), [](
const SLPolygon& a,
const SLPolygon& b) {
113 return a.MinS() < b.MinS();
118 for (
auto iter = tracking_nudge_obs_info_.begin(); iter != tracking_nudge_obs_info_.end(); iter++) {
119 std::stringstream debug_str;
121 debug_str <<
"NudgeInfo ---- id: " << iter->first <<
"; " <<
"tracking time: " << iter->second.tracking_time
124 <<
"nudge probability: " << iter->second.nudge_probability <<
"; ";
126 debug_str <<
"polygon_points: ";
128 for (
const auto& point : iter->second.origin_polygon.points()) {
129 debug_str <<
"(" << point.x() <<
", " << point.y() <<
"), ";
131 AINFO << debug_str.str();
136 if (extra_nudge_key_points_.size() < 2 || extra_nudge_key_points_.at(0).size() < 2) {
139 size_t index = is_left_nudge ? 0 : 1;
141 if (s <= extra_nudge_key_points_[index].front().s()) {
142 *nudge_l = extra_nudge_key_points_[index].front().l();
145 if (s >= extra_nudge_key_points_[index].back().s()) {
146 *nudge_l = extra_nudge_key_points_[index].back().l();
149 auto iter = std::lower_bound(
150 extra_nudge_key_points_[index].begin(),
151 extra_nudge_key_points_[index].end(),
153 [](
const SLPoint& sl_point,
const double s) {
return sl_point.
s() < s; });
154 auto last_iter = std::prev(iter);
155 *nudge_l = last_iter->l() + (s - last_iter->s()) * (iter->l() - last_iter->l()) / (iter->s() - last_iter->s());
std::vector< std::vector< SLPoint > > * mutable_extra_nudge_key_points()
const std::vector< SLPolygon > & block_sl_polygons() const
const std::unordered_map< std::string, NudgeObstacleInfo > & tracking_nudge_obs_info() const
bool GetInterpolatedNudgeL(bool is_left_nudge, double s, double *nudge_l) const
const std::set< std::string > & update_ids() const
std::unordered_map< std::string, NudgeObstacleInfo > * mutable_tracking_nudge_obs_info()
void SortBlockSLPolygons()
bool is_merge_block_obs() const
bool IsObsIgnoreNudgeDecision(std::string obs_id, double obs_start_s, double check_dis) const
void set_enable(bool is_enable)
std::set< std::string > * mutable_update_ids()
std::vector< SLPolygon > * mutable_block_sl_polygons()
const std::vector< std::vector< SLPoint > > & extra_nudge_key_points() const
void GetFirstBlockSLPolygon(std::string obs_id, SLPolygon *obs_sl_polygon) const
void set_is_merge_block_obs(bool is_merge)
bool NeedCheckObsCollision(std::string obs_id) const
Planning module main class.