diff --git a/modules/prediction/common/prediction_gflags.cc b/modules/prediction/common/prediction_gflags.cc index b6454b57b02003dadfcffceb962662db205eb0c8..7ff4cb45c111809a1f4cc77b12d98cd099084cbc 100644 --- a/modules/prediction/common/prediction_gflags.cc +++ b/modules/prediction/common/prediction_gflags.cc @@ -108,6 +108,8 @@ DEFINE_double(still_pedestrian_position_std, 0.5, "Position standard deviation for still pedestrians"); DEFINE_double(still_unknown_position_std, 0.5, "Position standard deviation for still unknown obstacles"); +DEFINE_double(slow_obstacle_speed_threshold, 2.0, + "Speed threshold for slow obstacles"); DEFINE_double(max_history_time, 7.0, "Obstacles' maximal historical time."); DEFINE_double(target_lane_gap, 2.0, "Gap between two lane points."); DEFINE_double(dense_lane_gap, 0.2, diff --git a/modules/prediction/common/prediction_gflags.h b/modules/prediction/common/prediction_gflags.h index 76582aaff87eccda232dd75f670c461d702d5413..e4ea01340469af48dbfad55f787e1f39093ce937 100644 --- a/modules/prediction/common/prediction_gflags.h +++ b/modules/prediction/common/prediction_gflags.h @@ -72,6 +72,7 @@ DECLARE_double(still_unknown_speed_threshold); DECLARE_double(still_obstacle_position_std); DECLARE_double(still_pedestrian_position_std); DECLARE_double(still_unknown_position_std); +DECLARE_double(slow_obstacle_speed_threshold); DECLARE_double(max_history_time); DECLARE_double(target_lane_gap); DECLARE_double(dense_lane_gap); diff --git a/modules/prediction/container/obstacles/obstacle.cc b/modules/prediction/container/obstacles/obstacle.cc index 7725cbee94a92e56895ec954bf37c44f6425681a..abe36542d3671940df6cad9ed26365edb4b84c64 100644 --- a/modules/prediction/container/obstacles/obstacle.cc +++ b/modules/prediction/container/obstacles/obstacle.cc @@ -100,6 +100,11 @@ bool Obstacle::IsStill() { return true; } +bool Obstacle::IsSlow() { + const Feature& feature = latest_feature(); + return feature.speed() < FLAGS_slow_obstacle_speed_threshold; +} + bool Obstacle::IsOnLane() const { if (feature_history_.size() > 0) { if (feature_history_.front().has_lane() && diff --git a/modules/prediction/container/obstacles/obstacle.h b/modules/prediction/container/obstacles/obstacle.h index 8828016871be76b116c2002f843dc533dd2a4325..a45a8ba2746cb08b17006adf5a35ec1191fd5ebd 100644 --- a/modules/prediction/container/obstacles/obstacle.h +++ b/modules/prediction/container/obstacles/obstacle.h @@ -151,6 +151,12 @@ class Obstacle { */ bool IsStill(); + /** + * @brief Check if the obstacle is slow. + * @return If the obstacle is slow. + */ + bool IsSlow(); + /** * @brief Check if the obstacle is on any lane. * @return If the obstacle is on any lane. diff --git a/modules/prediction/predictor/predictor_manager.cc b/modules/prediction/predictor/predictor_manager.cc index 9f238e9930b13383923ba3942ae8d68201500199..e0295c320d9561c5a8876ad85508b0ef2a06dbe3 100644 --- a/modules/prediction/predictor/predictor_manager.cc +++ b/modules/prediction/predictor/predictor_manager.cc @@ -270,7 +270,10 @@ void PredictorManager::PredictObstacle( } else { switch (obstacle->type()) { case PerceptionObstacle::VEHICLE: { - if (obstacle->HasJunctionFeatureWithExits() && + if (obstacle->IsSlow()) { + predictor = GetPredictor(ObstacleConf::FREE_MOVE_PREDICTOR); + CHECK_NOTNULL(predictor); + } else if (obstacle->HasJunctionFeatureWithExits() && !obstacle->IsCloseToJunctionExit()) { predictor = GetPredictor(vehicle_in_junction_predictor_); CHECK_NOTNULL(predictor);