-
Notifications
You must be signed in to change notification settings - Fork 154
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
Fix multiple retries despite planner_max_retries=0 (#287) #288
Fix multiple retries despite planner_max_retries=0 (#287) #288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm; I have added the explanation about how the different combinations on max_retries and patience work:
http://wiki.ros.org/move_base_flex#:~:text=mbf_simple_nav%20for%20details.-,Common%20Parameters,-~%3Cname%3E/planner_frequency%20(double
Actually, I have realized that for controller it works as without this PR!
https://github.com/magazino/move_base_flex/blob/53930c17632d45c0362eca14ca6a60cb83cc9ff2/mbf_abstract_nav/src/abstract_controller_execution.cpp#L415
I guess we should change it to make both match and also match to the documented behavior
@dorezyuk , @spuetz , do u agree?
Thanks for the tests and the pr. I think the base logic we want to implement here is
The only question is if we say the "retry logic" is disabled at max_retries < 0 or max_retries == 0. Both is fine for me, but I thought it might be confusing if we disable the "patience logic" at zero and the "retry logic" at max_retries < 0. On one hand the max_retries < 0 would be more consistent with move_base. On the other hand - move_base does not support the disabling of the "patience logic" - so they don't have this inconsistency... But if you guys feel its more intuitive to disable the "retry logic" at max_retries < 0, I'm fine with that. I don't entirely understand why we should return NO_PLAN_FOUND if we reach out max-retries (if its set to zero). For me this seems rather counter-intuitive. The biggest problem with this pr is that it creates a dead lock for the second row in the table above. If we say "retry logic" is disabled at max_retries < 0 and if the also disable the patience (patience.isZero == True), the code will never exit the loop |
I'd be in favor of infinite attempts for the max_retries < 0 case:
It seems that the parameter name max_retries is what is causing the inconsistency to begin with: If it was instead called
It just returns NO_PLAN_FOUND if it failed and it is not allowed to do any retries (which it already did before this PR); I was assuming that MAX_RETRIES should not be returned since it didn't do any retries:
My personal opinion is that the two NO_PLAN_FOUND and MAX_RETRIES return codes are a redundant to begin with; I just based my changes on what was already there to not break any existing code. Assuming we used NO_PLAN_FOUND regardless of how many retries were configured, then above table would simplify to:
Setting I also think this is a valid configuration, and exactly the behavior one would expect by giving infinite patience and infinite retires: It means the planner should never give up. I wouldn't recommend such a configuration, but it might be what the user wants if there are no alternative goals to target and no recovery behaviors. Or, the user has his own logic of when to cancel and re-send the action. |
Inf retries is a valid option; 👍 for merging this as it is (and do the same for exe_path, see my comment above) |
Yes, inf retries as an option makes sense... as the action and by that the execution can be canceled. |
fix for #287
As described in the issue, if
planner_max_retries
is set to0
andmakePlan()
fails before the patience is exceeded, the state should be set toNO_PLAN_FOUND
immediately, and no retries should occur (just like in the case whereplanner_patience
is set to 0).I also added a test for this fix (and they fail without the fix), and took the opportunity to add a few other cases that didn't have tests yet.