-
Notifications
You must be signed in to change notification settings - Fork 18k
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
quadplane: mode_rtl: don't RTL during ground-idle #25553
Conversation
This does make me a little nervous, I think its fine now, but this is the sort of thing that might catch us out in the future. Maybe you could check that the previous mode is a VTOL one as well? |
Yeah, I think you're right. Alternatively, should this just be an on_ground or on_ground_maybe check instead of spool state? |
2806ce4
to
8555a4b
Compare
I've just changed this to check |
ArduPlane/mode_rtl.cpp
Outdated
@@ -18,6 +18,13 @@ bool ModeRTL::_enter() | |||
return true; | |||
} | |||
|
|||
// treat RTL as QLAND if we are armed but not flying | |||
// (when disarmed, allow RTL mode, so pilots can test switches) | |||
if (plane.arming.is_armed() && !plane.is_flying()) { |
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.
to make this tighter, it could be in a Q mode, and throttle is idle?
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.
ping @robertlong13
8555a4b
to
c612faf
Compare
// (when disarmed, allow RTL mode, so pilots can test switches) | ||
if (plane.arming.is_armed() && | ||
plane.control_mode->is_vtol_mode() && | ||
plane.quadplane.motors->get_desired_spool_state() == AP_Motors::DesiredSpoolState::GROUND_IDLE) { |
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.
It would be nice to have a !plane.is_flying()
in here too if it would still work in your use case. I wonder what Qland actually does in this case? One would hope it would just disarm, if it does I wonder if we would be better to just disarm in RTL and not change mode.
Actually, this new approach is fundamentally flawed (sorry for not getting around to basic testing before I put it up for the call):
I'm considering just closing this PR, but I'll leave it as a dev call topic in case someone has a great idea. I do think it would be nice to reduce the chance of RTL causing a takeoff while ground idling, but I don't think there's a great way to achieve it. |
@robertlong13 do you have a log of the issue? |
// (when disarmed, allow RTL mode, so pilots can test switches) | ||
if (plane.arming.is_armed() && | ||
plane.control_mode->is_vtol_mode() && | ||
plane.quadplane.motors->get_desired_spool_state() == AP_Motors::DesiredSpoolState::GROUND_IDLE) { |
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.
this looks like it would fail in QRTL during the approach phase
Similar to how we handle guided waiting for takeoff, we should treat RTL as QLand when the autopilot is confident that it is not flying. This is common when on the ground in QHover or QLoiter waiting to visually confirm all props are spinning. We don't want an errant switch flip to trigger a transition to forward flight.
Original description of this PR below: