PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

[Bug] RTL reverse (RTL_TYPE=2): RTL_DELAY and RTL_DESCEND_ALT do not have effect

Open anaam-wingxpand opened this issue 1 year ago • 7 comments

Describe the bug

If RTL_TYPE = 2 and there is no mission landing waypoint, the SITL plane returns to a random point near Takeoff and tries to land but fails. This ignores the true Home position, and ignores the Return to Launch settings that say to loiter. Furthermore, it fails to land, continuously flying at 0 m altitude.

To Reproduce

  1. $ make px4_sitl gz_rc_cessna
  2. Upload any mission with a Takeoff but without a Landing.
  3. Go to Parameters and change RTL_TYPE to 2 (Return to a planned mission landing, or home)
  4. Go to Safety and note the option selected under "Return to launch, then: "
  5. Fly the mission, and during the mission hit Return flight mode or trigger a Return failsafe.
  6. See error.

Expected behavior

The SITL plane should either land successfully or wait (depending on the Return to Launch settings) at Home. In my case, Home was the Launch waypoint, where the plane had spawned at. This is the home that the plane would return to with other RTL_TYPEs.

Screenshot / Media

Note the incorrect home point, and the plane failing to land and continuously flying.

Screenshot from 2024-07-09 15-45-52 Screenshot from 2024-07-09 15-47-06

Flight Log

https://review.px4.io/plot_app?log=911929cb-52db-444f-93e6-3c969b94ba5d

Software Version

v1.14

Flight controller

N/A (SITL)

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

anaam-wingxpand avatar Jul 09 '24 20:07 anaam-wingxpand

This is similar to https://github.com/PX4/PX4-Autopilot/issues/23340

ryanjAA avatar Jul 10 '24 03:07 ryanjAA

In the v1.15.0-beta2 release, the SITL plane returns to the correct home position and actually lands with RTL_TYPE = 2.

However, it still completely ignores the Return to Launch settings. It always lands, and does not change altitude or loiter.

anaam-wingxpand avatar Jul 10 '24 14:07 anaam-wingxpand

We won't patch 1.14 anymore, and it's fixed in v1.15.

ignores the Return to Launch settings.

Which settings? RTL_LAND_DELAY?

sfuhrer avatar Jul 10 '24 18:07 sfuhrer

@sfuhrer yes, it ignores RTL_LAND_DELAY and RTL_DESCEND_ALT.

anaam-wingxpand avatar Jul 10 '24 19:07 anaam-wingxpand

@sfuhrer yes, it ignores RTL_LAND_DELAY and RTL_DESCEND_ALT.

This is actually expected if the RTL destination is a mission landing. The RTL_LAND_DELAY and RTL_DESCEND_ALT parameters are only used for the RTL to Home (without mission landing). What's the use case for you, why do you want to configure a delay and descend?

sfuhrer avatar Aug 14 '24 16:08 sfuhrer

@sfuhrer yes, it ignores RTL_LAND_DELAY and RTL_DESCEND_ALT.

This is actually expected if the RTL destination is a mission landing. The RTL_LAND_DELAY and RTL_DESCEND_ALT parameters are only used for the RTL to Home (without mission landing). What's the use case for you, why do you want to configure a delay and descend?

I'm saying that when RTL_TYPE = 2 and it RTLs to Home (without mission landing), it ignores RTL_LAND_DELAY and RTL_DESCEND_ALT. It immediately lands at home. This is unexpected behavior, because as you said, it should be using the delay and descend parameters in this case.

anaam-wingxpand avatar Aug 16 '24 13:08 anaam-wingxpand

Ah okay all clear now, and yes, I can reproduce. RTL_LAND_DELAY and RTL_DESCEND_ALT are not implemented in the reverse mission RTL, though I get that you would want them (e.g. for fixed-wing you do not want to land but keep it loitering around Home). @KonradRudin we'd need to add some more logic around here I guess. As it for the reverse mission should do the same logic as for the RTL_direct I wonder if we can use a shared library for both.

sfuhrer avatar Aug 19 '24 12:08 sfuhrer