提交 dbeb37cd 编写于 作者: H Hongyi 提交者: Xiangquan Xiao

Prediction: add new function and set for curr_frame_considered_obstacle_ids_

上级 e1b9aac4
......@@ -42,6 +42,7 @@ void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
curr_frame_id_mapping_.clear();
curr_frame_predictable_obstacle_ids_.clear();
curr_frame_non_predictable_obstacle_ids_.clear();
curr_frame_considered_obstacle_ids_.clear();
curr_frame_id_perception_obstacle_map_.clear();
PerceptionObstacles perception_obstacles;
......@@ -168,6 +169,27 @@ ObstaclesContainer::curr_frame_non_predictable_obstacle_ids() {
return curr_frame_non_predictable_obstacle_ids_;
}
const std::vector<int>&
ObstaclesContainer::curr_frame_considered_obstacle_ids() {
return curr_frame_considered_obstacle_ids_;
}
void ObstaclesContainer::SetConsideredObstacleIds() {
curr_frame_considered_obstacle_ids_.clear();
for (const int id : curr_frame_predictable_obstacle_ids_) {
Obstacle* obstacle_ptr = GetObstacle(id);
if (obstacle_ptr == nullptr) {
AERROR << "Null obstacle found.";
continue;
}
if (obstacle_ptr->ToIgnore()) {
ADEBUG << "Ignore obstacle [" << obstacle_ptr->id() << "]";
continue;
}
curr_frame_considered_obstacle_ids_.push_back(id);
}
}
std::vector<int> ObstaclesContainer::curr_frame_obstacle_ids() {
std::vector<int> curr_frame_obs_ids = curr_frame_predictable_obstacle_ids_;
curr_frame_obs_ids.insert(curr_frame_obs_ids.end(),
......
......@@ -111,6 +111,17 @@ class ObstaclesContainer : public Container {
*/
const std::vector<int>& curr_frame_non_predictable_obstacle_ids();
/**
* @brief Get non-ignore obstacle IDs in the current frame
* @return Non-ignore obstacle IDs in the current frame
*/
const std::vector<int>& curr_frame_considered_obstacle_ids();
/*
* @brief Set non-ignore obstacle IDs in the current frame
*/
void SetConsideredObstacleIds();
/**
* @brief Get current frame obstacle IDs in the current frame
* @return Current frame obstacle IDs in the current frame
......@@ -146,6 +157,7 @@ class ObstaclesContainer : public Container {
common::util::LRUCache<int, int> id_mapping_;
std::vector<int> curr_frame_predictable_obstacle_ids_;
std::vector<int> curr_frame_non_predictable_obstacle_ids_;
std::vector<int> curr_frame_considered_obstacle_ids_;
// perception_id -> prediction_id
std::unordered_map<int, int> curr_frame_id_mapping_;
// prediction_id -> perception_obstacle
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册