-
Notifications
You must be signed in to change notification settings - Fork 4k
Guided mode improvements #12536
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
Guided mode improvements #12536
Conversation
A couple issues that remain (neither of them is a consequence of this PR, but maybe they should be fixed here) are:
|
Sorry it's taking me so long on this. I'm prepping for a big testing trip in Zimbabwe in a few weeks. So I'm totally swamped right now. |
I don't think this is a good idea. The concept of being in "Guided" mode is more of a QGC thing than a reality across firmwares. For example in PX4 when you Takeoff, and then takeoff is complete the vehicle goes into Hold flight mode. This is "Guided" mode for PX4. Which in turns means if you then do a goto, you will not be prompted to confirm. I get it's rare to get an accidental goto but this is a change in functionality from pervious version where someone might be used to getting a confirm and all of the sudden the vehicle just takes off in a direction right away. I think this should always require confirm without an option to turn off/on. Just like everything else. |
The |
No, it's for any kind of forward flight (fixed-wing or VTOL if it currently is in forward flight). That's why I added it, since there already is a fixedWing Vehicle Q_PROPERTY. |
Yeah, I think of VTOL as a fixed wing as well. Anyway, leave it as is. |
Testing PX4 sitl: I'm confused as to GoTo showing a loiter radius on the map for FW when flying PX4. Where does that radius come from if PX4 doesn't support radius on goto? |
Also since goto stores the loiter radius in settings so next time that's what you get. Should orbit do the same? |
That's the orbit mode telemetry. PX4 seems to send that whenever it's on a loiter pattern. That's on master as well, and since APM doesn't support orbit mode at all, I decided to make this PR as kind of a fallback so that it also gets loiter visuals in Guided mode most of the time. This PR also fixes an overlap between the GoTo and the Orbit visuals in PX4. |
I didn't know that and it's undesirable for my use case, but I can add it as an option defaulted to true if you want. It could affect both goto and orbit. |
It would be awesome if this worked a little more like Plan view. Where you can click on things to make them "interactive". Or in other words you click the Orbit or GoTo item in the map and the draggable radius things shows back up to change. Also not sure if the draggable thingies show the actual radius somewhere on the screen so you know how big you are making it? I know much more complicated, but also much nicer. |
I thought about adding an overlay when dragging that shows the current radius and I agree it would be very nice. As for the other things I'd say they would make it too easy to fat finger a loiter to somewhere you don't want. |
For interactive you still would need a confirm slider to make anything actually happen and then you can cancel as well. So confirm slider displays when you go into interactive. Finger futz radius. Confirm/Cancel. I think that's doable with the current guided controller stuff. |
That said, all depends on how much effort you want to put into this. It's ok as is. |
So where does this stand now? My only last thing was always confirm on goto's. |
I want to make a few improvements when I have the time, before the weekend
most likely
Update: I've been busy but I'll do this as soon as possible
|
It’d be great to fix the couple issues I mention in the first comment. Any
ideas of what causes the issue when switching to GoTo from Auto, and what
would be a good fix for the max distance fail?
|
There is console logging you can turn for GuidedActionsControler which is useful to debug these sorts of things. Can't remember the name. Look in the qml and you'll find it. |
The |
f697afa
to
72c7c54
Compare
Just pushed some changes to make the confirmation always required by default and to show the loiter radius while editing it (not sure if it looks "native" enough within QGC - please tell me if it doesn't). I think I'll fix the issues we were talking about and then reopen this. Your idea of "tapping to edit" sounds good but maybe it should be part of a wider effort to improve actions as a whole and make them more consistent? |
72c7c54
to
c06467c
Compare
yeah, that's all fine
What's the problem with this. Can you explain why it doesn't work for you? |
Could provide screen shots or a video so I can see what it looks like. Don't quite have time right now to get all this stuff up and running. |
c06467c
to
7a024d2
Compare
A config of one of our UAVs has an inward pointing camera to continuously point to whatever its circling around, which requires a very large loiter radius. Users of our UAVs often use GoTo commands for navigation but also for this loitering, and then when they use another GoTo command to reposition the aircraft, they might not notice the huge radius and accidentally send it into a collision course with distant terrain/obstacles. We used to have an overlay to set WP_LOITER_RAD directly (the Mission Planner way) and it was a nightmare because that way the radius is persistent even between flights, and it would even affect the Takeoff mode loiter radius. This caused many issues.
This should be pretty easy to do and maybe it could be the way to change the GoTo location without changing the radius. And when a new GoTo is sent it always uses the default radius. It would be great if it also made the altitude slider appear. I would still keep the individual Change Altitude action and the new Change Loiter Radius action this PR adds, though. |
Maybe I'm wrong but at that point wouldn't mapIndicator.actionConfirmed() have already been called? And thus the indicator icon will have already moved and will just disappear. This can be worked around but ideally it shouldn't happen in the first place. |
The guided commands which can fail due to settings or whatnot should return bool up through the call to return sucess/fail. Then that be used to call mapIndicator.cancelled in actionConfirmed. Or maybe there should be a new mapIndicator.actionFailed signal as well. In case something different needs to happen between cancel and fail behavior. Does that work? |
On the loiter radius saving, what you say makes me think that in general preserving the loiter radius as a setting across runs, vehicles, flights is probably a bad thing in general. Maybe it should be removed. What do you think? |
@rubenp02 Updates? Want to get this in before we lock down for 5.0. |
Added a visibility condition to the Orbit map item to hide it when the orbit is part of a Go To action, preventing both items from overlapping.
Fixed an issue where the Orbit and Go here map items would disappear upon opening the map click drop panel. Also tweaked the formatting of the conditional expression that controls the panel's opening.
Added logic to commit and revert coordinate changes for the Go here map item. Updated the Go To action handlers to utilize this logic, allowing the previous Go here item to be restored when a Go To action is cancelled.
Added a new property in the Vehicle class to determine if the vehicle is in forward flight. This was previously done in GuidedActionsController.qml but it's useful enough to include in the main Vehicle class. The existing logic in the GuidedActionsController module has been updated to utilize this new property.
Added support for the radius parameter of the MAV_CMD_DO_REPOSITION command. When in forward flight, this parameter can be used to specify the radius of the orbit around the Go here position in Guided Mode. A Fly View setting has been added to control this radius. Key changes: - Modified the guidedModeGotoLocation method across all firmware plugins to accept an optional forwardFlightLoiterRadius parameter, which sets the desired loiter radius during forward flight. - Added "Loiter Radius in Forward Flight" setting to the Guided Commands section of the FlyViewSettings to control the default radius. Note: PX4 doesn't doesn't handle the radius parameter per the MAVLink spec and therefore doesn't support this functionality.
Added circle visuals to the Go here map item to show the orbit pattern that aircraft in forward flight will follow upon reaching the position. This feature is already available in firmware that supports the ORBIT_EXECUTION_STATUS MAVLink message, so this is only shown for vehicles operating on firmware that lacks this support.
Added a new Guided mode action to change the radius of the orbit around the Go here position when in forward flight. This action integrates with the Go here circle visuals, allowing the new radius to be selected using the MapCircleVisuals interactive editing gizmo. The current radius is shown in a text bubble next to the gizmo.
Added a Fly View setting to require confirmation for the "Go to location" action when in Guided/Go To mode. This option can be disabled to avoid overly frequent confirmation requests, as accidental triggers are rare. A confirmation is always required if the vehicle is not already in Guided/Go To mode. The option is enabled by default to match the previous behavior behavior of always requiring confirmation.
I completely agree |
7a024d2
to
338bab2
Compare
I was meaning to fix the two bugs but if this is going into feature lock then it's probably better to merge this before that and fix them in a future PR. To be clear they were existing bugs, not part of this PR. |
Can you pull that out then? As far as feature lock goes I'll hold off until we get your stuff through. |
I'm going to merge this and the rest can go into another pull... |
Guided mode improvements
Description
Various improvements to Guided mode and its actions, mostly for ArduPilot.
Fix overlap between Go here and Orbit map items:
Added a visibility condition to the Orbit map item to hide it when the orbit is part of a Go To action, preventing both items from overlapping.
Fix Orbit and Go here map items disappearing:
Fixed an issue where the Orbit and Go here map items would disappear upon opening the map click drop panel. Also tweaked the formatting of the conditional expression that controls the panel's opening.
Restore previous Go here map item on cancellation:
Added logic to commit and revert coordinate changes for the Go here map item. Updated the Go To action handlers to utilize this logic, allowing the previous Go here item to be restored when a Go To action is cancelled.
Add property to check if vehicle in forward flight:
Added a new property in the Vehicle class to determine if the vehicle is in forward flight. This was previously done in GuidedActionsController.qml but it's useful enough to include in the main Vehicle class. The existing logic in the GuidedActionsController module has been updated to utilize this new property.
Support MAV_CMD_DO_REPOSITION radius parameter:
Added support for the radius parameter of the MAV_CMD_DO_REPOSITION command. When in forward flight, this parameter can be used to specify the radius of the orbit around the Go here position in Guided Mode. A Fly View setting has been added to control this radius.
Key changes:
Note: PX4 doesn't doesn't handle the radius parameter per the MAVLink spec and therefore doesn't support this functionality.
Add Go here circle visuals if in forward flight:
Added circle visuals to the Go here map item to show the orbit pattern that aircraft in forward flight will follow upon reaching the position.
This feature is already available in firmware that supports the ORBIT_EXECUTION_STATUS MAVLink message, so this is only shown for vehicles operating on firmware that lacks this support.
Add "Change Loiter Radius" action:
Added a new Guided mode action to change the radius of the orbit around the Go here position when in forward flight. This action integrates with the Go here circle visuals, allowing the new radius to be selected using the MapCircleVisuals interactive editing gizmo.
Add Go to confirmation option to Fly View settings:
Added a Fly View setting to require confirmation for the "Go to location" action when in Guided/Go To mode. The option is disabled by default to avoid constant confirmation requests, as accidental triggers are rare. However, a confirmation is always required if the vehicle is not already in Guided/Go To mode. Enabling this setting restores the previous behavior of always requiring confirmation.
Demo
guided-mode-improvements-demo.mp4
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.