Skip to content

Commit

Permalink
fix(motion_velocity_smoother): fix external velocity limit if ego veh… (
Browse files Browse the repository at this point in the history
#299)

fix(motion_velocity_smoother): fix external velocity limit if ego vehicle is stopped

Signed-off-by: Azumi Suzuki <[email protected]>
  • Loading branch information
s-azumi authored Mar 2, 2023
1 parent 9b819e1 commit dbe4cd7
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ void MotionVelocitySmootherNode::onExternalVelocityLimit(const VelocityLimit::Co
constexpr double eps = 1.0E-04;
const double margin = node_param_.margin_to_insert_external_velocity_limit;

// Set distance as zero if ego vehicle is stopped and external velocity limit is zero
if (
std::fabs(current_odometry_ptr_->twist.twist.linear.x) < eps &&
external_velocity_limit_ < eps) {
external_velocity_limit_dist_ = 0.0;
}

// calculate distance and maximum velocity
// to decelerate to external velocity limit with jerk and acceleration
// constraints.
Expand Down

0 comments on commit dbe4cd7

Please sign in to comment.