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

move_base bug when get a new goal before makePlan() returns a planner_plan for old goal #949

Open
shiningjuly opened this issue Dec 21, 2019 · 0 comments

Comments

@shiningjuly
Copy link

This log file records what I met. After the first goal arrived, the robot received a second goal(different from the first, 180 degrees inverse), then move_base returned "goal arrived" immediately, while the robot didn't move at all.
捕获

And I think I've found the reason.
The planThread is making plan for the first goal(planner_frequency > 0), but the executeCycle() has reached goal and returned. Then the second goal arrives and executeCb() enters loop again, waiting for new_global_plan available to set plan to local planner. Now makePlan() returns, setting new_global_plan true, but the global plan is for the first goal. So the plan for the first goal is passed to local planner. Since the robot is already there, local planner returns "goal reached" immediately.
move_base

To simulate the delay in makePlan(), I add 15 seconds sleep before makePlan(), and I can easily repeat this phenomenon.

Here is my solution.
After makePlan() returns with a planner_plan, the planThread should check if a new planner_goal is available. If that's the case, the planner_plan should be abandoned, and planThread should go back to make plan for the new planner_goal.
I think this is reasonable, because as soon as a new goal arrives, the plan for the old goal should not be used.

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

No branches or pull requests

2 participants