提交 fc0fd374 编写于 作者: H Hongyi 提交者: Jiangtao Hu

Prediction: move parameters to gflags

上级 d1106675
......@@ -22,6 +22,7 @@
#include <unordered_set>
#include "modules/prediction/common/junction_analyzer.h"
#include "modules/prediction/common/prediction_gflags.h"
namespace apollo {
namespace prediction {
......@@ -62,19 +63,14 @@ void JunctionAnalyzer::SetAllJunctionExits() {
if (overlap_info_ptr == nullptr) {
continue;
}
// TODO(all) consider to delete
if (overlap_info_ptr->overlap().object_size() != 2) {
continue;
}
for (const auto &object : overlap_info_ptr->overlap().object()) {
if (object.has_lane_overlap_info()) {
const std::string& lane_id = object.id().id();
auto lane_info_ptr = PredictionMap::LaneById(lane_id);
// TODO(all) move 0.1 to gflags
if (object.lane_overlap_info().end_s() + 0.1 <
double s = object.lane_overlap_info().end_s();
if (s + FLAGS_junction_exit_lane_threshold <
lane_info_ptr->total_length()) {
JunctionExit junction_exit;
double s = object.lane_overlap_info().end_s();
apollo::common::PointENU position = lane_info_ptr->GetSmoothPoint(s);
junction_exit.set_exit_lane_id(lane_id);
junction_exit.mutable_exit_position()->set_x(position.x());
......@@ -181,8 +177,7 @@ double JunctionAnalyzer::ComputeJunctionRange() {
junction_info_ptr_->junction().polygon().point_size() < 3) {
AERROR << "Junction [" << GetJunctionId()
<< "] has not enough polygon points to compute range";
// TODO(kechxu) move the default range value to gflags
return 10.0;
return FLAGS_defualt_junction_range;
}
double x_min = std::numeric_limits<double>::infinity();
double x_max = -std::numeric_limits<double>::infinity();
......
......@@ -161,6 +161,16 @@ DEFINE_uint32(max_num_lane_point, 20,
DEFINE_double(centripetal_acc_coeff, 0.5,
"Coefficient of centripetal acceleration probability");
// Junction Scenario
DEFINE_double(junction_exit_lane_threshold, 0.1,
"If a lane has longer extend out of the junction,"
"consider it as a exit_lane.");
DEFINE_double(distance_beyond_junction, 0.5,
"If the obstacle is in junction more than this threshold,"
"consider it in junction.");
DEFINE_double(defualt_junction_range, 10.0,
"Default value for the range of a junction.");
// Obstacle trajectory
DEFINE_bool(enable_cruise_regression, false,
"If enable using regression in cruise model");
......@@ -176,9 +186,6 @@ DEFINE_bool(enable_trim_prediction_trajectory, false,
"protected adc planning trajectory.");
DEFINE_bool(enable_trajectory_validation_check, false,
"If check the validity of prediction trajectory.");
DEFINE_double(distance_beyond_junction, 0.5,
"If the obstacle is in junction more than this threshold,"
"consider it in junction.");
DEFINE_double(adc_trajectory_search_length, 10.0,
"How far to search junction along adc planning trajectory");
DEFINE_double(virtual_lane_radius, 0.5, "Radius to search virtual lanes");
......
......@@ -105,6 +105,11 @@ DECLARE_uint32(max_num_lane_point);
// Validation checker
DECLARE_double(centripetal_acc_coeff);
// Junction Scenario
DECLARE_double(junction_exit_lane_threshold);
DECLARE_double(distance_beyond_junction);
DECLARE_double(defualt_junction_range);
// Obstacle trajectory
DECLARE_bool(enable_cruise_regression);
DECLARE_double(lane_sequence_threshold_cruise);
......@@ -113,7 +118,6 @@ DECLARE_double(lane_change_dist);
DECLARE_bool(enable_lane_sequence_acc);
DECLARE_bool(enable_trim_prediction_trajectory);
DECLARE_bool(enable_trajectory_validation_check);
DECLARE_double(distance_beyond_junction);
DECLARE_double(adc_trajectory_search_length);
DECLARE_double(virtual_lane_radius);
DECLARE_double(default_lateral_approach_speed);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册