Skip to content

Commit

Permalink
fix(autoware_velocity_smoother): fix shadowVariablefix:shadowVariable (
Browse files Browse the repository at this point in the history
…#7950)

fix:shadowVariable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
  • Loading branch information
kobayu858 authored Jul 18, 2024
1 parent b46734f commit 16e19c7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,14 @@ TrajectoryPoints AnalyticalJerkConstrainedSmoother::applyLateralAccelerationFilt

for (size_t i = 0; i < output.size(); ++i) {
for (const auto & lat_acc_filtered_range : latacc_filtered_ranges) {
const size_t start_index = std::get<0>(lat_acc_filtered_range);
const size_t end_index = std::get<1>(lat_acc_filtered_range);
const double min_latacc_velocity = std::get<2>(lat_acc_filtered_range);
const size_t filtered_start_index = std::get<0>(lat_acc_filtered_range);
const size_t filtered_end_index = std::get<1>(lat_acc_filtered_range);
const double filtered_min_latacc_velocity = std::get<2>(lat_acc_filtered_range);

if (
start_index <= i && i <= end_index &&
filtered_start_index <= i && i <= filtered_end_index &&
smoother_param_.latacc.enable_constant_velocity_while_turning) {
output.at(i).longitudinal_velocity_mps = min_latacc_velocity;
output.at(i).longitudinal_velocity_mps = filtered_min_latacc_velocity;
break;
}
}
Expand Down Expand Up @@ -415,15 +415,15 @@ bool AnalyticalJerkConstrainedSmoother::searchDecelTargetIndices(
}

if (!tmp_indices.empty()) {
for (unsigned int i = 0; i < tmp_indices.size() - 1; ++i) {
for (unsigned int j = 0; j < tmp_indices.size() - 1; ++j) {
const size_t index_err = 10;
if (
(tmp_indices.at(i + 1).first - tmp_indices.at(i).first < index_err) &&
(tmp_indices.at(i + 1).second < tmp_indices.at(i).second)) {
(tmp_indices.at(j + 1).first - tmp_indices.at(j).first < index_err) &&
(tmp_indices.at(j + 1).second < tmp_indices.at(j).second)) {
continue;
}

decel_target_indices.emplace_back(tmp_indices.at(i).first, tmp_indices.at(i).second);
decel_target_indices.emplace_back(tmp_indices.at(j).first, tmp_indices.at(j).second);
}
}
if (!tmp_indices.empty()) {
Expand Down

0 comments on commit 16e19c7

Please sign in to comment.