-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
fix: use external precland if available during missions #23625
base: main
Are you sure you want to change the base?
Conversation
cc7d69c
to
68ecafa
Compare
68ecafa
to
cd28776
Compare
Where's the description? What is the problem we're solving? |
added |
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.
Ah I see, so the issue is that the landing within a mission navigator is doing that internally and not switch the mode. I assume to some extent that's done to support landing and taking off again in the same mission. If you switch mode the mission will not continue anymore.
I'm not generally opposed but I'd check what the solution is for e.g. RTL at the end of a mission or switching to hold at the end of a takeoff. I'd avoid sending a vehicle command to switch mode if there's a nicer solution somewhere else.
Have you tested that the internal precision land still works or we fail in some cases e.g. does it still do precision land in RTL not just mission?
@@ -1004,12 +1030,16 @@ void MissionBlock::startPrecLand(uint16_t land_precision) | |||
{ | |||
if (_mission_item.land_precision == 1) { | |||
_navigator->get_precland()->set_mode(PrecLandMode::Opportunistic); | |||
_navigator->get_precland()->on_activation(); | |||
send_vehicle_command(vehicle_command_s::VEHICLE_CMD_DO_SET_MODE, 1, PX4_CUSTOM_MAIN_MODE_AUTO, |
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.
So as part of the mission we send a vehicle command to commander such that it switches mode? That's not a nice solution because it basically tells the state machine the user commanded a landing 🤔
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.
So as part of the mission we send a vehicle command to commander such that it switches mode?
Yes, the assumption is that you're at the end of the mission or RTL so you can just exit the mode.
It also tells the user in QGC that they are now in precision land so that's a small bonus.
That's not a nice solution because it basically tells the state machine the user commanded a landing
yea, it's the quick way.
I think the src id and compid would still be the fmu and dmesg would say from internal command instead of external. I can double check. So we can still know it didn't come from a control station or from any external mavlink command.
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.
However, it would show up in the ulog the same as a commander precland shell command.
Good point. That's something I didn't test. Maybe I can find a way to continue the mission if it broke.
Yes, that's tested. The expectation is that normal land and internal precland will still work for missions and RTL. |
Co-authored-by: Matthias Grob <maetugr@gmail.com>
I'm not sure I understood that part. What's the issue in those cases if the mode switches from mission to precland? |
When using a land mission item and enabling precision land, only the internal px4 precision land mode can be triggered. However, we need a way to use an external precision land mode that replaces the internal one within an uploaded mission. Currently, that is impossible, and the user would have to switch out of mission mode into precision land mode on their own.