Skip to content

Commit

Permalink
Take out velocity requirement to always use integrated error in PID
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sanchez <[email protected]>
  • Loading branch information
danielsanchezaran committed Nov 16, 2023
1 parent a0a481c commit 44872a0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,10 @@ double PidLongitudinalController::predictedVelocityInTargetPoint(
double PidLongitudinalController::applyVelocityFeedback(
const Motion target_motion, const double dt, const double current_vel, const Shift & shift)
{
// NOTE: Acceleration command is always positive even if the ego drives backward.
const double vel_sign = (shift == Shift::Forward) ? 1.0 : (shift == Shift::Reverse ? -1.0 : 0.0);
const double diff_vel = (target_motion.vel - current_vel) * vel_sign;
const bool is_under_control = m_current_operation_mode.is_autoware_control_enabled &&
m_current_operation_mode.mode == OperationModeState::AUTONOMOUS;
const bool enable_integration =
(std::abs(current_vel) > m_current_vel_threshold_pid_integrate) && is_under_control;
const bool enable_integration = m_current_operation_mode.is_autoware_control_enabled &&
m_current_operation_mode.mode == OperationModeState::AUTONOMOUS;
const double error_vel_filtered = m_lpf_vel_error->filter(diff_vel);

std::vector<double> pid_contributions(3);
Expand Down

0 comments on commit 44872a0

Please sign in to comment.