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

In RTL, set wp velocity after controller is initialised #29363

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

Alternative to 1b29468

When mode_rtl init() is called, don't explicitly call wp_nav->wp_and_spline_init(g.rtl_speed_cms). I think this is redundant anyway since as soon as we pass the first wapoint to AC_WPNav, it will call wp_and_spline_init on it's own anyway. Critically, we don't send WPNav the RTL speed at this point, because this seems to be crux of the issue. If we pass WPNav a slow speed here then the vehicle always does a harsh stop, regardless of how far away the stopping point actually is.

To actually get the RTL speed to work, we instead set it explicitly ONLY after the vehicle has started the return back home (in return_start()).

Not my patch - I need to add the correct author on it yet.

When mode_rtl init() is called, don't explicitly call wp_nav->wp_and_spline_init(g.rtl_speed_cms). I think this is redundant anyway since as soon as we pass the first wapoint to AC_WPNav, it will call wp_and_spline_init on it's own anyway. Critically, we don't send WPNav the RTL speed at this point, because this seems to be crux of the issue. If we pass WPNav a slow speed here then the vehicle always does a harsh stop, regardless of how far away the stopping point actually is.

To actually get the RTL speed to work, we instead set it explicitly ONLY after the vehicle has started the return back home (in return_start()).
@rmackay9
Copy link
Contributor

Hi, thanks for this. I think this is probably not the correct solution though. The expected use of the navigation controller is that init is called first. So, I'm sure you're right that this resolves the issue but it's not the way that we should resolve it

@peterbarker
Copy link
Contributor Author

Hi, thanks for this. I think this is probably not the correct solution though. The expected use of the navigation controller is that init is called first. So, I'm sure you're right that this resolves the issue but it's not the way that we should resolve it

Perhaps, then, we should raise an internal error if get_wp_destination_loc (or the spline equivalent) is called and decides it needs to do the initialisation?

@rmackay9
Copy link
Contributor

@peterbarker,

Sure, that could be a good idea. The problem may be quadplane that doesn't always follow the rules

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

Successfully merging this pull request may close these issues.

2 participants