Skip to content

Commit

Permalink
chore(behavior_velocity): refactor setVelocityFromIndex
Browse files Browse the repository at this point in the history
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
  • Loading branch information
taikitanaka3 committed Mar 15, 2022
1 parent 4ee8066 commit f931220
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions planning/behavior_velocity_planner/src/utilization/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ SearchRangeIndex getPathIndexRangeIncludeLaneId(
return search_range;
}

void setVelocityFrom(const size_t idx, const double vel, PathWithLaneId * input)
void setVelocityFromIndex(const size_t begin_idx, const double vel, PathWithLaneId * input)
{
for (size_t i = idx; i < input->points.size(); ++i) {
for (size_t i = begin_idx; i < input->points.size(); ++i) {
input->points.at(i).point.longitudinal_velocity_mps =
std::min(static_cast<float>(vel), input->points.at(i).point.longitudinal_velocity_mps);
}
Expand Down Expand Up @@ -94,7 +94,7 @@ void insertVelocity(
path.points.insert(path.points.begin() + insert_index, path_point);
}
// set zero velocity from insert index
setVelocityFrom(insert_index, v, &path);
setVelocityFromIndex(insert_index, v, &path);
}

Polygon2d toFootprintPolygon(const autoware_auto_perception_msgs::msg::PredictedObject & object)
Expand Down

0 comments on commit f931220

Please sign in to comment.