Skip to content

A robust autonomous navigation program visualized in Foxglove Studio built in ROS 2 and C++, and includes Mapping, Global Planning (A*) and Path Tracking (Pure Pursuit).

License

Notifications You must be signed in to change notification settings

mchan5/ros2-autonomous-navigation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 Autonomous Navigation

ROS 2 C++

An autonomous navigation system built in C++ and ROS 2, and simulated in Foxglove.

0109.1.mp4

Process

Control Node

  • Subscribers: /path, /odom
  • Publishers: /cmd_vel
  • Function: Starts the journey by reorienting itself towards the final goal. It uses a Pure Pursuit controller, calculating the curvature required to reach a specific lookahead point, and dynamically throttles velocity based on turn sharpness to ensure a stable route.

Costmap Node

  • Subscribers: /lidar
  • Publishers: /costmap
  • Function: Calculates a "cost" for each section of the local area.
    • Low Cost: Unknown or safe to travel.
    • High Cost: Objects present; robot must avoid.
  • Logic: It converts Lidar data (polar coordinates) into Cartesian points via trigonometry, marks obstacles, and inflates them so that surrounding cells receive a decaying cost based on distance from the obstacle.

Map Memory Node

  • Subscribers: /costmap, /odom
  • Publishers: /map
  • Function: Transforms local sensor data into the global frame and accumulates it into a consistent, persistent grid (often visualized in red).
  • Logic: This ensures sensor data is "remembered" even after the robot moves away, creating a static map for the planner to refer to.

Planner Node

  • Subscribers: /map, /goal_point, /odom
  • Publishers: /path
  • Function: Implements the A (A-Star) algorithm* to find an efficient path to the goal point while considering obstacles.
  • Logic: It features a "Lazy Check" loop that continuously validates if the current path is safe as new Lidar data is provided, rather than replanning every single frame.

Acknowledgements

The framework and setup for this project was done by the WATonomous design team. The integration and programming of the modules listed above were done by me.

About

A robust autonomous navigation program visualized in Foxglove Studio built in ROS 2 and C++, and includes Mapping, Global Planning (A*) and Path Tracking (Pure Pursuit).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8