Skip to content

Commit da61a2f

Browse files
authored
fix(autoware_obstacle_cruise_planner): fix unusedScopedObject bug (#7569)
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
1 parent bfbe80e commit da61a2f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

planning/autoware_obstacle_cruise_planner/src/node.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ ObstacleCruisePlannerNode::ObstacleCruisePlannerNode(const rclcpp::NodeOptions &
409409
planner_ptr_ = std::make_unique<PIDBasedPlanner>(
410410
*this, longitudinal_info, vehicle_info_, ego_nearest_param_, debug_data_ptr_);
411411
} else {
412-
std::logic_error("Designated algorithm is not supported.");
412+
throw std::logic_error("Designated algorithm is not supported.");
413413
}
414414

415415
min_behavior_stop_margin_ = declare_parameter<double>("common.min_behavior_stop_margin");

planning/autoware_obstacle_cruise_planner/src/planner_interface.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ double findReachTime(
143143
return j * t * t * t / 6.0 + a * t * t / 2.0 + v * t - d;
144144
};
145145
if (f(min, j, a, v, d) > 0 || f(max, j, a, v, d) < 0) {
146-
std::logic_error("[obstacle_cruise_planner](findReachTime): search range is invalid");
146+
throw std::logic_error("[obstacle_cruise_planner](findReachTime): search range is invalid");
147147
}
148148
const double eps = 1e-5;
149149
const int warn_iter = 100;
@@ -175,7 +175,7 @@ double calcDecelerationVelocityFromDistanceToTarget(
175175
const double current_velocity, const double distance_to_target)
176176
{
177177
if (max_slowdown_jerk > 0 || max_slowdown_accel > 0) {
178-
std::logic_error("max_slowdown_jerk and max_slowdown_accel should be negative");
178+
throw std::logic_error("max_slowdown_jerk and max_slowdown_accel should be negative");
179179
}
180180
// case0: distance to target is behind ego
181181
if (distance_to_target <= 0) return current_velocity;

0 commit comments

Comments
 (0)