Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐢 ROS2 Multi-Node Control and Coordination

ROS2 Python Ubuntu


📌 Overview

This project demonstrates a multi-node ROS2 application built using the Turtlesim simulator. A primary turtle (turtle1) autonomously chases dynamically spawned turtles using ROS2 nodes, topics, services, timers, and custom interfaces. The project focuses on ROS2 fundamentals and runtime introspection, not advanced robotics algorithms.


🧠 System Architecture

Nodes

  • /turtlesim (ROS2 provided) ROS2-provided simulation node. Publishes turtle pose and exposes /spawn and /kill services.

  • /turtle_spawner Spawns turtles periodically and publishes the list of active turtles.

  • /turtle_controller Subscribes to turtle pose and active turtle list, and publishes velocity commands to move turtle1.


🔄 Communication

Topics

  • /turtle1/pose
  • /turtle1/cmd_vel
  • /alive_turtles

Services

  • /spawn
  • /kill

Custom Interfaces

Turtle.msg

string name
float32 x
float32 y
float32 theta

TurtleArray.msg

Turtle[] turtles

CatchTurtle.srv

string name
---
bool success

📂 Repository Structure

ros2-turtlesim-catch-them-all/
├── README.md
├── screenshots/
│   ├── launch_and_simulation.png
│   ├── node_list.png
│   ├── topic_list.png
│   ├── alive_turtles_info.png
│   └── rqt_graph.png
├── videos/
│   └── turtlesim_demo.gif
├── src/
│   ├── my_robot_bringup/
│   │   ├── launch/
│   │   │   └── turtlesim_catch_them_all.launch.xml
│   │   ├── config/
│   │   │   └── catch_them_all_config.yaml
│   │   └── package.xml
│   ├── my_robot_interfaces/
│   │   ├── msg/
│   │   │   ├── Turtle.msg
│   │   │   ├── TurtleArray.msg
│   │   ├── srv/
│   │   │   └── CatchTurtle.srv
│   │   └── package.xml
│   └── turtlesim_catch_them_all/
│       ├── turtlesim_catch_them_all/
│       │   ├── turtle_controller.py
│       │   └── turtle_spawner.py
│       └── package.xml


🛠 Prerequisites

  • Ubuntu 24.04 LTS
  • ROS2 Jazzy
  • Python 3.12

⚙️ Build Instructions

Update dependencies

  rosdep update
  rosdep install --from-paths src --ignore-src -y

Build workspace

  colcon build --symlink-install

Source environment

  source install/setup.bash

▶️ Run the Project

ros2 launch my_robot_bringup turtlesim_catch_them_all.launch.xml

🔍 Runtime Introspection

Node List

ros2 node list

Node List

Topic List

ros2 topic list

Topic List

Topic Info

ros2 topic info /alive_turtles

Alive Turtles Topic Info

Node & Topic Graph

rqt_graph

RQT Graph


🎥 Demo

A short demo video showing:

  • Launch execution
  • Turtle spawning
  • Autonomous chasing behavior
  • ROS2 introspection

📽 Demo Video:

Demo Video

🧪 Expected Behavior

  • New turtles spawn periodically
  • Main turtle (turtle1) chases active turtles
  • System continues autonomously

🧠 ROS2 Concepts Demonstrated

  • ROS2 Nodes & packages
  • Publishers & subscribers
  • Services
  • Timers
  • Custom interfaces
  • Launch files
  • Runtime introspection (ros2 node, ros2 topic, rqt_graph)

🚀 Possible Improvements

  • Smarter target selection
  • Multi-hunter turtles
  • Event-based architecture
  • Dockerized deployment

📜 Credits

Based on the ROS2 for Beginners curriculum by Edouard Renard (Udemy), adapted and documented here as a reproducible hands-on ROS2 systems exercise.


👤 Author

GitHub: https://github.com/Preetbandgar

About

Multi-node ROS2 fundamentals project using Turtlesim. Demonstrates nodes, topics, services, timers, custom messages, and runtime introspection.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages