-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various RTL improvements (mainly VTOL specific) #16377
Conversation
7061aff
to
0ef2f6e
Compare
is this:
consistent with this?:
Have you considered if there should be a parameter that allows/avoids RTL at the Home location if in MC mode? I wonder how many VTOL people would always want to use the mission landing if at all possible? The "return to home" fall-back in the RTL_TYPE=1 logic was originally designed for the case when the mission landing accidentally gets deleted or gets overwritten with an infeasible landing pattern (which unfortunately is something that can easily happen). From the way this PR is currently written you intend the VTOL vehicle will perform different Return mode behaviors depending on the context. I wonder if that is how 100% of VTOL users will want it to work. I'm not a VTOL expert so I'm not advocating one way or another, just curious. |
Thanks for pointing this out. I actually wrote it down wrongly in the description. It will always use the mission landing for RTL if RTL_TYPE is 1. What changes is that it now won't follow the landing pattern (all that is after the DO_LAND_START) in hover, but directly go to Land and descend there. |
@@ -73,6 +76,12 @@ Mission::on_inactive() | |||
* is used for missions such as RTL. */ | |||
_navigator->set_cruising_speed(); | |||
|
|||
// if we were executing an landing but have been inactive for 2 seconds, then make the landing invalid | |||
// this prevents RTL to just continue at the current mission index | |||
if (_navigator->getMissionLandingInProgress() && (hrt_absolute_time() - _time_mission_deactivated) > 2_s) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow, how would this fail if the mission landing progress was set to false immediately on first inactivation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagar This prevents the situation where e.g. you are on a mission landing and then RTL kicks in. You don't want to start from the beginning but continue the mission. However, if e.g. the user takes over in manual during a mission landing and then switches back, you probably want to start he mission landing from scratch, as you have no clue where exactly you are and if you are still aligned with the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have been more specific, the part I don't follow is the magic 2 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagar A long study over many years has calculated this number to be the one and only reasonable value. It's almost like pi....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do it immediately on the actual mission deactivation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's track this in a separate issue - we shouldn't be blocking an incremental move towards a much better behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue to track that: #16488
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagar I think I might need to explain this a bit better:
When you are executing a mission landing and RTL kicks in due to low battery, then the mode switches from mission to RTL and back to mission (assuming you are executing a mission landing, which is the preferred choice almost always).
Two the second delay (it actually needs way less) allows the mission to just continue the landing rather than restarting the landing pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagar Sorry, I noticed I told you this before. What is the issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagar Sorry, I noticed I told you this before. What is the issue here?
Nothing necessarily, I just wanted to make sure there wasn't a potential hole for a hard to reproduce bug down the round. Eg dataman chokes reading the sdcard and there's a one off delay that's much longer than expected.

214f214
to
14735ee
Compare
in the master version, VTOL has a dangerous behavior when it reaches VTOL Land. desirable behavior is that VTOL transition location be near to land location to minimize power consumption, and the drone doesn't have that much tilt angle and oscillation in MC mode. |
…CEND_ALT before reaching home Signed-off-by: RomanBapst <[email protected]>
…a transition Signed-off-by: RomanBapst <[email protected]>
NAV_CMD_LOITER_TO_ALT - this allows vtol to track the loiter circle during the transition instead of trying to fly to the landing position Signed-off-by: RomanBapst <[email protected]>
- descend to RTL descend altitude - transition - move to land waypoint - loiter and then land Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
…nding - previously the decision of being on a landing pattern was taken by just looking at the current mission index. However, even if the current mission index indicates a landing pattern the vehicle could be at an arbitrary location, far from being established on the pattern. Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
…item instead of using the previous waypoint as landing target - the previous waypoint could be miles away Signed-off-by: RomanBapst <[email protected]>
…ilable Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: RomanBapst <[email protected]>
- this fixes a race condition which happens when an RTL is triggered during the final approach of a mission landing. In that case the mission inactive method is never called. Signed-off-by: RomanBapst <[email protected]>
- if vtol and in rotary wing mode then don't execute the mission landing because it's designed to be flow as a fixed wing - if vtol and in rotary wing mode and mission land is available then fly directly to landing point and don't go home! Signed-off-by: RomanBapst <[email protected]>
… landing - especially when there are strong winds it's better to just go straight to the landing point instead of trying to follow the planned path Signed-off-by: RomanBapst <[email protected]>
Signed-off-by: Silvan Fuhrer <[email protected]>
Signed-off-by: Silvan Fuhrer <[email protected]>
…TO_ALT for FW Do not use LOITER_TO_ALT for rotary wing mode as it would then always climb to at least MIS_LTRMIN_ALT, even if current clib altitude is below (e.g. RTL immediately after take off) Signed-off-by: Silvan Fuhrer <[email protected]>
Rebased on master. |
14735ee
to
0bc54f2
Compare
I also noticed that the standard_vtol back transition is behaving dangerously. it's on master and also in this pr, same mission, two instances, same-pr (firmware), back-transition behavior is different. dangerous.back-transition.mp4 |
Thanks for reporting - @RomanBapst @sfuhrer could you please follow up? |
@yuthikasagarage Have you reviewed your flights? It looks like the vehicle is overshooting the transition waypoint (so your plan is "not doable") and hence correcting. There is nothing wrong about the control performance, this seems to be more a planning UX / tuning issue than anything else. That still needs to be solved, but not necessarily in the VTOL controller. |
i will look into the flights again, and will try to tune the back transition and check whether the issue persists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, approving after intense flight testing.
This should be fixed with this PR, please re-test.
With the code from this PR in, it will transition at a distance of the loiter radius from home if no mission landing is planned and the waypoint before the landing waypoint isn't at the transition altitude (RTL_DESCEND_ALT). I'm aware that this isn't optimal for minimized hover time, but at least it should be an improvement to before where it could transition 100m above home and then descend in hover. |
Is it possible that VTOL first climbs to RTL_RETURN_ALT and keep this attitude until it reaches to landing pattern? |
That should be the desired behavior. If you noticed something else then let me know, that would indicate a bug. |
I having this problem with a tailsitter with very dangerous turns during transition. Is it possible to disable the navigation during transition? The sugested solution is to give more time to the backtransition? |
I don't think this is directly related to this specific PR - would you mind creating a new issue, and include some flight logs in the description? Thanks! |
@sfuhrer @Antiheavy Are there any docs changes related to this for PX4v1.12? My guess is yes, though it is unclear with the long thread, what delivered/what the landing behaviour is (?). Looking at the initial post, it is mostly about what should happen if RTL_TYPE is set to use a mission landing (RTL_TYPE=1) and there was no mission landing pattern defined - in which case it should fly down in FW mode to the descent altitude and then switch to MC and descend "as per usual". The description is a little flawed because it does not cater for the behaviour with rally points. Docs for vtol are here: |
Replaces #14728.
Describe problem solved by this pull request
Describe your solution
RTL logic with this PR, changes to current logic in bold
(assuming RTL_TYPE is set to 1 (VTOL and FW default, using mission landing if available))
RTL_RETURN_ALT
, come back and land at RTL landing position)RTL_RETURN_ALT
, fly to home, loiter down untilRTL_DESCEND_ALT
in FW mode, transition to hover and landTest data / coverage
SITL tested with Standard VTOL and multicopter.
Additional context
For VTOL, it is recommended to always fly with a mission landing planned, such that this one can be used during the RTL. Landing approaches using mission landing can be optimized for current wind direction (transition into the wind), and result in less hover time (vehicle transitions over hover, instead of while loitering around home)