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.
-
/turtlesim(ROS2 provided) ROS2-provided simulation node. Publishes turtle pose and exposes/spawnand/killservices. -
/turtle_spawnerSpawns turtles periodically and publishes the list of active turtles. -
/turtle_controllerSubscribes to turtle pose and active turtle list, and publishes velocity commands to moveturtle1.
/turtle1/pose/turtle1/cmd_vel/alive_turtles
/spawn/kill
Turtle.msg
string name
float32 x
float32 y
float32 theta
TurtleArray.msg
Turtle[] turtles
CatchTurtle.srv
string name
---
bool success
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
- Ubuntu 24.04 LTS
- ROS2 Jazzy
- Python 3.12
rosdep update
rosdep install --from-paths src --ignore-src -y colcon build --symlink-install source install/setup.bashros2 launch my_robot_bringup turtlesim_catch_them_all.launch.xmlros2 node listros2 topic listros2 topic info /alive_turtlesrqt_graphA short demo video showing:
- Launch execution
- Turtle spawning
- Autonomous chasing behavior
- ROS2 introspection
📽 Demo Video:
- New turtles spawn periodically
- Main turtle (
turtle1) chases active turtles - System continues autonomously
- ROS2 Nodes & packages
- Publishers & subscribers
- Services
- Timers
- Custom interfaces
- Launch files
- Runtime introspection (
ros2 node,ros2 topic,rqt_graph)
- Smarter target selection
- Multi-hunter turtles
- Event-based architecture
- Dockerized deployment
Based on the ROS2 for Beginners curriculum by Edouard Renard (Udemy), adapted and documented here as a reproducible hands-on ROS2 systems exercise.
GitHub: https://github.com/Preetbandgar




