|
|
|
@ -118,7 +118,7 @@ void AP_AutoTune::start(void)
@@ -118,7 +118,7 @@ void AP_AutoTune::start(void)
|
|
|
|
|
{ |
|
|
|
|
running = true; |
|
|
|
|
state = DEMAND_UNSATURATED; |
|
|
|
|
uint32_t now = hal.scheduler->millis(); |
|
|
|
|
uint32_t now = AP_HAL::millis(); |
|
|
|
|
|
|
|
|
|
state_enter_ms = now; |
|
|
|
|
last_save_ms = now; |
|
|
|
@ -174,7 +174,7 @@ void AP_AutoTune::update(float desired_rate, float achieved_rate, float servo_ou
@@ -174,7 +174,7 @@ void AP_AutoTune::update(float desired_rate, float achieved_rate, float servo_ou
|
|
|
|
|
// see what state we are in
|
|
|
|
|
ATState new_state; |
|
|
|
|
float abs_desired_rate = fabsf(desired_rate); |
|
|
|
|
uint32_t now = hal.scheduler->millis(); |
|
|
|
|
uint32_t now = AP_HAL::millis(); |
|
|
|
|
|
|
|
|
|
if (fabsf(servo_out) >= 45) { |
|
|
|
|
// we have saturated the servo demand (not including
|
|
|
|
@ -242,7 +242,7 @@ void AP_AutoTune::check_state_exit(uint32_t state_time_ms)
@@ -242,7 +242,7 @@ void AP_AutoTune::check_state_exit(uint32_t state_time_ms)
|
|
|
|
|
*/ |
|
|
|
|
void AP_AutoTune::check_save(void) |
|
|
|
|
{ |
|
|
|
|
if (hal.scheduler->millis() - last_save_ms < AUTOTUNE_SAVE_PERIOD) { |
|
|
|
|
if (AP_HAL::millis() - last_save_ms < AUTOTUNE_SAVE_PERIOD) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -263,7 +263,7 @@ void AP_AutoTune::check_save(void)
@@ -263,7 +263,7 @@ void AP_AutoTune::check_save(void)
|
|
|
|
|
|
|
|
|
|
// the next values to save will be the ones we are flying now
|
|
|
|
|
next_save = current; |
|
|
|
|
last_save_ms = hal.scheduler->millis(); |
|
|
|
|
last_save_ms = AP_HAL::millis(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -337,7 +337,7 @@ void AP_AutoTune::write_log(float servo, float demanded, float achieved)
@@ -337,7 +337,7 @@ void AP_AutoTune::write_log(float servo, float demanded, float achieved)
|
|
|
|
|
|
|
|
|
|
struct log_ATRP pkt = { |
|
|
|
|
LOG_PACKET_HEADER_INIT(LOG_ATRP_MSG), |
|
|
|
|
time_us : hal.scheduler->micros64(), |
|
|
|
|
time_us : AP_HAL::micros64(), |
|
|
|
|
type : type, |
|
|
|
|
state : (uint8_t)state, |
|
|
|
|
servo : (int16_t)(servo*100), |
|
|
|
|