PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.26k stars 13.41k forks source link

FW review RTL loiter behaviour #12035

Open dagar opened 5 years ago

dagar commented 5 years ago

From https://discuss.px4.io/t/plane-flyaway-recovery-rtl-loiter-then-flew-away/10991.

https://logs.px4.io/plot_app?log=a204d10b-a40d-4c05-9bb6-6f2c23bf574c

I found that putting a FIXED WING LANDING PATTERN in the mission FROM the preset “pattern” icon/button, then setting the RTL mode to head for the landing 1st (NOT head directly to home), causes the plane to go to that loiter-to-land pattern and subsequently line up to the runway and land correctly. That preset FW landing pattern is very nice - much nicer than basic waypoint and land. thx to the coder! . However, even with this fw landing pattern in place and working as such, if i tried to use the RTL mode that just flies directly to home, with the RTL conditions set to loiter for (time) 45sec then land, the plane would loiter for 45secs, then proceed to fly away in the direction of its choice. BUG! .

dagar commented 5 years ago

TODO: review FW RTL behavior, and consider requiring a planned landing by default if RTL can land at all.

1Gump commented 5 years ago

Before I added the "planned landing" (from the "pattern" icon/menu), I had a "land" waypoint with a preceding waypoint that would line the plane up for the runway. This worked sufficiently to land the plane in a mission, but would not work with the RTL cmd.

1Gump commented 5 years ago

@dagar , did 413acc5 fix this?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Antiheavy commented 5 years ago

@1Gump this PR might be a small help to preventing this, although I don't know if it fixes the fundamental bug.
https://github.com/PX4/Firmware/pull/12770

Is there actually a bug here after all? I see that RTL_LAND_DLY defaults ot -1 for fixed wing which means it should not try to Land even in the case of returning to home and loitering: https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/rc.fw_defaults#L36

Antiheavy commented 5 years ago

consider requiring a planned landing by default if RTL can land at all.

@dagar Honestly I don't know that this fully address the fundamental "problem" anyway since the mission landing is still very easily invalidated or deleted by the user uploading a bad mission in flight or just deleting the mission off the vehicle in flight. In this case Return to Home functionality is followed. If the user changed RTL_LAND_DLY away from the FW default of -1, then what would we actually do? Maybe they really do want the vehicle to land in whatever random heading once time expires (e.g. middle of open area, who knows).

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.