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




