ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You are close to getting the point but indeed there are some misunderstandings I'll try to explain to you :
When you say :
And local planner also can detect some obstacles around the mobile robot, while the global planner can't
Here is your main misunderstanding. The global planner tries to find a path from the robot to the desired goal without colliding with the obstacles. The local planner will get the path from the global planner, a path is a succession of goals that the local planner will try to reach. If an obstacle is on the path of the robot (because it wasn't there when the global planner has calculated the path or if the path is too close from the obstacle) the local planner will change the current path to avoid it.
To answer your first question : yes it's possible to modify the global planner, there are some tutorials available to learn how to do so. You could maybe expand on the go to a strange place
but for example there are planners looking for the shortest path and others that would simply go in a straight line, you should have a look at the nav_core wiki that gives 3 differents global planners.
Your second questions should have been answered in point 2.
To sum up, the global planner is used to calculate the full path from the map and the local planner will simply calculate the appropriate cmd_vel
to follow the path and "correct" it if there is an obstacle detected.
Hope this answers your questions.