From 0f987012cd77e9cc89d721b6ed4ad6a9a155ca36 Mon Sep 17 00:00:00 2001 From: Yuki TAKAGI <141538661+yuki-takagi-66@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:18:02 +0900 Subject: [PATCH] chore(path_optimizer): add warn msg for exceptional behavior (#9033) Signed-off-by: Yuki Takagi Signed-off-by: prakash-kannaiah --- planning/autoware_path_optimizer/src/mpt_optimizer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/planning/autoware_path_optimizer/src/mpt_optimizer.cpp b/planning/autoware_path_optimizer/src/mpt_optimizer.cpp index fdffc8a926c24..8b48f78d117bb 100644 --- a/planning/autoware_path_optimizer/src/mpt_optimizer.cpp +++ b/planning/autoware_path_optimizer/src/mpt_optimizer.cpp @@ -477,8 +477,13 @@ std::vector MPTOptimizer::optimizeTrajectory(const PlannerData const auto get_prev_optimized_traj_points = [&]() { if (prev_optimized_traj_points_ptr_) { + RCLCPP_WARN(logger_, "return the previous optimized_trajectory as exceptional behavior."); return *prev_optimized_traj_points_ptr_; } + RCLCPP_WARN( + logger_, + "Try to return the previous optimized_trajectory as exceptional behavior, " + "but this failure also. Then return path_smoother output."); return traj_points; }; @@ -505,8 +510,7 @@ std::vector MPTOptimizer::optimizeTrajectory(const PlannerData // 6. optimize steer angles const auto optimized_variables = calcOptimizedSteerAngles(ref_points, obj_mat, const_mat); if (!optimized_variables) { - RCLCPP_INFO_EXPRESSION( - logger_, enable_debug_info_, "return std::nullopt since could not solve qp"); + RCLCPP_WARN(logger_, "return std::nullopt since could not solve qp"); return get_prev_optimized_traj_points(); }