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

Plane: add radius for GUIDED mode #19297

Closed
wants to merge 1 commit into from

Conversation

magicrub
Copy link
Contributor

Allow setting a radius specifically for mode GUIDED via mavlink. A radius of Zero indicates to use WP_LOITER_RAD which is the existing behavior

@IamPete1
Copy link
Member

How about a negative radius for a CCW loiter?

@HefnySco HefnySco added the Plane label Nov 19, 2021
@magicrub
Copy link
Contributor Author

How about a negative radius for a CCW loiter?

Still works. I don't know what the usual guided command mode is, but I/we use a loiter command (loiter_unlim in our case) which handles that by setting the loiter_CCW bit on the location

@pompecukor
Copy link

Allow setting a radius specifically for mode GUIDED via mavlink. A radius of Zero indicates to use WP_LOITER_RAD which is the existing behavior

Can you maybe also add a separate parameter for this? GUIDED_LOITER_RAD.
This would be really useful. We know from experience that SAR and Security users mostly need large radius on guided mode as the "observe/search". And for this reason we kept having the put unnecessarily large WP_LOITER_RAD. Another adverse effect is if the change the radius during the mission (like 500m) then forget about it and do a loiter to alt, which again would use such a big radius. The Loiter Rad in Mission planner would be controlling this instead of the WP loiter rad, which typically one would not be wanting to change on the fly.

@peterbarker
Copy link
Contributor

I really don't like the use of sending through these mission_item messages when we have so many other more appropriate messages we can use. AFAICS we're completely ignoring what sort of command is being passed in here....

I can think of two other approaches we can take off the top of my head. The first is to flesh out support for MAV_CMD_NAV_LOITER_UNLIM. Currently on Plane this just changes mode to loiter, ignoring all other fields in the message, like where-to-loiter-at and the loiter radius - the following PR changes that to honour these fields:
https://github.com/peterbarker/ardupilot/pull/new/wip/loiter-unlim-location-radius . Here is a branch for MAVProxy which adds support for the concept: https://github.com/peterbarker/MAVProxy/pull/new/wip/loiter-unlim-location-radius Note that neither of these branches are in good working order, particularly when it comes to altitude, but you can right-click on the map in MAVProxy and have it fly to somewhere and loiter at a user-supplied radius. The instantly-change-to-guided-mode-when-command-received is perhaps not in good taste but is much less likely to break people currently sending the command to ArduPlane.

The second approach - and the one I think I prefer - is to add support for MAV_CMD_DO_CHANGE_RADIUS. A GCS wishing to have the vehicle fly to a location and loiter at 400m would first send a MAV_CMD_DO_REPOSITION and if that is accepted follow it up with a MAV_CMD_DO_CHANGE_RADIUS to set the loiter radius at the other end.

@magicrub
Copy link
Contributor Author

After a rethink, this PR is definitely not the correct way forward. MAV_CMD_DO_REPOSITION is the proper way to use guided and adding radius should be done in one, or all, of the below methods in a new PR:

  1. add CMD_DO_REPOSITION.param3 = radius
  2. add MAV_CMD_DO_CHANGE_RADIUS, maybe with a enum param to specify which radius: WP loiter, loiter mode, guided, RTL
  3. add a new Guided WP Radius param

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

Successfully merging this pull request may close these issues.

6 participants