Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sanchez <daniel.sanchez@tier4.jp>
  • Loading branch information
danielsanchezaran committed Jan 16, 2024
1 parent ba7dcde commit dbcf617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,6 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
object.kinematics.acceleration_with_covariance.accel.linear.x,
object.kinematics.acceleration_with_covariance.accel.linear.y)
: 0.0;

// The decay constant λ = ln(2) / exponential_half_life
const double T = prediction_time_horizon_;
const double exponential_half_life = acceleration_exponential_half_life_;
Expand All @@ -1583,7 +1582,7 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
// V(t) = Vo + obj_acc(1/λ)(1-e^(-λt))
// x(t) = Xo + Vo * t + t * obj_acc(1/λ) + obj_acc(1/λ^2)e^(-λt) - obj_acc(1/λ^2)
// x(t) = Xo + (Vo + obj_acc(1/λ)) * t + obj_acc(1/λ^2)e^(-λt) - obj_acc(1/λ^2)
// acceleration_distance = obj_acc(1/λ) * t + obj_acc(1/λ^2)e^(-λt) - obj_acc(1/λ^2)
// acceleration_distance = x(T) = obj_acc(1/λ) * T + obj_acc(1/λ^2)(e^(-λT) - 1)
const double acceleration_distance =
obj_acc * (1.0 / λ) * T + obj_acc * (1.0 / std::pow(λ, 2)) * (std::exp(-λ * T) - 1);
double search_dist = acceleration_distance + obj_vel * T;
Expand Down
6 changes: 3 additions & 3 deletions perception/map_based_prediction/src/path_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ FrenetPoint PathGenerator::getFrenetPoint(
// The decay constant λ = ln(2) / exponential_half_life
// a(t) = acc - acc(1-e^(-λt)) = acc(e^(-λt))
// V(t) = Vo + acc(1/λ)(1-e^(-λt))
// x(t) = Xo + Vo * t + t * acc(1/λ) + acc(1/λ^2)e^(-λt)
// x(t) = Xo + (Vo + acc(1/λ)) * t + acc(1/λ^2)e^(-λt)
// acceleration_distance = acc(1/λ) * t + acc(1/λ^2)e^(-λt)
// x(t) = Xo + Vo * t + t * acc(1/λ) + acc(1/λ^2)(e^(-λt)-1)
// x(t) = Xo + (Vo + acc(1/λ)) * t + acc(1/λ^2)(e^(-λt)-1)
// acceleration_distance = acc(1/λ) * t + acc(1/λ^2)(e^(-λt)-1)
const double T = time_horizon_;
const float exponential_half_life = acceleration_exponential_half_life_;
const float λ = std::log(2) / exponential_half_life;
Expand Down

0 comments on commit dbcf617

Please sign in to comment.