Skip to content

Commit

Permalink
AR_WPNav: allow target position on track to stop advancing
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 authored and tridge committed Mar 20, 2024
1 parent 158f794 commit 381fb42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/AR_WPNav/AR_WPNav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void AR_WPNav::advance_wp_target_along_track(const Location &current_loc, float
float track_velocity = curr_vel_NED.xy().dot(track_direction);
// set time scaler to be consistent with the achievable vehicle speed with a 5% buffer for short term variation.
const float time_scaler_dt_max = _overspeed_enabled ? AR_WPNAV_OVERSPEED_RATIO_MAX : 1.0f;
track_scaler_dt = constrain_float(0.05f + (track_velocity - _pos_control.get_pos_p().kP() * track_error) / curr_target_vel.length(), 0.1f, time_scaler_dt_max);
track_scaler_dt = constrain_float(0.05f + (track_velocity - _pos_control.get_pos_p().kP() * track_error) / curr_target_vel.length(), 0.0f, time_scaler_dt_max);
}
// change s-curve time speed with a time constant of maximum acceleration / maximum jerk
float track_scaler_tc = 1.0f;
Expand Down

0 comments on commit 381fb42

Please sign in to comment.