Question about Source Code

Hi,

int32_t demanded_pitch = nav_pitch_cd + int32_t(g.pitch_trim * 100.0) + SRV_Channels::get_output_scaled(SRV_Channel::k_throttle) * g.kff_throttle_to_pitch;

The code snippet is from the Attitude.cpp file within ArduPlane. It’s inside the float Plane::stabilize_pitch_get_pitch_out() function. I’m confused about where the nav_pitch_cd value comes from. It is defined within plane.h, but I couldn’t find where it takes its value from.

Thanks

Look for Plane::calc_nav_pitch()