From ca9e46f80988a1144ff31f4908861e02b2aa9cfa Mon Sep 17 00:00:00 2001 From: Zhang Liangliang Date: Sat, 5 Aug 2017 13:16:11 -0700 Subject: [PATCH] [module: planning] bugfix -- set obstacle id for all mapping conditions. --- modules/planning/optimizer/st_graph/st_boundary_mapper.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/planning/optimizer/st_graph/st_boundary_mapper.cc b/modules/planning/optimizer/st_graph/st_boundary_mapper.cc index 89aacbdcb4..01df11d9f5 100644 --- a/modules/planning/optimizer/st_graph/st_boundary_mapper.cc +++ b/modules/planning/optimizer/st_graph/st_boundary_mapper.cc @@ -109,7 +109,7 @@ Status StBoundaryMapper::GetGraphBoundary( StGraphBoundary boundary; if (decision.has_follow()) { const auto ret = MapFollowDecision(obstacle, decision, &boundary); - if (ret.ok()) { + if (!ret.ok()) { AERROR << "Fail to map obstacle " << path_obstacle->Id() << " with follow decision: " << decision.DebugString(); return Status(ErrorCode::PLANNING_ERROR, @@ -147,6 +147,7 @@ Status StBoundaryMapper::GetGraphBoundary( decision.DebugString()); return Status(ErrorCode::PLANNING_SKIP, msg); } + boundary.set_id(path_obstacle->Id()); } } @@ -190,9 +191,8 @@ bool StBoundaryMapper::MapObstacleWithStopDecision( boundary_points.emplace_back(s_max, 0.0); *boundary = StGraphBoundary(boundary_points); - boundary->SetBoundaryType(StGraphBoundary::BoundaryType::FOLLOW); + boundary->SetBoundaryType(StGraphBoundary::BoundaryType::STOP); boundary->SetCharacteristicLength(st_boundary_config_.boundary_buffer()); - boundary->set_id(stop_obstacle.Id()); return true; } @@ -319,6 +319,7 @@ Status StBoundaryMapper::MapObstacleWithPredictionTrajectory( if (Double::compare(area, 0.0) > 0) { boundary->emplace_back(boundary_points); boundary->back().SetBoundaryType(b_type); + boundary->back().set_id(obstacle.Id()); skip = false; } } -- GitLab