Skip to content

Commit

Permalink
add comment to implementation
Browse files Browse the repository at this point in the history
Signed-off-by: mohammad alqudah <[email protected]>
  • Loading branch information
mkquda committed Dec 19, 2024
1 parent a37f673 commit 00c5db6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ bool MpcLateralController::isStoppedState() const
m_current_trajectory.points, m_current_kinematic_state.pose.pose, m_ego_nearest_dist_threshold,
m_ego_nearest_yaw_threshold);

// It is possible that stop is executed earlier than stop point, and velocity controller
// will not start when the distance from ego to stop point is less than 0.5 meter.
// So we use a distance margin to ensure we can detect stopped state.
static constexpr double distance_margin = 1.0;
const double target_vel = std::invoke([&]() -> double {
auto min_vel = m_current_trajectory.points.at(nearest).longitudinal_velocity_mps;
Expand Down

0 comments on commit 00c5db6

Please sign in to comment.