Building Global and Local Path Planners for Autonomous Robots
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