Skip to content

Commit

Permalink
po
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Takagi <[email protected]>
  • Loading branch information
yuki-takagi-66 committed Oct 4, 2024
1 parent 094bb13 commit 64c8313
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions planning/obstacle_avoidance_planner/src/mpt_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,13 @@ std::vector<TrajectoryPoint> MPTOptimizer::optimizeTrajectory(

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 retrun path_smoother output.");

Check warning on line 480 in planning/obstacle_avoidance_planner/src/mpt_optimizer.cpp

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (retrun)

Check warning on line 480 in planning/obstacle_avoidance_planner/src/mpt_optimizer.cpp

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (retrun)
return smoothed_points;
};

Expand All @@ -499,16 +504,15 @@ std::vector<TrajectoryPoint> MPTOptimizer::optimizeTrajectory(
// 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();
}

// 7. convert to points with validation
const auto mpt_traj_points = calcMPTPoints(ref_points, *optimized_variables, mpt_mat);
if (!mpt_traj_points) {
RCLCPP_WARN(logger_, "return std::nullopt since lateral or yaw error is too large.");
return get_prev_optimized_traj_points();
return smoothed_points;
}

// 8. publish trajectories for debug
Expand Down

0 comments on commit 64c8313

Please sign in to comment.