The global planner is completely independent of a particular local planner implementation and vice versa.
You might had a look at the launch files in the teb_local_planner_tutorials source. Here move_base
is loaded with the common global planner:
<param name="base_global_planner" value="global_planner/GlobalPlanner" />
<param name="planner_frequency" value="1.0" />
But you can also use Navfn or any custom planner. But if you want to use the global path following mode (what I guess according to your description which mentions the global_plan_viapoint_sep parameter),
the only prerequiste is that the global planner provides a sequence of points rather than a single goal point. But this should be the case usually.
So how does it work?:
The global planner provides a path to the goal. In each sampling interval (according to the controller rate), the local planner (teb, dwa, ...) takes a subset of the global plan (usually the part that is contained in the local costmap) into account for local planning (think of a receding horizon). Let's denote the current goal of this horizon as virtual/local goal.
And yes, the teb_local_planner optimizes this initial route w.r.t. time-optimality by default.
In that case the teb_local_planner usually shortens the path to the current virtual goal.
In some applications the user might prefer to follow the global plan more strictly rather than taking always the fastest path to the virtual goal. This is addressed in the tutorial you are talking about.
The planner iterates the intermediate points of the global plan from the global planner along the current horizon to the virtual goal. Each intermediate point that is separated with a certain distance from its predecessor (parameter global_plan_viapoint_sep) is taken into account as attractor during optimization. I call these attractors via-points since our optimized trajectory should try to reach each of them. Of course, the trajectory is still time-optimal, but not w.r.t. the straight line between start and goal, but by incorporating via-points. The strength of attraction at each via-point can be adjusted according to weight_viapoint
. The default setting is not very strict. You can find further information and explanations in the tutorial. If something is missing, let me know or modify the content.
I hope that this small description answers your questions.
Edit: The first part of the tutorial does not consider any global plan. You can feed in via-points using rviz (publish point button) just to get familar with the optimization process and the weight_viapoint
parameter.