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

Prediction: trim prediction trajectory by junction

上级 154c56e8
......@@ -93,7 +93,7 @@ DEFINE_bool(enable_adjust_velocity_heading, true,
"adjust velocity heading to lane heading");
DEFINE_double(heading_diff_thred, M_PI / 6.0,
"Threshold for adjusting on-lane obstacle heading");
DEFINE_bool(enable_rnn_acc, true, "If use acceleration from RNN model.");
DEFINE_bool(enable_rnn_acc, false, "If use acceleration from RNN model.");
// Obstacle trajectory
DEFINE_double(lane_sequence_threshold, 0.5,
......@@ -110,6 +110,8 @@ DEFINE_double(distance_to_adc_trajectory_thred, 5.0,
"ADC planning trajectory");
DEFINE_double(time_to_adc_trajectory_thred, 2.0,
"Time threshold to trim prediction trajectory");
DEFINE_double(junction_distance_thred, 0.25,
"Threshold of radius to search junction.");
// move sequence prediction
DEFINE_double(time_upper_bound_to_lane_center, 5.0,
......
......@@ -78,6 +78,7 @@ DECLARE_bool(enable_trim_prediction_trajectory);
DECLARE_double(adc_time_step);
DECLARE_double(distance_to_adc_trajectory_thred);
DECLARE_double(time_to_adc_trajectory_thred);
DECLARE_double(junction_distance_thred);
// move sequence prediction
DECLARE_double(time_upper_bound_to_lane_center);
......
......@@ -66,23 +66,21 @@ bool Predictor::TrimTrajectory(
const ADCTrajectoryContainer* adc_trajectory_container,
Trajectory* trajectory) {
int num_point = trajectory->trajectory_point_size();
// Get the index at intersect
if (num_point == 0) {
return false;
}
double start_x = trajectory->trajectory_point(0).path_point().x();
double start_y = trajectory->trajectory_point(0).path_point().y();
if (PredictionMap::instance()->NearJunction(
{start_x, start_y}, FLAGS_junction_distance_thred)) {
return false;
}
int index = 0;
bool has_intersect = false;
while (index < num_point) {
double x = trajectory->trajectory_point(index).path_point().x();
double y = trajectory->trajectory_point(index).path_point().y();
Eigen::Vector2d point(x, y);
std::vector<std::string> lane_ids =
PredictionMap::instance()->NearbyLaneIds(
point, FLAGS_distance_to_adc_trajectory_thred);
for (const std::string& lane_id : lane_ids) {
if (adc_trajectory_container->ContainsLaneId(lane_id)) {
has_intersect = true;
break;
}
}
if (has_intersect) {
if (PredictionMap::instance()->NearJunction(
{x, y}, FLAGS_junction_distance_thred)) {
break;
}
++index;
......@@ -93,12 +91,6 @@ bool Predictor::TrimTrajectory(
return false;
}
double index_time = trajectory->trajectory_point(index).relative_time();
// if early intersect occurs
if (index_time < FLAGS_time_to_adc_trajectory_thred) {
return false;
}
for (int i = index; i < num_point; ++i) {
trajectory->mutable_trajectory_point()->RemoveLast();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册