diff --git a/src/EZ-Template/PID.cpp b/src/EZ-Template/PID.cpp index 977c85a..709b73e 100644 --- a/src/EZ-Template/PID.cpp +++ b/src/EZ-Template/PID.cpp @@ -121,7 +121,7 @@ exit_output PID::exit_condition(bool print) { // If the robot is close to the target, start a timer. If the robot doesn't get closer within // a certain amount of time, exit and continue. This does not run while small_timeout is running - if (exit.big_error != 0 && exit.big_exit_time != 0) { // Check if this condition is enabled + else if (exit.big_error != 0 && exit.big_exit_time != 0) { // Check if this condition is enabled if (abs(error) < exit.big_error) { i += util::DELAY_TIME; if (i > exit.big_exit_time) { diff --git a/src/EZ-Template/drive/exit_conditions.cpp b/src/EZ-Template/drive/exit_conditions.cpp index 460f822..7927272 100644 --- a/src/EZ-Template/drive/exit_conditions.cpp +++ b/src/EZ-Template/drive/exit_conditions.cpp @@ -18,10 +18,10 @@ void Drive::pid_drive_exit_condition_set(okapi::QTime p_small_exit_time, okapi:: // Convert okapi units to doubles double se = p_small_error.convert(okapi::inch); double be = p_big_error.convert(okapi::inch); - double set = p_small_exit_time.convert(okapi::millisecond); - double bet = p_big_exit_time.convert(okapi::millisecond); - double vet = p_velocity_exit_time.convert(okapi::millisecond); - double mAt = p_mA_timeout.convert(okapi::millisecond); + int set = p_small_exit_time.convert(okapi::millisecond); + int bet = p_big_exit_time.convert(okapi::millisecond); + int vet = p_velocity_exit_time.convert(okapi::millisecond); + int mAt = p_mA_timeout.convert(okapi::millisecond); pid_drive_exit_condition_set(set, se, bet, be, vet, mAt); } @@ -34,10 +34,10 @@ void Drive::pid_turn_exit_condition_set(okapi::QTime p_small_exit_time, okapi::Q // Convert okapi units to doubles double se = p_small_error.convert(okapi::degree); double be = p_big_error.convert(okapi::degree); - double set = p_small_exit_time.convert(okapi::millisecond); - double bet = p_big_exit_time.convert(okapi::millisecond); - double vet = p_velocity_exit_time.convert(okapi::millisecond); - double mAt = p_mA_timeout.convert(okapi::millisecond); + int set = p_small_exit_time.convert(okapi::millisecond); + int bet = p_big_exit_time.convert(okapi::millisecond); + int vet = p_velocity_exit_time.convert(okapi::millisecond); + int mAt = p_mA_timeout.convert(okapi::millisecond); pid_turn_exit_condition_set(set, se, bet, be, vet, mAt); } @@ -50,10 +50,10 @@ void Drive::pid_swing_exit_condition_set(okapi::QTime p_small_exit_time, okapi:: // Convert okapi units to doubles double se = p_small_error.convert(okapi::degree); double be = p_big_error.convert(okapi::degree); - double set = p_small_exit_time.convert(okapi::millisecond); - double bet = p_big_exit_time.convert(okapi::millisecond); - double vet = p_velocity_exit_time.convert(okapi::millisecond); - double mAt = p_mA_timeout.convert(okapi::millisecond); + int set = p_small_exit_time.convert(okapi::millisecond); + int bet = p_big_exit_time.convert(okapi::millisecond); + int vet = p_velocity_exit_time.convert(okapi::millisecond); + int mAt = p_mA_timeout.convert(okapi::millisecond); pid_swing_exit_condition_set(set, se, bet, be, vet, mAt); }