Sudden jump when switching to auto

If I create a mission starting with a takeoff command with a terrain altitude frame and then manually fly to somewhere, where the terrain is either higher, or lower than at takeoff, there will be huge jump in the desired altitude when switching to AUTO followed by an agressive and strange reaction from the copter.

I can recreate it both IRL and in SITL. Already created a bug report including logs: https://github.com/ArduPilot/ardupilot/issues/20142

Ok, I have fixed the bug (or at least circumvented it) by adding one line of code to mode_auto.cpp: https://github.com/ArduPilot/ardupilot/pull/20153

Also tested it on AC4.1.5 on an actual copter. Here is the behaviour before:

And here is it with my fix:

I hope it can be backported to 4.1 to avoid having to wait for 4.2, not sure how to request this on GitHub.

Hi @Hoehenarbeit,

I have a similar problem on my drone (AC4.1.3) and I would like to download the code with your fix.
how can I do that? do you have an image (.apj) file with that fix?

(don’t want to upgrade to a different version, just stay with 4.1.3 and fix this specific problem).

thanks

What FC are you using? I have an .apj for CubeBlack and Orange.

@Hoehenarbeit I’m using pixhawk 4

another option for me is to downgrade to 4.1.1, do you know if it doesn’t have this bug?

did you have this fix for pixhawk 4?

I have the same problem with pixhawk 4.

Don´t have it for pixhawk 4, sorry.
4.1.1 I think will be the same.

@Hoehenarbeit tnx.
If I want to fix it by myself on my pixhawk4 ver 4.1.3 what should I do?

I have compiled the fixed version for you. Download from here for your board: ardupilot/bin at AC4.1.5TakeoffFix · Hasi123/ardupilot · GitHub

1 Like

thanks a lot! i really appreciate this

The problem has been fixed from 4.2 onwards. Please update and use the official release insted.