-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add post-landed behavior setting for NAV_LAND command #1867
base: master
Are you sure you want to change the base?
Conversation
I think this is the most sensible option for achieving the desired behaviour, while also keeping it backwards compatible |
I'm not opposed to this, however would point out that in ArduPilot this functionality is already achievable via mission items and appropriate parameter settings (see https://ardupilot.org/copter/docs/common-continue-mission.html). |
@ThomasDebrunner @auturgy Note that ArduPilot may achieve the desired behaviour, but that is not demonstrated by the video. The video shows disarming and then rearming and continuing. That to me is logical behaviour, but the PR here is to land WITHOUT disarming and then continue. I asked in the meeting why disarming is "undesirable" and you all seemed to think this was a valid use case. I still don't see it, so perhaps someone could explain? It is dangerous to not disarm but it is never dangerous to disarm. At most it might cost you a little time. Assuming this use case makes sense the other things I didn't fully understand.
In summary
|
@hamishwillee The problem is not really arming / disarming, it is more about autocontinue after land Except, in case you'd want a mission where some lands you want to automatically continue (e.g. package delivery) and on other lands you'd want to battery hot-swap (disarm, wait for operator to manually continue). I believe global params do not capture the complexity here and it is really about the specific mission. IMO, this needs to be either captured in the |
In ArduPilot you can turn off auto disarm in a parameter. You can then disarm/arm via mission items and continue mission if you want (or not disarm, add a delay, wait for a condition, run a lua script, etc, as you choose).
Either way there’s an additional step in designing a multi stage mission: either managing the command enum or adding a mission item.
… On 21 Jul 2022, at 6:41 pm, Thomas Debrunner ***@***.***> wrote:
@hamishwillee The problem is not really arming / disarming, it is more about autocontinue after land
@auturgy The way I understand it is that there is a param in Ardupilot that controls if missions automatically continue on land? So that would solve the issue for PX4 as well in this case.
Except, in case you'd want a mission where some lands you want to automatically continue (e.g. package delivery) and on other lands you'd want to battery hot-swap (disarm, wait for operator to manually continue).
For this case, it would have to be specified by the land item.
I believe global params do not capture the complexity here and it is really about the specific mission. IMO, this needs to be either captured in the autocontinue flag, or with this param (as defined here).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
@auturgy How (specifically) are you arming/disarming in a mission item? Are you using https://mavlink.io/en/messages/common.html#MAV_CMD_COMPONENT_ARM_DISARM ? Yes, either way you need some method of choosing the delay. I would have said that if autocontinue is not set the system should pause waiting for a manual instruction to continue. If it is set then the vehicle should continue to the next item as soon as it has "completed" the last one.
What am I missing? |
Possibly the fact that, while not strictly specified, generally disarming resets a mission. We would perhaps need to be clear that disarming only resets a completed mission. We would probably need to provide a mechanism to manually reset a mission too - that has been requested before. |
@auturgy Were you able to get any more information about how how it is being disarmed? The video shows landing but not disarming. If there is no need to arm/disarm when landing then setting the vehicle to not disarm on land via a parameter should work (along with appropriate delays etc.). If there is a need to disarm (and probably in general this is a good idea) then we would need to tell the flight stack not to reset the mission for this case. I am not sure how to specify that though. The obvious way to do this is to say that the mission should not reset following arm/disarm while the mission is not complete (i.e. is running or paused and still has items). The trick is making sure that the mission will still reset on arm/disarm for other cases - say emergency land, or after a mission abort, or if it is still landed and disarmed when the mission reaches the last item (say if mission landed, disarmed, released gripper, and finished). |
PS The above thinking makes me dislike the PR more as it allows the "land and don't disarm case" but not the "land, disarm, rearm, takeoff case". The don't disarm is simply to avoid the mission resetting, so you might reasonably consider changing this to "land but don't reset mission on disarm". |
"Were you able to get any more information about how how it is being disarmed? The video shows landing but not disarming." |
Thanks @auturgy So @ThomasDebrunner it turns out ArduPilot do pretty much what I suggested would needed - the use a parameter to configure resetting the mission on disarm/arm and to continue the mission on land. With that feature you can configure the mission however you like and it won't prematurely end. I'm not sure I would do it exactly like ArduPilot did.
IMO this is better than the proposal in the PR, which does not address the preference to disarm, and ignores the Thoughts? |
After discussing with @MaEtUgR as well, it seems like there are following options and the pros/cons: Using
|
It can't be fixed in the docs. The problem is that a mission resets when the vehicle arms/disarms. So either you can't disarm on landing, which is dangerous, or you need to somehow tell the flight stack that disarming does not trigger a reset of the mission. Once you've solved that problem then you can construct a landing that lands, disarms, takes off again etc. There are mission items to delay for a set time on the ground while you unload, but if you want to have a user-defined wait time you need to either use Hope that all makes sense. In response to the specifics
|
|
@ThomasDebrunner As discussed in MAV call, the "core" thing to make this work is some mechanism to ensure that after landing a disarm does not reset the mission. With that in place, you can define a mission however you like with takeoff/land etc. Without it does not matter what you do as your mission will disarm and then end on PX4. ArduPilot handles this case with a param "do not reset mission on arm/disarm when landed. Not clear how they then tell the system when it should reset. With an implementation we can now do that manually with MAV_CMD_DO_SET_MISSION_CURRENT but you might instead do something like "mission doesn't disarm when landed until after all mission items are complete". |
Context
With a recent PR in PX4-Autopilot, which introduced the possibility to plan a mission where the vehicle lands & takes off and continues to the next mission item, whereas previously the vehicle would've disarmed and wouldn't continue the mission, the following behavioral change was introduced:
GIF from the PR
Use case that was affected
Let's imagine you are a operator of a simple package delivery service in Hawaii.
You want to plan a mission of package delivery from the bottom of the mountain, to the top, land, and then make it return to launch. The mission flow until now has been something like this:
However, with the new change, it would look like this (only step 3 ~ 5 affected)
3. Drone doesn't disarm and idles (keeps spinning the propeller)
4. Operator is suprised as to why the drone didn't disarm
5. Drone takes-off, then flies back to the launch
Solution
The fact that vehicle disarms after landing has been useful in a lot of cases including the example but as well as doing a battery hot-swap (for long-range missions). And until now that was a reasonable assumption. However, with the use cases like package delivery (where the vehicle lands, places the package, then resumes the mission automatically), this assumption doesn't always hold true.
So I would like to propose specifying the "Post Land" behavior in the NAV_LAND command as the Mission item. With this change, without exclusively setting the Bit 1 to indicate "Don't disarm", the vehicle automatically disarming after landing behavior would be preserved.
And if the bit is set, the auto-continue in the middle of the mission would be supported as well (which would make the land-amid-mission PR more feature-complete).
Other
Thank you 😉 Open for feedbacks!