Autonomous Robot Project based on ROS 2 Jazzy and ESP32 implementing SLAM mapping, Nav2 autonomous navigation, EKF odometry fusion, and Gazebo Harmonic simulation.
Install Python dependencies:
pip install -r requirements.txtBuild the ROS 2 workspace:
colcon build --packages-select enc
source install/setup.bashTo run Nav2 navigation mode using the saved map on the physical robot:
ros2 launch enc navigation.launch.py(To specify a custom map path, pass map:=/path/to/your/my_map.yaml)
To run real-time SLAM mapping with the physical robot:
ros2 launch enc online_async_launch.pyNote on Map Path / Pose Graph: You can save the graph on the root folder to activate that and set the path into the navigation's launch file (
navigation.launch.pydefault path is set to~/my_map.yaml).
After completing the mapping process in SLAM, save the generated map:
ros2 run nav2_map_server map_saver_cli -f ~/my_map(Or save directly to the root folder: ros2 run nav2_map_server map_saver_cli -f ./my_map)
For testing and development in Gazebo Harmonic simulation, you can run simulation mode and provide a custom map path:
-
SLAM Mapping in Gazebo:
ros2 launch enc simulation.launch.py
-
Navigation in Gazebo (with custom map path):
ros2 launch enc navigation_sim.launch.py map:=/path/to/your/my_sim_map.yaml
encRobo/src/enc/launch/: Launch files for physical robot & Gazebo simulationencRobo/src/enc/config/: EKF, Nav2, and SLAM parametersencRobo/src/enc/enc/: Custom ROS 2 nodes (odometry publisher, waypoint follower, slip detector)encRobo/src/enc/description/: URDF/xacro robot model files