-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Support MAV_CMD_DO_CHANGE_SPEED in auto-loiter #5122
Comments
Hi @dagar, do you know if this is implemented? thanks. |
No, but it's a fairly easy addition. My only concern is how a DO_CHANGE_SPEED is respected. If you set it during mission should it be preserved if you switch to loiter? I could see people wanting that most of the time, but from a safety perspective I think any mode change should reset to the default. |
Think about altitude, what's the difference? IMHO the pilot should be aware of his current speed. There's "max speed" as a param (which makes sense since it's a platform "configuration" value), and now we're talking about "current max target speed", right? |
Altitude is unambiguous because it's in the actual waypoint. DO_CHANGE_SPEED is a command that can be inserted at any point or sent separately as a command. The question is what does that DO_CHANGE_SPEED apply to? The vehicles commanded speed for the entire mission, particular mission item or section, or even entire session? It seems clear to me that DO_CHANGE_SPEED should be a temporary adjustment in some sense. Otherwise why not change the trim/cruise speed parameter directly? |
FWIW I think that it should reset between mode changes but persist through the mission. |
Does it make sense to change a flash parameter in order to temporarily set current speed? I think parameters should be kept for configuration (such as max speed etc). Why not have a single global "current speed"? if the pilot is entering a specific mission it is his responsibility to check and verify all relevant information including waypoints positions, altitudes and speeds. This "current speed" should never exceed the configured "max speed" parameter anyway. |
@dagar :) |
Are we in agreement then? DO_CHANGE_SPEED is preserved for the duration of the mission? |
@dagar Depends on whether you're saying it doesn't change even on mode change or not. |
It makes sense to have a global target_speed, which can be changed at any mode. When entering mission mode, target_speed should be kept aside, the mission might change it via DO_CHANGE_SPEED or MAV_CMD_DO_REPOSITION, and when exiting mission - the previously kept value should be the new target_speed. |
@superware I don't really mind what we do but I clearly need to document it. At the moment my understanding is that if you are in a mission and you set the DO_CHANGE_SPEED this speed will be used through out the rest of the mission. So if you have a loiter mission item you'll circle at that speed in FW. If however you were to change the mode to HOLD then in FW you would revert to the pre-mission speed for the loiter. If you go back to the mission I am not sure what happens - does it keep its previoulsy set DO_CHANGE_SPEED or would that have been reset to the global speed by temporarily going into hold mode? |
Well, I think it's right to always keep the inner-mission target_speed when resuming a mission. Sending an explicit DO_CHANGE_SPEED (via COMMAND_LONG etc) while in mission should update that inner-mission target_speed, obviously. |
Sounds good to me. As I said, I just want a clear description :-) |
Hi @dagar, what do you think? |
Sorry, I haven't had time to implement this. @superware If you're interested I could help point you in the right direction to make the change. |
@dagar I have no experience in this, do you think it will be easy/safe to implement the most basic logic? |
@dagar hey, can you please reopen? |
Besides MAV_CMD_DO_CHANGE_SPEED which is still missing, I've tried utilizing MAV_CMD_DO_REPOSITION Speed param. It seems to work well, except that it's not possible to ONLY set the speed (with all other params as NaN) since NaN X/Y/Z is actually "hold in place". Keep in mind that a specific Z but NaN X/Y maintains the last X/Y set-point, so NaN sometime means "don't change" and sometimes "change to current". My suggestion is to use the Bitmask param (MAV_DO_REPOSITION_FLAGS) to control the different settings of each reposition command. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
still relevant |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Still relevant. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Still relevant |
It is much desired to set a general dynamic "target speed" for auto-loiter mode. Currently there is only one predefined speed as a param, this should act as the default (and obviously maximum) speed, and a COMMAND_LONG with MAV_CMD_DO_CHANGE_SPEED should set the "current speed" for following MAV_CMD_DO_REPOSITION commands.
General use case: clicking on the map at a position 1.5 km away, confirming re-position, PX4 starts navigating to the new position, the pilot decides to decrease speed for a section of 500 m in order to operate and point the gimbaled camera, the pilot decides to increase speed in order to reach destination as fast as possible.
The text was updated successfully, but these errors were encountered: