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

Copter: support using WPNav for guided mode position control #18603

Merged
merged 4 commits into from
Sep 12, 2021

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Sep 8, 2021

This resolves, "Dijkstra's in Guided mode not working (reported by Yamaguchi-san)" on the Copter-4.1.0-beta testing issues list by adding a GUID_OPTIONS (=64) to allow using the waypoint navigation controller (aka AC_WPNav, aka SCurves) instead of the position controller to fly to a specified location/position.

The default remains to use the position controller but the difference is:

  • waypoint navigation support path planning (BendyRuler, Dijkastra's) while the position controller only supports simple avoidance
  • position controller support a much higher update rate (perhaps 50hz vs 3hz)

This implementation includes involves moving the current position controller method to a new "Pos" SubMode and then essentially reverting the "WP" sub mode to use AC_WPNav as it did in Copter-4.0.

Some unrelated changes in this PR:

  • GUID_OPTIONS param description is made more human readable
  • Removed unused set_desired_velocity_with_accel_and_fence_limits method

This has been tested in SITL including:

  1. flew in a horizontal triangular pattern using both controllers to confirm they acted as expected (they did). I also interrupted the vehicle by passing in a new Guided mode target and noticed that the two controllers take different paths (see below).
    poscon-vs-wpnav

  2. Enabled Dijkstra's and confirmed the vehicle flew around the fence
    image

@tatsuy
Copy link
Contributor

tatsuy commented Sep 8, 2021

I've confirmed that Dijkstra's works in SITL.
Thank you for your work!

Copy link
Contributor

@lthall lthall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice :)

@hendjoshsr71
Copy link
Member

hendjoshsr71 commented Sep 8, 2021

I played with this as well and it works for terrain following with dijkstra and dijkstras + bend with terrain following.

One note is sometimes it auto yaws to the last dijkstra "constructed wp" instead of where the last command was from. It doesn't always auto yaw though.

@rmackay9 rmackay9 merged commit e0dd294 into ArduPilot:master Sep 12, 2021
@rmackay9
Copy link
Contributor Author

Shoot, I meant to include this in -rc1

@rmackay9 rmackay9 deleted the copter-guid-pos branch September 12, 2021 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants