@@ -246,7 +246,8 @@ StaticCenterlineGeneratorNode::StaticCenterlineGeneratorNode(
246
246
if (centerline_source_param == " optimization_trajectory_base" ) {
247
247
optimization_trajectory_based_centerline_ = OptimizationTrajectoryBasedCenterline (*this );
248
248
return CenterlineSource::OptimizationTrajectoryBase;
249
- } else if (centerline_source_param == " bag_ego_trajectory_base" ) {
249
+ }
250
+ if (centerline_source_param == " bag_ego_trajectory_base" ) {
250
251
return CenterlineSource::BagEgoTrajectoryBase;
251
252
}
252
253
throw std::logic_error (
@@ -305,7 +306,8 @@ CenterlineWithRoute StaticCenterlineGeneratorNode::generate_centerline_with_rout
305
306
optimization_trajectory_based_centerline_.generate_centerline_with_optimization (
306
307
*this , *route_handler_ptr_, route_lane_ids);
307
308
return CenterlineWithRoute{optimized_centerline, route_lane_ids};
308
- } else if (centerline_source_ == CenterlineSource::BagEgoTrajectoryBase) {
309
+ }
310
+ if (centerline_source_ == CenterlineSource::BagEgoTrajectoryBase) {
309
311
const auto bag_centerline = generate_centerline_with_bag (*this );
310
312
const auto start_lanelets =
311
313
route_handler_ptr_->getClosestLanelets (bag_centerline.front ().pose );
@@ -443,14 +445,14 @@ std::vector<lanelet::Id> StaticCenterlineGeneratorNode::plan_route(
443
445
mission_planner->initialize (&node, map_bin_ptr_);
444
446
445
447
// plan route
446
- const auto route = mission_planner->plan (check_points);
448
+ auto route = mission_planner->plan (check_points);
447
449
448
450
return route;
449
451
}();
450
452
RCLCPP_INFO (get_logger (), " Planned route." );
451
453
452
454
// get lanelets
453
- const auto route_lane_ids = get_lane_ids_from_route (route);
455
+ auto route_lane_ids = get_lane_ids_from_route (route);
454
456
return route_lane_ids;
455
457
}
456
458
0 commit comments