/**User must put verticaly the uav (nose bottom) and push * radio roll stick to get new calibration * If not, the default calibration is used. */ void ground_calibrate( bool_t triggered ) { switch (calib_status) { case NO_CALIB: if (cpu_time_sec < MAX_DELAY_FOR_CALIBRATION && pprz_mode == PPRZ_MODE_AUTO1 ) { calib_status = WAITING_CALIB_CONTRAST; DOWNLINK_SEND_CALIB_START(); } break; case WAITING_CALIB_CONTRAST: if (triggered) { ir_gain_calib(); estimator_rad_of_ir = ir_rad_of_ir; calib_status = CALIB_DONE; DOWNLINK_SEND_CALIB_CONTRAST(&ir_contrast); } break; case CALIB_DONE: break; } }
void vTask_5() { radio_control_task(); //main_auto.c ir_gain_calib(); }