提交 28faaf96 编写于 作者: D Dong Li 提交者: Calvin Miao

added decision tag in PathObstacle

上级 81e78bb3
......@@ -40,13 +40,24 @@ bool PathObstacle::Init(const ReferenceLine* reference_line) { return true; }
const planning::Obstacle* PathObstacle::Obstacle() const { return obstacle_; }
void PathObstacle::AddDecision(const ObjectDecisionType& decision) {
void PathObstacle::AddDecision(const std::string& decider_tag,
const ObjectDecisionType& decision) {
decisions_.push_back(decision);
decider_tags_.push_back(decider_tag);
}
const std::vector<ObjectDecisionType>& PathObstacle::Decisions() const {
return decisions_;
}
const std::string PathObstacle::DebugString() const {
std::stringstream ss;
for (std::size_t i = 0; i < decisions_.size(); ++i) {
ss << "id: " << id_ << " decision: " << decisions_[i].DebugString()
<< ", made by " << decider_tags_[i];
}
return ss.str();
}
} // namespace planning
} // namespace apollo
......@@ -54,16 +54,25 @@ class PathObstacle {
const planning::Obstacle* Obstacle() const;
void AddDecision(const ObjectDecisionType& decision);
/**
* @class add decision to this obstacle.
* @param decider_tag identifies which component added this decision
* @param the decision to be added to this path obstacle.
*/
void AddDecision(const std::string& decider_tag,
const ObjectDecisionType& decision);
const std::vector<ObjectDecisionType>& Decisions() const;
const std::string DebugString() const;
private:
bool Init(const ReferenceLine* reference_line);
std::string id_;
const planning::Obstacle* obstacle_ = nullptr;
std::vector<ObjectDecisionType> decisions_;
std::vector<std::string> decider_tags_;
};
} // namespace planning
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册