How is thrust setpoint calculated for altitude control?

I am trying to duplicate the controller in PX4 to ROS, but using the thrust setpoint as the output of altitude controller (PD) keeps making the vehicle to oscillate up and down. Does anyone know how the thrust setpoint is calculated when the altitude is controlled?

Thank you,

1 Like