Building Global and Local Path Planners for Autonomous Robots
Autonomous navigation is not just about finding a route from A to B. A robot must plan a useful route through a map and continuously adapt that route to obstacles, other robots, people, and changes in its environment.
A practical navigation system therefore separates global planning from local planning.
Global vs Local Planning
Global Map
|
v
+------------------+
| Global Planner |
+------------------+
|
v
Global Path
|
v
+------------------+
Sensors>| Local Planner |
+------------------+
|
v
Velocity Commands
|
v
Robot
Global Planner
The global planner considers the larger environment.
Its job is typically to find a route such as:
Start ---> Corridor ---> Door ---> Room ---> Goal
Common approaches include:
- A*
- Dijkstra
- Graph search
- Grid-based planning
- Sampling-based planning
Local Planner
The local planner operates closer to the robot and reacts to current observations.
It considers:
- Nearby obstacles
- Robot velocity
- Robot footprint
- Dynamic objects
- Current trajectory
- Short-term goal direction
Why Both Are Needed
Suppose the global path is:
Robot -----> Hallway -----> Goal
A person suddenly walks into the hallway.
The global route may still be valid, but the robot needs to slow down, stop, or temporarily move around the person.
That is the local planner's job.
Grid-Based Global Planning
Represent the environment as a costmap:
. . . . . . .
. . # # . . .
. . # # . . .
. . . . . . .
. . . . . G .
S . . . . . .
A planner searches through free cells while assigning higher costs to undesirable regions.
Local Planning
A local planner can generate multiple candidate trajectories:
obstacle
###
Robot --> / | \
/ | / | candidate trajectories
Each trajectory can be scored based on:
- Collision risk
- Distance to path
- Distance to goal
- Smoothness
- Velocity
- Clearance
ROS 2 Architecture
/map
|
v
/global_planner
|
v
/global_plan
|
v
/local_planner <--- /scan /pointcloud
|
v
/cmd_vel
Keep the global and local planners modular so they can be tested independently.
Production Considerations
Monitor:
- Planning latency
- Path validity
- Obstacle updates
- Controller frequency
- Recovery behavior
- Localization quality
A robust navigation system should also have explicit recovery behavior when no safe local trajectory can be found.
Practical Design
Start with:
- A reliable map.
- A global planner.
- A local costmap.
- A local trajectory generator.
- Collision checking.
- Velocity limits.
- Recovery behaviors.
- Continuous monitoring.
The strongest navigation systems do not choose between global and local planning. They use both at different spatial and temporal scales.
Useful Links
- Website: https://www.v-modal.com
- SDK Flutter: https://github.com/v-modal/vmodal_sdk_flutter
- SDK Android: https://github.com/v-modal/vmodal_sdk_android
- Discord: https://discord.gg/K72z28KU
Top comments (0)