Skip to content

Commit

Permalink
add comment in generate path function
Browse files Browse the repository at this point in the history
Signed-off-by: yoshiri <[email protected]>
  • Loading branch information
YoshiRi committed Oct 20, 2023
1 parent 06267fc commit ae21652
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions perception/map_based_prediction/src/path_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,16 @@ FrenetPath PathGenerator::generateFrenetPath(

path.reserve(static_cast<size_t>(duration / sampling_time_interval_));
for (double t = 0.0; t <= duration; t += sampling_time_interval_) {
const double d_next_ = current_point.d + current_point.d_vel * t + 0 * 2 * std::pow(t, 2) +
lat_coeff(0) * std::pow(t, 3) + lat_coeff(1) * std::pow(t, 4) +
lat_coeff(2) * std::pow(t, 5);
const double current_acc =
0.0; // Currently we assume the object is traveling at a constant speed
const double d_next_ = current_point.d + current_point.d_vel * t +
current_acc * 2.0 * std::pow(t, 2) + lat_coeff(0) * std::pow(t, 3) +
lat_coeff(1) * std::pow(t, 4) + lat_coeff(2) * std::pow(t, 5);

Check warning on line 230 in perception/map_based_prediction/src/path_generator.cpp

View check run for this annotation

Codecov / codecov/patch

perception/map_based_prediction/src/path_generator.cpp#L228-L230

Added lines #L228 - L230 were not covered by tests
// t > lateral_duration: 0.0, else d_next_
const double d_next = t > lateral_duration ? 0.0 : d_next_;
const double s_next = current_point.s + current_point.s_vel * t + 2 * 0 * std::pow(t, 2) +
lon_coeff(0) * std::pow(t, 3) + lon_coeff(1) * std::pow(t, 4);
const double s_next = current_point.s + current_point.s_vel * t +
2.0 * current_acc * std::pow(t, 2) + lon_coeff(0) * std::pow(t, 3) +
lon_coeff(1) * std::pow(t, 4);

Check warning on line 235 in perception/map_based_prediction/src/path_generator.cpp

View check run for this annotation

Codecov / codecov/patch

perception/map_based_prediction/src/path_generator.cpp#L232-L235

Added lines #L232 - L235 were not covered by tests
if (s_next > max_length) {
break;
}
Expand Down

0 comments on commit ae21652

Please sign in to comment.