提交 3f2e5b96 编写于 作者: D Dong Li 提交者: lianglia-apollo

planning: added reference_line_info id, which is used to distinguish

virtual objects from different reference lines.
上级 57eb7484
......@@ -24,8 +24,16 @@
namespace apollo {
namespace planning {
uint32_t ReferenceLineInfo::s_reference_line_id_ = 0;
ReferenceLineInfo::ReferenceLineInfo(const ReferenceLine& reference_line)
: reference_line_(reference_line) {}
: reference_line_(reference_line) {
id_ = std::to_string(s_reference_line_id_);
++s_reference_line_id_;
}
const std::string& ReferenceLineInfo::Id() const { return id_; }
bool ReferenceLineInfo::AddObstacle(const Obstacle* obstacle) {
auto path_obstacle = CreatePathObstacle(obstacle);
......
......@@ -36,6 +36,7 @@ namespace planning {
class ReferenceLineInfo {
public:
explicit ReferenceLineInfo(const ReferenceLine& reference_line);
const std::string& Id() const;
bool AddObstacles(const std::vector<const Obstacle*>& obstacles);
bool AddObstacle(const Obstacle* obstacle);
// FIXME(all) this interface is temp. solution to make the code work.
......@@ -62,6 +63,10 @@ class ReferenceLineInfo {
std::unique_ptr<PathObstacle> CreatePathObstacle(const Obstacle* obstacle);
bool InitPerceptionSLBoundary(PathObstacle* path_obstacle);
private:
static uint32_t s_reference_line_id_;
std::string id_;
/**
* @brief this is the number that measures the goodness of this reference
* line.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册