提交 6ac48c97 编写于 作者: K kechxu 提交者: Yajia Zhang

Prediction: specify LRU cache capacity in obstacles container

上级 5cb3ac26
......@@ -69,6 +69,8 @@ DEFINE_int32(num_trajectory_still_pedestrian, 6,
DEFINE_double(still_speed, 0.01, "speed considered to be still");
DEFINE_string(vehicle_model_file,
"modules/prediction/data/mlp_vehicle_model.bin", "Vehicle model file");
DEFINE_int32(max_num_obstacles_stored, 100,
"maximal number of obstacles stored in obstacles container.");
// Obstacle trajectory
DEFINE_double(lane_sequence_threshold, 0.5,
......
......@@ -57,6 +57,7 @@ DECLARE_double(prediction_pedestrian_total_time);
DECLARE_int32(num_trajectory_still_pedestrian);
DECLARE_double(still_speed);
DECLARE_string(vehicle_model_file);
DECLARE_int32(max_num_obstacles_stored);
// Obstacle trajectory
DECLARE_double(lane_sequence_threshold);
......
......@@ -9,6 +9,7 @@ cc_library(
deps = [
"//modules/common/math:math_utils",
"//modules/common/util:lru_cache",
"//modules/prediction/common:prediction_gflags",
"//modules/prediction/container",
"//modules/prediction/container/obstacles:obstacle",
"//modules/prediction/container/pose:pose_container",
......
......@@ -19,6 +19,7 @@
#include <utility>
#include "modules/common/math/math_utils.h"
#include "modules/prediction/common/prediction_gflags.h"
namespace apollo {
namespace prediction {
......@@ -28,7 +29,10 @@ using apollo::perception::PerceptionObstacles;
std::mutex ObstaclesContainer::g_mutex_;
ObstaclesContainer::ObstaclesContainer() { timestamp_ = 0.0; }
ObstaclesContainer::ObstaclesContainer() {
obstacles_.set_capacity(FLAGS_max_num_obstacles_stored),
timestamp_ = 0.0;
}
void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
AINFO << "message: " << message.ShortDebugString();
......
......@@ -86,9 +86,6 @@ void MLPEvaluator::Evaluate(Obstacle* obstacle_ptr) {
ExtractFeatureValues(obstacle_ptr, lane_sequence_ptr, &feature_values);
double probability = ComputeProbability(feature_values);
lane_sequence_ptr->set_probability(probability);
ADEBUG << "Obstacle [" << id << "] has lane sequence ["
<< lane_sequence_ptr->ShortDebugString()
<< "].";
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册