-
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
MAV_CMD_DO_SET_MISSION_CURRENT - allow mission resetting #1870
MAV_CMD_DO_SET_MISSION_CURRENT - allow mission resetting #1870
Conversation
Co-authored-by: Julian Oes <julian@oes.ch>
@julianoes And of course PX4 does not support this :-). Worth adding to MISSION_SET_CURRENT as well or do I fix up the command and deprecate this version (on assumption commands are better for this kind of thing?) |
@peterbarker Would appreciate your review/advice on this. The current implementation of What this change does is:
I have looked at the ArduPilot implementation of this you did in ArduPilot/ardupilot#16687.
Point 2 is problematic, and the reason I am "hoping to do" this update. To give you some context, PX4 implements a normal pause just by changing the mode to hold mode (which is a separate mode, not a sub-mode of auto like in ArduPilot). But it implements a pause on autocontinue=false as a kind of sub mode. When I think this is a bit inconsistent. Should a call to this method do something different because of the type of pause, or because you happen to be flying in a plane? That's just confusing for users. It would be good if we can make And the last option - we give it a flag and be explicit about whether the call should continue the mission or not. |
PS We might further clarify this adding a Perhaps the bigger question is should this always make the mission continue? If I was in hold mode, would you expect this to change the mode back to auto and continue? |
@julianoes FYI I now know a bit more about how ArduPilot does "pause" and works with this
I'm still trying to work out whether we can align. I think the best thing would be if PX4 implements "not resuming following autocontinue=false" I can tell a good story. The other behaviours I can live with the inconsitency |
… in MISSION_STATE
@tridge @rmackay9 @peterbarker @julianoes Can I please have a new review of this MAV_CMD_DO_SET_MISSION_CURRENT/MISSION_SET_CURRENT update. This aligns them with how ArduCopter, PX4 and ArduPlane actually work using the terminology we used for the MISSION_CURRENT update. The main purpose is the jump counter addition, which has not changed since your last review. Specifically:
What it doesn't do is explain which systems allow the commands to change the state, and why - for example, ArduPlane uses a model where MAV_CMD_DO_SET_MISSION_CURRENT is used to set mission-state active when the mission is suspended, and then move the mission to auto to take off. While ArduCopter would might sit in AUTO and then use MISSION_START to start a mission. That would have to be in flight stack docs, though I hope to capture some of it in the mavlink devguide once all this is settled. @peterbarker I think the ideas are now baked enough to implement. |
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.
Thanks, I think this is pretty clear now!
Thanks @julianoes . Just waiting on ArduPilot review. |
The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item). | ||
</description> | ||
<param index="1" label="Number" minValue="-1" increment="1">Mission sequence value to set. -1 for the current mission item (use to reset mission without changing current mission item).</param> | ||
<param index="2" label="Reset Mission" minValue="0" maxValue="1" increment="1">Resets mission. 1: true, 0: false. Resets jump counters to initial values and changes mission state "completed" to be "active" or "paused".</param> |
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 like the counter reset idea.
Thanks for reviews! Merging. |
This changes one of the unused params in
MAV_CMD_DO_SET_MISSION_CURRENT
so that it can be used to reset a mission "fully".Prior to this the command would just update the current mission item.
With this change you can optionally specify that setting the current mission item also clears any "completion status" and makes the mission active again, and that the mission counters are reset.
This effectively means that
MAV_CMD_DO_SET_MISSION_CURRENT
can be used as a hypothetical "reset mission" command by setting the mission item to 1 and the new flag.@auturgy @julianoes Make sense?