提交 96f2bab5 编写于 作者: K kechxu 提交者: Xiangquan Xiao

Prediction: move a gflag to a constant in prioritization

上级 a1cda728
......@@ -76,8 +76,6 @@ DEFINE_double(caution_search_distance_backward_for_overlap, 30.0,
"in the case of overlap");
DEFINE_double(caution_pedestrian_approach_time, 3.0,
"The time for a pedestrian to approach adc trajectory");
DEFINE_double(caution_distance_threshold, 60.0,
"The distance threshold for obstacles to be caution");
// Obstacle features
DEFINE_int32(ego_vehicle_id, -1, "The obstacle ID of the ego vehicle.");
......
......@@ -54,7 +54,6 @@ DECLARE_double(caution_search_distance_backward);
DECLARE_double(caution_search_distance_backward_for_merge);
DECLARE_double(caution_search_distance_backward_for_overlap);
DECLARE_double(caution_pedestrian_approach_time);
DECLARE_double(caution_distance_threshold);
// Obstacle features
DECLARE_int32(ego_vehicle_id);
......
......@@ -42,6 +42,8 @@ using hdmap::LaneInfo;
using hdmap::OverlapInfo;
using ConstLaneInfoPtr = std::shared_ptr<const LaneInfo>;
constexpr double kCautionDistanceThreshold = 60.0;
namespace {
bool IsLaneSequenceInReferenceLine(
......@@ -214,7 +216,7 @@ void ObstaclesPrioritizer::AssignCautionLevelInJunction(
continue;
}
if (obstacle_ptr->IsInJunction(curr_junction_id)) {
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
obstacle_ptr);
}
}
......@@ -236,7 +238,7 @@ void ObstaclesPrioritizer::AssignCautionLevelCruiseKeepLane(
AERROR << "Obstacle [" << nearest_front_obstacle_id << "] Not found";
continue;
}
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
obstacle_ptr);
}
}
......@@ -261,7 +263,7 @@ void ObstaclesPrioritizer::AssignCautionLevelCruiseChangeLane(
AERROR << "Obstacle [" << nearest_front_obstacle_id << "] Not found";
continue;
}
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
obstacle_ptr);
} else if (IsLaneSequenceInReferenceLine(lane_sequence,
ego_trajectory_container)) {
......@@ -273,7 +275,7 @@ void ObstaclesPrioritizer::AssignCautionLevelCruiseChangeLane(
Obstacle* front_obstacle_ptr =
obstacles_container->GetObstacle(nearest_front_obstacle_id);
if (front_obstacle_ptr != nullptr) {
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
front_obstacle_ptr);
}
}
......@@ -281,7 +283,7 @@ void ObstaclesPrioritizer::AssignCautionLevelCruiseChangeLane(
Obstacle* backward_obstacle_ptr =
obstacles_container->GetObstacle(nearest_backward_obstacle_id);
if (backward_obstacle_ptr != nullptr) {
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
backward_obstacle_ptr);
}
}
......@@ -414,7 +416,7 @@ void ObstaclesPrioritizer::AssignCautionLevelByEgoReferenceLine(
if (std::fabs(start_l) < FLAGS_pedestrian_nearby_lane_search_radius ||
std::fabs(end_l) < FLAGS_pedestrian_nearby_lane_search_radius ||
start_l * end_l < 0.0) {
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
obstacle_ptr);
}
}
......@@ -509,7 +511,7 @@ void ObstaclesPrioritizer::SetCautionBackward(
AERROR << "Obstacle [" << obstacle_id << "] Not found";
continue;
}
SetCautionIfCloseToEgo(ego_vehicle, FLAGS_caution_distance_threshold,
SetCautionIfCloseToEgo(ego_vehicle, kCautionDistanceThreshold,
obstacle_ptr);
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册