Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d745303

Browse files
committedJul 3, 2024·
style(pre-commit): autofix
1 parent b02a20f commit d745303

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
 

‎perception/autoware_map_based_prediction/src/map_based_prediction_node.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,8 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
17751775

17761776
auto get_search_distance_with_decaying_acc = [&]() -> double {
17771777
const double acceleration_distance =
1778-
obj_acc * (1.0 / lambda) * t_h + obj_acc * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_h) - 1);
1778+
obj_acc * (1.0 / lambda) * t_h +
1779+
obj_acc * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_h) - 1);
17791780
double search_dist = acceleration_distance + obj_vel * t_h;
17801781
return search_dist;
17811782
};
@@ -1792,8 +1793,8 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
17921793
// then continues at constant speed for the rest of the time horizon
17931794
const double search_dist =
17941795
// Distance covered while accelerating
1795-
obj_acc * (1.0 / lambda) * t_f + obj_acc * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_f) - 1) +
1796-
obj_vel * t_f +
1796+
obj_acc * (1.0 / lambda) * t_f +
1797+
obj_acc * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_f) - 1) + obj_vel * t_f +
17971798
// Distance covered at constant speed
17981799
final_speed * (t_h - t_f);
17991800
return search_dist;

‎perception/autoware_map_based_prediction/src/path_generator.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ FrenetPoint PathGenerator::getFrenetPoint(
451451

452452
// Calculate the distance traveled until stopping
453453
auto distance_to_reach_zero_speed =
454-
v * t_stop + a * t_stop * (1.0 / lambda) + a * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_h) - 1);
454+
v * t_stop + a * t_stop * (1.0 / lambda) +
455+
a * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_h) - 1);
455456
// Output an equivalent constant speed
456457
return distance_to_reach_zero_speed / t_h;
457458
}
@@ -461,7 +462,8 @@ FrenetPoint PathGenerator::getFrenetPoint(
461462
// assume it will continue accelerating (reckless driving)
462463
const bool object_has_surpassed_limit_already = v > speed_limit;
463464
if (terminal_velocity < speed_limit || object_has_surpassed_limit_already)
464-
return v + a * (1.0 / lambda) + (a / (t_h * std::pow(lambda, 2))) * (std::exp(-lambda * t_h) - 1);
465+
return v + a * (1.0 / lambda) +
466+
(a / (t_h * std::pow(lambda, 2))) * (std::exp(-lambda * t_h) - 1);
465467

466468
// It is assumed the vehicle accelerates until final_speed is reached and
467469
// then continues at constant speed for the rest of the time horizon
@@ -471,7 +473,8 @@ FrenetPoint PathGenerator::getFrenetPoint(
471473
const double t_f = (-1.0 / lambda) * std::log(1 - ((speed_limit - v) * lambda) / a);
472474
const double distance_covered =
473475
// Distance covered while accelerating
474-
a * (1.0 / lambda) * t_f + a * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_f) - 1) + v * t_f +
476+
a * (1.0 / lambda) * t_f + a * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_f) - 1) +
477+
v * t_f +
475478
// Distance covered at constant speed for the rest of the horizon time
476479
speed_limit * (t_h - t_f);
477480
return distance_covered / t_h;

0 commit comments

Comments
 (0)
Please sign in to comment.