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

fix(autoware_pure_pursuit): fix redundantInitialization redundantInitialization #8225

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
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
Expand Up @@ -450,15 +450,13 @@
const bool is_reverse = (target_vel < 0);
const double min_lookahead_distance =
is_reverse ? param_.reverse_min_lookahead_distance : param_.min_lookahead_distance;
double lookahead_distance = min_lookahead_distance;
if (is_control_output) {
lookahead_distance = calcLookaheadDistance(
lateral_error, current_curvature, current_odometry_.twist.twist.linear.x,
min_lookahead_distance, is_control_output);
} else {
lookahead_distance = calcLookaheadDistance(
lateral_error, current_curvature, target_vel, min_lookahead_distance, is_control_output);
}
double lookahead_distance =
is_control_output
? calcLookaheadDistance(
lateral_error, current_curvature, current_odometry_.twist.twist.linear.x,
min_lookahead_distance, is_control_output)
: calcLookaheadDistance(

Check warning on line 458 in control/autoware_pure_pursuit/src/autoware_pure_pursuit/autoware_pure_pursuit_lateral_controller.cpp

View check run for this annotation

Codecov / codecov/patch

control/autoware_pure_pursuit/src/autoware_pure_pursuit/autoware_pure_pursuit_lateral_controller.cpp#L458

Added line #L458 was not covered by tests
lateral_error, current_curvature, target_vel, min_lookahead_distance, is_control_output);

// Set PurePursuit data
pure_pursuit_->setCurrentPose(pose);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ void SplineInterpolate::generateSpline(const std::vector<double> & x)
std::vector<double> w_;
w_.push_back(0.0);

double tmp;
for (int i = 1; i < N - 1; i++) {
tmp = 1.0 / (4.0 - w_[i - 1]);
const double tmp = 1.0 / (4.0 - w_[i - 1]);
c_[i] = (c_[i] - c_[i - 1]) * tmp;
w_.push_back(tmp);
}
Expand Down
Loading