A custom Dynamic Window Approach (DWA) local planner implemented from scratch for TurtleBot3 in ROS2 Humble. This planner navigates the robot to goals while avoiding obstacles using velocity sampling, trajectory prediction, and cost-based evaluation.
- Velocity Sampling: Samples velocity commands within the robot's dynamic constraints
- Trajectory Prediction: Simulates forward trajectories for each velocity sample
- Cost Function: Evaluates trajectories based on distance to goal, obstacle avoidance, and path smoothness
- ROS2 Integration: Subscribes to
/odomand/scan, publishes/cmd_vel, visualizes trajectories in RViz
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/srcgit clone https://github.com/saumyaezhil/Custom-DWA-Local-Planner.gitcd ~/ros2_ws
colcon build --packages-select dwa_local_planner --symlink-install
source install/setup.bashsource /opt/ros/humble/setup.bash
export TURTLEBOT3_MODEL=burger
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.pycd ~/ros2_ws
source install/setup.bash
ros2 run dwa_local_planner simple_dwasource /opt/ros/humble/setup.bash
ros2 run rviz2 rviz2RViz Configuration:
- Set Fixed Frame to
odom - Add: LaserScan, Odometry, TF, MarkerArray (
/dwa_trajectories) - Use 2D Nav Goal tool to send navigation goals