Automated Throttle Sweep implementation in ArduPlane

I am trying to implement automated throttle sweep in the arduplane firmware. The process I am following is to modify the training mode to get the throttle input and then introduce a function for the throttle sweep whenever training mode is in effect.
Throttle input from transmitter is saved using this command “SRV_Channels::get_output_scaled(SRV_Channel::k_throttle)”. Whenever I am trying to save this data in the training mode it providing me a zero value. I have introduced a new variable and defined it in the plane.h, but I couldn’t log and save the throttle input.

Is there any other way to read the throttle input and then modify it?? Or which function should I use to write the throttle information?