Skip to content
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

Open
superware opened this issue Jul 22, 2016 · 24 comments
Open

Support MAV_CMD_DO_CHANGE_SPEED in auto-loiter #5122

superware opened this issue Jul 22, 2016 · 24 comments

Comments

@superware
Copy link

superware commented Jul 22, 2016

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.

@superware
Copy link
Author

Hi @dagar, do you know if this is implemented? thanks.

@dagar
Copy link
Member

dagar commented Dec 6, 2017

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.

@dagar dagar added this to the Release v1.8.0 milestone Dec 6, 2017
@superware
Copy link
Author

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?

@dagar
Copy link
Member

dagar commented Dec 7, 2017

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?

@hamishwillee
Copy link
Contributor

FWIW I think that it should reset between mode changes but persist through the mission.

@superware
Copy link
Author

Otherwise why not change the trim/cruise speed parameter directly?

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.

@superware
Copy link
Author

@dagar :)

@dagar
Copy link
Member

dagar commented Jan 8, 2018

Are we in agreement then? DO_CHANGE_SPEED is preserved for the duration of the mission?

@hamishwillee
Copy link
Contributor

@dagar Depends on whether you're saying it doesn't change even on mode change or not.

@superware
Copy link
Author

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.

@hamishwillee
Copy link
Contributor

hamishwillee commented Jan 8, 2018

@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?

@superware
Copy link
Author

superware commented Jan 9, 2018

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.

@hamishwillee
Copy link
Contributor

Sounds good to me. As I said, I just want a clear description :-)

@superware
Copy link
Author

Hi @dagar, what do you think?

@dagar
Copy link
Member

dagar commented Feb 12, 2018

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.

@superware
Copy link
Author

@dagar I have no experience in this, do you think it will be easy/safe to implement the most basic logic?

@dagar dagar removed this from the Release v1.8.0 milestone May 4, 2018
@stale stale bot closed this as completed Feb 13, 2019
@superware
Copy link
Author

@dagar hey, can you please reopen?

@PX4 PX4 deleted a comment from stale bot Aug 26, 2019
@PX4 PX4 deleted a comment from stale bot Aug 26, 2019
@julianoes julianoes reopened this Aug 26, 2019
@stale stale bot removed the Admin: Wont fix label Aug 26, 2019
@superware
Copy link
Author

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.

@stale
Copy link

stale bot commented Dec 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Dec 23, 2019
@BazookaJoe1900
Copy link
Member

still relevant

@stale stale bot removed the stale label Feb 21, 2020
@stale
Copy link

stale bot commented May 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label May 22, 2020
@superware
Copy link
Author

Still relevant.

@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Aug 22, 2020
@BazookaJoe1900
Copy link
Member

Still relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants