mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:13:34 +08:00
The modified statements are intended to 1. Set a new Z position setpoint that is equivalent to the current distance to ground setpoint, and 2. Set a new distance to ground setpoint that is equivalent to the current Z position setpoint. They are only called in terrain hold mode, when activating/deactivating the holding (typically when coming to a stop and when starting to move again). The setpoints take the current control error into account, but because the control error is added, not subtracted, the result is that the new setpoint is 2 times the control error off from the old setpoint, instead of being at the same spot as the old setpoint.