提交 72d26908 编写于 作者: L Liangliang Zhang 提交者: Jiangtao Hu

Planning: removed IsVirtualObstacle.

上级 ee5e454c
......@@ -90,7 +90,7 @@ Obstacle::Obstacle(const std::string& id,
<< perception_obstacle.DebugString();
is_static_ = (is_static || obstacle_priority == ObstaclePriority::IGNORE);
is_virtual_ = IsVirtualObstacle(perception_obstacle);
is_virtual_ = (perception_obstacle.id() < 0);
speed_ = std::hypot(perception_obstacle.velocity().x(),
perception_obstacle.velocity().y());
}
......
......@@ -119,11 +119,6 @@ class Obstacle {
static std::unique_ptr<Obstacle> CreateStaticVirtualObstacles(
const std::string& id, const common::math::Box2d& obstacle_box);
static bool IsVirtualObstacle(
const perception::PerceptionObstacle& perception_obstacle) {
return perception_obstacle.id() < 0;
}
static bool IsValidPerceptionObstacle(
const perception::PerceptionObstacle& obstacle);
......
......@@ -187,7 +187,7 @@ TEST(Obstacle, CreateStaticVirtualObstacle) {
Obstacle::CreateStaticVirtualObstacles("abc", box);
EXPECT_EQ("abc", obstacle->Id());
EXPECT_EQ(-314721735, obstacle->PerceptionId());
EXPECT_TRUE(Obstacle::IsVirtualObstacle(obstacle->Perception()));
EXPECT_TRUE(obstacle->IsVirtual());
auto& perception_box = obstacle->PerceptionBoundingBox();
EXPECT_DOUBLE_EQ(0.0, perception_box.center().x());
EXPECT_DOUBLE_EQ(0.0, perception_box.center().y());
......
......@@ -83,7 +83,7 @@ TrajectoryCost::TrajectoryCost(const DpPolyPathConfig &config,
ptr_obstacle->Perception().type() ==
perception::PerceptionObstacle::PEDESTRIAN);
if (Obstacle::IsVirtualObstacle(ptr_obstacle->Perception())) {
if (ptr_obstacle->IsVirtual()) {
// Virtual obstacle
continue;
} else if (ptr_obstacle->IsStatic() || is_bycycle_or_pedestrian) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册