-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
DO_CHANGE_SPEED applied during mission sticks #20159
Comments
This is one of those things that's been a bit ambiguous with different users wanting it both ways. I personally think it should reset on mode change, but even within that there are questions of when it should reset within a mission (pause and resume, restart mission, etc). |
Yes, for a pause it needs to be re-applied, or all the previous mission items re-played, however we implement it. I'd say it should be similar to camera and gimbal settings getting re-applied which also needs to be implemented. |
As a start we should probably differentiate between DO_CHANGE_SPEED in a mission vs command. |
We should, yes. The problem is that the logic is quite convoluted, spread across navigator and flight tasks. |
Values set in a mission should not escape the mission ever IMO. The most common pattern in MAVLink is that a MAV_CMD used in a command protocol sets "system defaults" that are then used for all commands like goto, orbit or whatever (that have a movement component). This would be used as the initial value for a mission unless overridden. The problem here though is the definition of MAV_CMD_DO_CHANGE_SPEED. What I describe above would be "the right thing" if the description said "set the cruise speed" but it does not. It says "set the speed setpoint". So it really depends on what everyone thinks this message does. If everyone thinks it is setting the cruise speed we're fine, yes this is a bug, and can we please implement as I suggested. |
I think it should rather be interpreted as "set current speed setpoint", not "default cruise speed". So yes, the speed set in the mission shouldn't be persistent when changing to Loiter mode (go to, Orbit, figure of 8, Hold) and vice-versa. I think this is something we could fairly easily implement, I already did for RTL (it will RTL at the default cruising speed, as it otherwise can be quite dangerous if the user sets a super low speed). Within the same Mode, so e.g. when doing multiple go to, the speed setpoint should be persistent, as it is not linked to one specific go to command (it's a separate command). |
@sfuhrer yes that would be great. I think you have the better overview of where/how to fix this than me. |
In support of this I have information from mavlink/mavlink#1890 (comment) that ArduPlane treats this setting as an override for the current mode. So if you switch out of the mode the value should revert to whatever is the default for that mode. This sounds very much like what @sfuhrer is saying - I updated MAVLInk to test this here: mavlink/mavlink#1892 PS. @sfuhrer They are also adding a value for param 2 to allow you to say "in mission" that you want to revert to the default. I think that is a good idea. |
Describe the bug
When you set the speed using DO_CHANGE_SPEED during a mission, I would expect it to reset the speed once you leave the mission mode. That's however not what happens. Instead, the last set cruise speed stays and is applied to Hold and "Go to/reposition" as well.
This happens in v1.13 but didin't use to be the case with v1.12.
@sfuhrer I assume this broke with #18834.
FYI @hamishwillee
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In my intuition the speed should reset once out of mission mode, and re-applied when going back into mission mode.
The text was updated successfully, but these errors were encountered: