提交 22c06446 编写于 作者: H Hongyi 提交者: Kecheng Xu

Prediction: add AssignCautionLevelInJunction()

上级 597fa644
......@@ -183,11 +183,37 @@ void ObstaclesPrioritizer::AssignIgnoreLevel() {
}
void ObstaclesPrioritizer::AssignCautionLevel() {
AssignCautionLevelInJunction();
AssignCautionLevelCruiseKeepLane();
AssignCautionLevelCruiseChangeLane();
AssignCautionLevelByEgoReferenceLine();
}
void ObstaclesPrioritizer::AssignCautionLevelInJunction() {
auto obstacles_container =
ContainerManager::Instance()->GetContainer<ObstaclesContainer>(
AdapterConfig::PERCEPTION_OBSTACLES);
if (obstacles_container == nullptr) {
AERROR << "Obstacles container pointer is a null pointer.";
return;
}
// TODO(Hongyi): get current junction_id from Storytelling
std::string curr_junction_id;
const auto& obstacle_ids =
obstacles_container->curr_frame_movable_obstacle_ids();
for (const int obstacle_id : obstacle_ids) {
Obstacle* obstacle_ptr = obstacles_container->GetObstacle(obstacle_id);
if (obstacle_ptr == nullptr) {
AERROR << "Null obstacle pointer found.";
continue;
}
if (obstacle_ptr->IsInJunction(curr_junction_id)) {
obstacle_ptr->SetCaution();
}
}
}
void ObstaclesPrioritizer::AssignCautionLevelCruiseKeepLane() {
ObstaclesContainer* obstacles_container =
ContainerManager::Instance()->GetContainer<ObstaclesContainer>(
......
......@@ -37,6 +37,8 @@ class ObstaclesPrioritizer {
void AssignCautionLevel();
private:
void AssignCautionLevelInJunction();
void AssignCautionLevelCruiseKeepLane();
void AssignCautionLevelCruiseChangeLane();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册