I saw that in MC_position_cointrol.cpp, there is a function called control_manual(dt), in which the postion setpoint (_pos_sp) is caluclated according to the current control status:
reset_pos_sp function resets the setpoint to current position (_pos). However, I also saw that, in the same control_manual(dt) function, the setpoints are reset again if the copter is not engaged in position control mode. I just confused why the setpoints are set twice both in position control engaged and non-engaged scenario. Which is the final setpoint the copter tends to maintain?