40 if (feature.
id() == FLAGS_ego_vehicle_id) {
52 semantic_map_->Init();
54 AINFO <<
"Init SemanticMap instance.";
58 BuildObstacleIdHistoryMap(obstacles_container);
59 semantic_map_->RunCurrFrame(obstacle_id_history_map_);
60 AINFO <<
"starting evaluating objects in semantic map";
61 std::vector<Obstacle*> dynamic_env;
64 if (obstacle ==
nullptr) {
68 ADEBUG <<
"Ignore still obstacle [" <<
id <<
"] in evaluator_manager";
77 std::vector<Obstacle*> dynamic_env) {
79 switch (obstacle->
type()) {
81 evaluator_->Evaluate(obstacle, obstacles_container);
91 std::vector<Obstacle*> dummy_dynamic_env;
95void EvaluatorManager::BuildObstacleIdHistoryMap(
97 obstacle_id_history_map_.clear();
98 std::vector<int> obstacle_ids =
100 obstacle_ids.push_back(FLAGS_ego_vehicle_id);
101 for (
int id : obstacle_ids) {
103 if (obstacle ==
nullptr || obstacle->
history_size() == 0) {
107 std::min(
static_cast<size_t>(10), obstacle->
history_size());
108 for (
size_t i = 0; i < num_frames; ++i) {
109 const Feature& obstacle_feature = obstacle->
feature(i);
111 feature.set_id(obstacle_feature.id());
112 feature.set_timestamp(obstacle_feature.timestamp());
113 feature.mutable_position()->CopyFrom(obstacle_feature.position());
114 feature.set_theta(obstacle_feature.velocity_heading());
115 if (obstacle_feature.id() != FLAGS_ego_vehicle_id) {
116 feature.mutable_polygon_point()->CopyFrom(
117 obstacle_feature.polygon_point());
118 feature.set_length(obstacle_feature.length());
119 feature.set_width(obstacle_feature.width());
121 const auto& vehicle_config =
122 common::VehicleConfigHelper::Instance()->GetConfig();
123 feature.set_length(vehicle_config.vehicle_param().length());
124 feature.set_width(vehicle_config.vehicle_param().width());
126 obstacle_id_history_map_[id].add_feature()->CopyFrom(feature);
128 obstacle_id_history_map_[id].set_is_trainable(
void Run(ObstaclesContainer *obstacles_container)
Run evaluators
void EvaluateObstacle(Obstacle *obstacle, ObstaclesContainer *obstacles_container, std::vector< Obstacle * > dynamic_env)
Evaluate obstacle
perception::PerceptionObstacle::Type type() const
Get the type of perception obstacle's type.
bool IsStill()
Check if the obstacle is still.
size_t history_size() const
Get the number of historical features.
const Feature & feature(const size_t i) const
Get the ith feature from latest to earliest.
const Feature & latest_feature() const
Get the latest feature.
const std::vector< int > & curr_frame_movable_obstacle_ids()
Get movable obstacle IDs in the current frame
const std::vector< int > & curr_frame_considered_obstacle_ids()
Get non-ignore obstacle IDs in the current frame
Obstacle * GetObstacle(const int id)
Get obstacle pointer
bool IsTrainable(const Feature &feature)
std::unordered_map< int, std::list< Obstacle * > > IdObstacleListMap
Use evaluator manager to manage all evaluators
optional apollo::perception::PerceptionObstacle::Type type
optional ObstaclePriority priority
optional Priority priority