Skip to content

Commit

Permalink
chore(path_optimizer): add warn msg for exceptional behavior (autowar…
Browse files Browse the repository at this point in the history
…efoundation#9033) (#1580)

Signed-off-by: Yuki Takagi <[email protected]>
  • Loading branch information
yuki-takagi-66 authored Oct 7, 2024
1 parent 169c736 commit afedb2f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions planning/autoware_path_optimizer/src/mpt_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,13 @@ std::vector<TrajectoryPoint> 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;
};

Expand All @@ -505,8 +510,7 @@ std::vector<TrajectoryPoint> 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();
}

Expand Down

0 comments on commit afedb2f

Please sign in to comment.