提交 6b00a69d 编写于 作者: K kechxu 提交者: Kecheng Xu

Prediction: move some constants to gflags

上级 5117f91d
......@@ -62,6 +62,14 @@ DEFINE_bool(enable_junction_feature, true,
"If to enable building junction feature for obstacles");
DEFINE_bool(enable_all_junction, false,
"If consider all junction with junction_mlp_model.");
DEFINE_double(caution_search_distance_ahead, 40.0,
"The distance ahead to search caution-level obstacles");
DEFINE_double(caution_search_distance_backward_for_merge, 30.0,
"The distance backward to search caution-lebel obstacles "
"in the case of merging");
DEFINE_double(caution_search_distance_backward_for_overlap, 20.0,
"The distance backward to search caution-lebel obstacles "
"in the case of overlap");
// Obstacle features
DEFINE_int32(ego_vehicle_id, -1, "The obstacle ID of the ego vehicle.");
......
......@@ -46,6 +46,9 @@ DECLARE_double(junction_distance_threshold);
DECLARE_bool(enable_prioritize_obstacles);
DECLARE_bool(enable_junction_feature);
DECLARE_bool(enable_all_junction);
DECLARE_double(caution_search_distance_ahead);
DECLARE_double(caution_search_distance_backward_for_merge);
DECLARE_double(caution_search_distance_backward_for_overlap);
// Obstacle features
DECLARE_int32(ego_vehicle_id);
......
......@@ -293,6 +293,7 @@ void ObstaclesPrioritizer::AssignCautionLevelInJunction(
ADEBUG << "SetCaution for obstacle [" << obstacle_ptr->id() << "]";
}
}
AssignCautionLevelByEgoReferenceLine();
}
void ObstaclesPrioritizer::AssignCautionLevelByEgoReferenceLine() {
......@@ -316,7 +317,7 @@ void ObstaclesPrioritizer::AssignCautionLevelByEgoReferenceLine() {
accumulated_s += lane_info_ptr->total_length();
AssignCautionByMerge(lane_info_ptr);
AssignCautionByOverlap(lane_info_ptr);
if (accumulated_s > 40.0) {
if (accumulated_s > FLAGS_caution_search_distance_ahead) {
break;
}
}
......@@ -324,7 +325,8 @@ void ObstaclesPrioritizer::AssignCautionLevelByEgoReferenceLine() {
void ObstaclesPrioritizer::AssignCautionByMerge(
std::shared_ptr<const LaneInfo> lane_info_ptr) {
SetCautionBackward(lane_info_ptr, 40.0);
SetCautionBackward(lane_info_ptr,
FLAGS_caution_search_distance_backward_for_merge);
}
void ObstaclesPrioritizer::AssignCautionByOverlap(
......@@ -340,7 +342,8 @@ void ObstaclesPrioritizer::AssignCautionByOverlap(
} else {
std::shared_ptr<const LaneInfo> overlap_lane_ptr =
PredictionMap::LaneById(object_id);
SetCautionBackward(overlap_lane_ptr, 20.0);
SetCautionBackward(overlap_lane_ptr,
FLAGS_caution_search_distance_backward_for_overlap);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册