catch_them_all_ROS2_DEMO.mp4
The catch_them_all
a small turtlesim
for beginners to learn ROS2 basic functionalities. The Catcher node controls a turtle to move towards dynamically spawned target turtles and "catch" them by deleting their respective instances.
Before you begin, ensure you have met the following requirements:
- ROS 2: This package is compatible with Humble.
- Colcon: Make sure you have
colcon
installed for building the packages.
Follow these steps to install the catch_them_all
and catch_them_all_bringup
packages:
-
Clone this repository:
git clone https://github.com/haris-mujeeb/Catch-Them-All-ROS2.git
-
Build the workspace:
cd ~/ros2_ws colcon build
-
Source the workspace:
source ~/ros2_ws/install/setup.bash
-
Launch using the provided launch file:
ros2 launch catch_them_all_bringup catcher_app.launch.py
This launch file will:
- Start the Turtlesim simulation.
- Spawn a catcher turtle and additional random turtles.
- Launch the Catcher node to control the turtle. Note: To execute python code, use turtlesim_catch_them_all_py.launch.py instead of catcher_app.launch.py
-
Manual commands: Alternatively, you can run the nodes manually:
ros2 run turtlesim turtlesim_node ros2 run catcher_them_all spawner ros2 run catcher_them_all catcher
Note: Use turtle_spawner and turtle_controller for python code
The Catcher node can be customized with the following:
- Default Turtle Name: The node tracks and controls a specific turtle (
turtle1
by default). - Timers: Control timers for movement and spawning can be adjusted in the code.
/turtle1/cmd_vel
(geometry_msgs/msg/Twist): Publishes velocity commands to control the turtle./alive_turtles
(my_robot_interfaces/msg/TurtleArray): Publishes an array with alive turtles with their object attributes (namely, x, y, theta).
/turtle1/pose
(turtlesim/msg/Pose): Subscribes to the turtle's position.
spawn_random_turtle
(turtlesim/srv/Spawn): Spawns turtles at random positions.kill
(turtlesim/srv/Kill): Kills a target turtle after it is caught.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License. See the LICENSE
file for details.