93 {
94 auto obstacles_container =
95 container_manager_->GetContainer<ObstaclesContainer>(
97 if (obstacles_container == nullptr) {
98 AERROR <<
"Obstacles container pointer is a null pointer.";
99 return;
100 }
101 Obstacle* ego_vehicle =
102 obstacles_container->GetObstacle(FLAGS_ego_vehicle_id);
103 if (ego_vehicle == nullptr) {
104 AERROR <<
"Ego vehicle not found";
105 return;
106 }
107 if (ego_vehicle->history_size() == 0) {
108 AERROR <<
"Ego vehicle has no history";
109 return;
110 }
111
112 const auto& obstacle_ids =
113 obstacles_container->curr_frame_movable_obstacle_ids();
114 for (const int obstacle_id : obstacle_ids) {
115 Obstacle* obstacle_ptr = obstacles_container->GetObstacle(obstacle_id);
116 if (obstacle_ptr == nullptr) {
117 AERROR <<
"Null obstacle pointer found.";
118 continue;
119 }
120 if (obstacle_ptr->history_size() == 0) {
121 AERROR <<
"Obstacle [" << obstacle_ptr->id() <<
"] has no feature.";
122 continue;
123 }
124 Feature* latest_feature_ptr = obstacle_ptr->mutable_latest_feature();
125 latest_feature_ptr->mutable_interactive_tag()->set_interactive_tag(
127 }
128 auto storytelling_container =
129 container_manager_->GetContainer<StoryTellingContainer>(
131 if (storytelling_container->ADCDistanceToJunction() <
132 FLAGS_junction_distance_threshold) {
133 AssignInteractiveTagInJunction(*ego_vehicle, obstacles_container,
134 storytelling_container->ADCJunctionId());
135 }
136 AssignInteractiveTagCruiseKeepLane(*ego_vehicle, obstacles_container);
137 AssignInteractiveTagCruiseChangeLane(*ego_vehicle, obstacles_container);
138 AssignInteractiveTagByEgoReferenceLine(*ego_vehicle, obstacles_container);
139 if (FLAGS_enable_rank_interactive_obstacles) {
140 RankingInteractiveTagObstacles(*ego_vehicle, obstacles_container);
141 }
142}