Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(motion_velocity_smoother): remove some heavy debug logging #8798

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Tier IV, Inc.

Check notice on line 1 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: Overall Code Complexity

The mean cyclomatic complexity decreases from 9.14 to 9.00, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -248,16 +248,7 @@
const auto vel_at_wp = interpolation::lerp(xs, vs, distances);
const auto acc_at_wp = interpolation::lerp(xs, as, distances);
const auto jerk_at_wp = interpolation::lerp(xs, js, distances);

Check notice on line 251 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 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());

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);
output_trajectory.at(start_index + i).acceleration_mps2 = acc_at_wp.at(i);
Expand Down
Loading