Skip to content

Commit

Permalink
comment out some heavy logging in the velocity smoother
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
  • Loading branch information
maxime-clem committed Sep 6, 2024
1 parent 46bf5ec commit 99ffcf4
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ bool calcStopVelocityWithConstantJerkAccLimit(
const auto jerk_at_wp = interpolation::lerp(xs, js, distances);

// for debug
std::stringstream ssi;
for (unsigned int i = 0; i < distances.size(); ++i) {
ssi << "d: " << distances.at(i) << ", v: " << vel_at_wp.at(i) << ", a: " << acc_at_wp.at(i)
<< ", j: " << jerk_at_wp.at(i) << std::endl;
}
RCLCPP_DEBUG(
rclcpp::get_logger("velocity_planning_utils"), "Interpolated = %s", ssi.str().c_str());
// std::stringstream ssi;
// for (unsigned int i = 0; i < distances.size(); ++i) {
// ssi << "d: " << distances.at(i) << ", v: " << vel_at_wp.at(i) << ", a: " << acc_at_wp.at(i)
// << ", j: " << jerk_at_wp.at(i) << std::endl;
// }
// RCLCPP_DEBUG(
// rclcpp::get_logger("velocity_planning_utils"), "Interpolated = %s", ssi.str().c_str());

Check notice on line 259 in planning/autoware_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Method

calcStopVelocityWithConstantJerkAccLimit decreases in cyclomatic complexity from 26 to 25, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

for (size_t i = 0; i < vel_at_wp.size(); ++i) {
output_trajectory.at(start_index + i).longitudinal_velocity_mps = vel_at_wp.at(i);
Expand Down

0 comments on commit 99ffcf4

Please sign in to comment.