Skip to content

demircagri51-source/Autonomous-Robot-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

🤖 Autonomous Navigation & SLAM with ROS 2

ROS 2 Python Gazebo Platform

📖 Project Overview

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.

✨ Key Features

  • 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.

🛠️ System Architecture

The system consists of three main nodes communicating over ROS 2 topics:

  1. Simulation Node: Gazebo (Publishes /scan, /odom, /tf).
  2. SLAM Node: Cartographer (Consumes /scan, publishes /map).
  3. Control Node: Custom Python script (Consumes /scan, publishes /cmd_vel).

🚀 Installation & Usage

Prerequisites

  • Ubuntu 22.04 LTS
  • ROS 2 Humble Hawksbill
  • TurtleBot3 Packages
  • CycloneDDS (sudo apt install ros-humble-rmw-cyclonedds-cpp)

⚙️ Setup & Installation

To run this project, you need Ubuntu 22.04 and ROS 2 Humble. Follow these steps to install the required dependencies:

1. Install TurtleBot3 & Simulation Packages

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*

2. Install CycloneDDS (Recommended)

sudo apt install -y ros-humble-rmw-cyclonedds-cpp

3. Launch Simulation Environment

Initialize 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.py

4. Start SLAM (Cartographer)

source /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:=True

5. Enable Autonomous Navigation

export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
python3 otonom_surus.py

🎥 Demonstration

https://www.youtube.com/watch?v=8ffMxJ7dHvs

(Please click the link above to watch the autonomous exploration and mapping process.)

📂 Project Structure

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.

About

Autonomous mobile robot simulation using ROS 2 Humble and Gazebo. Features reactive obstacle avoidance, real-time SLAM mapping (Cartographer), and custom Python-based navigation logic without pre-saved maps."

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages