提交 0bfb758d 编写于 作者: D Dong Li 提交者: Jiaming Tao

added IsStatic property in obstacle (#437)

上级 a5ae4924
......@@ -49,8 +49,7 @@ std::vector<Obstacle *> *DecisionData::MutableDynamicObstacles() {
void DecisionData::AddObstacle(Obstacle *obstacle) {
obstacles_.push_back(obstacle);
if (obstacle->Perception().type() ==
perception::PerceptionObstacle::UNKNOWN_UNMOVABLE) {
if (obstacle->IsStatic()) {
static_obstacles_.push_back(obstacle);
} else {
dynamic_obstacles_.push_back(obstacle);
......
......@@ -41,7 +41,17 @@ Obstacle::Obstacle(const std::string& id,
perception_obstacle_.position().y()},
perception_obstacle_.theta(),
perception_obstacle_.length(),
perception_obstacle_.width()) {}
perception_obstacle_.width()) {
is_static_ = IsStaticObstacle(perception_obstacle);
}
bool Obstacle::IsStatic() const { return is_static_; }
bool Obstacle::IsStaticObstacle(
const perception::PerceptionObstacle& perception_obstacle) {
return perception_obstacle.type() ==
perception::PerceptionObstacle::UNKNOWN_UNMOVABLE;
}
common::TrajectoryPoint Obstacle::GetPointAtTime(
const double relative_time) const {
......
......@@ -44,6 +44,8 @@ class Obstacle {
const std::string &Id() const;
bool IsStatic() const;
common::TrajectoryPoint GetPointAtTime(const double time) const;
common::math::Box2d GetBoundingBox(
const common::TrajectoryPoint &point) const;
......@@ -74,7 +76,10 @@ class Obstacle {
std::list<std::unique_ptr<Obstacle>> *obstacles);
private:
static bool IsStaticObstacle(
const perception::PerceptionObstacle &perception_obstacle);
std::string id_;
bool is_static_;
prediction::Trajectory trajectory_;
perception::PerceptionObstacle perception_obstacle_;
// FIXME move out later
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册