I am doing rosject of course ‘ROS Navigation in 5 Days’. I am close to success but something happens.
Previously I have figured well the /move_base parameters and the planners are also running correctly. But after I finish the task of 4th part, it doesn’t work suddenly. I didn’t change anything in my_turtlebot_path_planning package.
Even though I set a obviously feasible goal, it still fails. The terminal keeps showing:
[ INFO] [1668106008.171177180, 343.120000000]: Got new plan
[ WARN] [1668106008.172361067, 343.120000000]: DWA planner failed to produce path.
But the situation is like this:
The bot is not close to any obstable, and the goal is obviously not near any obstacle as well. I don’t know why DWA planner cannot find a path, especially that everything goes well previously but afterwards not, even without changing anything.
And I change to another one planner and even meet with a new problem…
I change to ‘base_local_planner/TrajectoryPlannerROS’, but no matter what goal I set, the bot only goes to one direction… This is completely confusing me. Is there any existed problem in the simulation models itself?
Hi, something that strikes me is that I don’t see the actual map that should be published by the
map_server node. Do you have it there?
Also, what do you mean by “the bot only goes to one direction…” Do you mean that the robot is actually moving when you set the goal in rviz? If so, then you can assume that the planner is working, it’s just not finding a solution with the provided parameters.
It should work with the DWA planner. I recommend making absolutely sure the robot is well localized before trying to send navigation goals to it.
In the screenshot it shows the view of ‘costmap’. If I switch to ‘map’ view, it can correctly show. This is alright.
And for the “the bot only goes to one direction” issue, I found afterwards that this is perhaps the ‘escape’ behaviour in ‘base_local_planner/TrajectoryPlannerROS’, because I found this in params of TrajectoryPlanner:
I guess, the reason why the local planner doesn’t work right now is that the planner doesn’t find a valid path, and this is considered as a situation that needs to be ‘escaped’ by ‘TrajectoryPlanner’. Local planner keep not working, the bot keep ‘excaping’, a.k.a moving with velocity of ‘-0.1’, showing that it always goes to one direction.
I still have a question about localization, as you mention that. How can I ensure the initial positions are equal in both provided map from ‘map_server’ and the laser-data from ‘/scan’? For example, sometimes when I restart the simulatio, it will be initialized like this:
As you see the laser and map are not exactly the same. And when this happens every time, I have to manully use ‘2D Pose Estimate’ to adjust the initial position. Is there a way to ensure that they are superpose with each other, with code or some other topic/service?
The reason for that misalignment is because the robot is not yet localized.
amcl node is in charge of this, and there are two ways to fix it (although the image you show isn’t wrong, it’s just missing correct localization): Using the 2D pose estimate, or providing an initial pose in the
amcl configuration files.
I recommend adding 3 maps in rviz. One for the actual map, one for the global costmap and another for the local costmap.
It will also be helpful to display the robot frames and the footprint. This might give you a better idea of why your planner is not finding a path.
Thank you @roalgoal , I went to set extra parameters in amcl_parameters.yaml, which are for initial pose of robot. And it works. I don’t have to manually set initial pose any more.
For others who may concern, the parameters are:
set the values which you need in your own situation.