This project implements an autonomous mobile robot capable of navigating unknown environments without a pre-saved map. Developed for the CEN449 - Introduction to Autonomous Robots course, it utilizes the TurtleBot3 Waffle Pi platform within the Gazebo simulation environment.
The robot leverages Lidar sensor data to detect obstacles and makes real-time navigation decisions using a custom Python node, while simultaneously generating a 2D occupancy grid map via the Google Cartographer SLAM algorithm.
- Reactive Navigation: Custom Python algorithm (
otonom_surus.py) for obstacle avoidance using raw LaserScan data. - Real-Time SLAM: Simultaneous Localization and Mapping using Google Cartographer.
- High-Performance Communication: Configured with CycloneDDS middleware to resolve standard ROS 2 discovery and latency issues.
- Simulation: Fully simulated physics environment in Gazebo Classic.
The system consists of three main nodes communicating over ROS 2 topics:
- Simulation Node: Gazebo (Publishes
/scan,/odom,/tf). - SLAM Node: Cartographer (Consumes
/scan, publishes/map). - Control Node: Custom Python script (Consumes
/scan, publishes/cmd_vel).
- Ubuntu 22.04 LTS
- ROS 2 Humble Hawksbill
- TurtleBot3 Packages
- CycloneDDS (
sudo apt install ros-humble-rmw-cyclonedds-cpp)
To run this project, you need Ubuntu 22.04 and ROS 2 Humble. Follow these steps to install the required dependencies:
Open a terminal and run the following command to install Gazebo, TurtleBot3, and Cartographer packages:
sudo apt update
sudo apt install -y ros-humble-gazebo-* \
ros-humble-cartographer \
ros-humble-cartographer-ros \
ros-humble-navigation2 \
ros-humble-nav2-bringup \
ros-humble-turtlebot3*sudo apt install -y ros-humble-rmw-cyclonedds-cppInitialize the Gazebo world with the Waffle Pi model and CycloneDDS configuration:
source /opt/ros/humble/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.pysource /opt/ros/humble/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=Trueexport RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
python3 otonom_surus.pyhttps://www.youtube.com/watch?v=8ffMxJ7dHvs
(Please click the link above to watch the autonomous exploration and mapping process.)
otonom_surus.py: Main control logic script (Python).
proje_haritasi.pgm: Generated map file (image).
proje_haritasi.yaml: Map metadata configuration.
Proje_Raporu.pdf: Detailed project report containing system design and results.