top of page

Project:

Turtlesim - Catch them all

​

Skills Involved:

ROS2

C++

Python

​

Code

Description

Objectives:

The main aim of this project is to make the main turtle i.e turtle1 to catch all the turtles spawned by the launch file while also prioritizing the turtle which is at the closest proximity.

 

Packages:

1. turtlesim_catch_them_all:

Nodes:

(a)turtle_spawner:

  • publish_alive_turtles - Publishes an array of alive turtle names to the /alive_turtles topic

  • catch_turtle_service - A server that kills the turtle caught by the turtle1 by sending a bool response after receiving robot name request on the catch_turtle service.

  • turtle_kill client - This client calls the catch_turtle_service by providing the turtle name as a request.

  • spawn_turtle client - Sends x,y and theta  as request to the service called(spawn) and receives name of the turtle in response. This client is responsible for spawning multiple robots.

(b)turtle_controller:

  • cmd_vel_publisher_ - Publishes the liner and angular velocity to the /cmd_velocity topic of the turtlesim node.

  • pose_subscriber - Subscribes to the /pose topic of the turtlesim node.

  • turtles_to_catch_subscriber_ - Subscribes to the publish_alive publisher created in the robot_spawner node.

​

2. my_robot_bringup:

  • turtlesim_project.launch.py - Launch file to launch all the required nodes at once

​

3.

my_robot_interfaces:

(a) msg:

  • Turtle.msg - Contains name, x ,y and theta of the turtle.

  • TurtleArray.msg - Contains the array of the turtles.

(b) srv:

  • CatchTurtle.srv - Contains turtle name as request and bool type success as response.

​

The rqt_graph for all the nodes involved is appended below:

​

 

 

 

​

​

​

​

​

​

​

​

​

​


rqt_graph of the project (obviously in runtime!)

Screenshot from 2022-10-25 17-49-58.png
bottom of page