Skip to content

Commit

Permalink
fix(velocity_smoother): add acc limit on manual driving (#4113)
Browse files Browse the repository at this point in the history
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
  • Loading branch information
TakaHoribe committed Jun 30, 2023
1 parent 8b03061 commit f5b4053
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,10 @@ MotionVelocitySmootherNode::calcInitialMotion(
// We should plan from the current vehicle speed, but if the initial value is greater than the
// velocity limit, the current planning algorithm decelerates with a very high deceleration.
// To avoid this, we set the initial value of the vehicle speed to be below the speed limit.
const auto p = smoother_->getBaseParam();
const auto v0 = std::min(target_vel, vehicle_speed);
const Motion initial_motion = {v0, vehicle_acceleration};
const auto a0 = std::clamp(vehicle_acceleration, p.min_decel, p.max_accel);
const Motion initial_motion = {v0, a0};
return {initial_motion, InitializeType::EGO_VELOCITY};
}
}
Expand Down

0 comments on commit f5b4053

Please sign in to comment.