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

Make speed changes during missions obey WPNAV_ACCEL #12821

Open
wants to merge 1 commit into
base: master
from

Conversation

@bnsgeyer
Copy link
Contributor

bnsgeyer commented Nov 11, 2019

This PR is following up on what @ChristopherOlson did in PR #11068 which was closed for some reason. It fixes issue #11048. This PR is slightly different than Chris' PR in that it slews the WP speed both for increases in speed and decreases in speed.

Still uncertain why when the max XY accel is being passed to the position controller, it doesn't abide by that max accel parameter. This fixes the issue by slewing the wp speed changes passed to the position controller in accordance with the max wp accel.

@bnsgeyer bnsgeyer requested review from lthall and rmackay9 Nov 11, 2019
@bnsgeyer bnsgeyer force-pushed the bnsgeyer:pr-wpnav-obey-wpaccel branch 3 times, most recently from 6dde95a to b763ba8 Nov 11, 2019
@bnsgeyer

This comment has been minimized.

Copy link
Contributor Author

bnsgeyer commented Nov 12, 2019

@rmackay9 and @peterbarker I have made the requested changes. I did my best to streamline the update wp speed function. I couldn't do a simple if (wp_desired_speed == wp_current_speed) because both variables are floats and the compiler chewed me out for comparing floats. So I put the else statement which I think works just as well.
Randy, do you need me to put a backport in for copter 4.0?

@peterbarker

This comment has been minimized.

Copy link
Contributor

peterbarker commented Nov 12, 2019

@bnsgeyer

This comment has been minimized.

Copy link
Contributor Author

bnsgeyer commented Nov 12, 2019

I knew there was a function like that. I tried iszero() and it looks like i got the syntax wrong. thanks for the tips!

@bnsgeyer bnsgeyer force-pushed the bnsgeyer:pr-wpnav-obey-wpaccel branch from b763ba8 to 463a0fe Nov 13, 2019
@bnsgeyer

This comment has been minimized.

Copy link
Contributor Author

bnsgeyer commented Nov 13, 2019

@rmackay9 and @peterbarker I made the requested change and sqaushed the changes. I don't understand why I am getting the error in CI.

@peterbarker

This comment has been minimized.

Copy link
Contributor

peterbarker commented Nov 13, 2019

@bnsgeyer One failure was just travis failing to bring up a VM.

The second appears to be a result of recent sub tuning changes - that's going to be intermittent, sadly.

I've kicked both of them over.

@bnsgeyer

This comment has been minimized.

Copy link
Contributor Author

bnsgeyer commented Nov 13, 2019

@peterbarker thanks for the help.
@rmackay9 all checks have passed. Ready for merging.

@rmackay9

This comment has been minimized.

Copy link
Contributor

rmackay9 commented Dec 3, 2019

as discussed on the dev call I'll review this..

@CraigElder CraigElder removed the DevCallTopic label Dec 3, 2019
@rmackay9

This comment has been minimized.

Copy link
Contributor

rmackay9 commented Dec 3, 2019

Looking pretty good but I think maybe we need to set _wp_current_speed_cms within wp_and_spline_init().

Here's the situation where I think it could go wrong:

  • upload a mission with a long-ish leg in it
  • param set WP_SPEED 200 (a low speed)
  • Loiter
  • arm throttle
  • rc 3 1500
  • let the vehicle fly for a bit until it's up to 2m/s
  • setspeed 50 (and let the vehicle get up to maybe 15m/s)
  • Loiter (and let the vehicle slow to a stop)
  • Auto

I think what we will see is the vehicle will speed up to something like 10m/s but then slow down again to 2m/s (the default speed).

We can discuss whether when the mission restarts it should go back to the default 2m/s or to the 50m/s but the way master works at the moment it will return to the default... but the way it is it initially climbs up to a high-ish speed and then returns to 2m/s which users will find confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.