This project implements a customized A* global planner for TurtleBot3 using ROS2 Nav2, designed to generate smoother, safer, and more cost-aware paths compared to the default Nav2 A* planner. The custom planner introduces heuristic weighting and obstacle cost penalties to improve navigation near obstacles while maintaining efficiency and stability.
ROS2 Nav2 compatible global planner plugin Heuristic-weighted cost function: balances goal distance and obstacle cost Safe, smooth path generation: avoids paths too close to inflated obstacles Tunable parameters: heuristic_weight and obstacle_penalty for flexible tuning Performance Monitoring Nodes: to evaluate path efficiency, goal reach time, and success rate
custom_a_star_planner/
├── include/custom_a_star_planner/
│ └── custom_a_star_planner.hpp
├── src/
│ └── custom_a_star_planner.cpp
├── config/
│ └── nav2_params.yaml
├── CMakeLists.txt
├── package.xml
└── planner_server.xmlBefore running this package, ensure you have: ROS2 Humble (or compatible) installed TurtleBot3 packages downloaded and sourced A valid map file (e.g., map.yaml) generated using SLAM
cd ~/turtlebot3_ws/src
git clone https://github.com/pranavak0201/custom_a_star.gitcd ~/turtlebot3_ws
colcon build --symlink-install
source install/setup.bashros2 launch turtlebot3_gazebo turtlebot3_world.launch.pyros2 launch turtlebot3_navigation2 navigation2.launch.py \
use_sim_time:=True \
map:=$HOME/map.yaml \
params_file:=$HOME/turtlebot3_ws/src/custom_a_star_planner/nav2_params.yamlros2 run performance_monitor performance_monitorros2 run performance_monitor goal_senderSmoother motion: reduced sharp turns and jerky behavior Better obstacle clearance: maintains safer distance from inflated obstacles Reduced local planner corrections: improved navigation consistency
Pranav K
LinkedIn: https://www.linkedin.com/in/pranav-kalyan-2aa12a343