From 6466bd250fd4b74f6fa2552f6ad5f75fa8b34634 Mon Sep 17 00:00:00 2001 From: Ryuta Kambe Date: Thu, 20 Jun 2024 14:25:09 +0900 Subject: [PATCH] fix(autoware_behavior_velocity_planner_common): fix unusedScopedObject bug (#7570) Signed-off-by: Ryuta Kambe Signed-off-by: Simon Eisenmann --- .../src/utilization/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planning/behavior_velocity_planner/autoware_behavior_velocity_planner_common/src/utilization/util.cpp b/planning/behavior_velocity_planner/autoware_behavior_velocity_planner_common/src/utilization/util.cpp index 457c3a1271e31..89aac01c716a6 100644 --- a/planning/behavior_velocity_planner/autoware_behavior_velocity_planner_common/src/utilization/util.cpp +++ b/planning/behavior_velocity_planner/autoware_behavior_velocity_planner_common/src/utilization/util.cpp @@ -418,7 +418,7 @@ double findReachTime( return j * t * t * t / 6.0 + a * t * t / 2.0 + v * t - d; }; if (f(min, j, a, v, d) > 0 || f(max, j, a, v, d) < 0) { - std::logic_error("[behavior_velocity](findReachTime): search range is invalid"); + throw std::logic_error("[behavior_velocity](findReachTime): search range is invalid"); } const double eps = 1e-5; const int warn_iter = 100; @@ -450,7 +450,7 @@ double calcDecelerationVelocityFromDistanceToTarget( const double current_velocity, const double distance_to_target) { if (max_slowdown_jerk > 0 || max_slowdown_accel > 0) { - std::logic_error("max_slowdown_jerk and max_slowdown_accel should be negative"); + throw std::logic_error("max_slowdown_jerk and max_slowdown_accel should be negative"); } // case0: distance to target is behind ego if (distance_to_target <= 0) return current_velocity;