A ROS 2 project built on turtlesim where a “master” turtle chases and captures other turtles. Each captured turtle joins the moving train behind the leader.
turtle_train_demo.webm
-
turtle_train: Main turtle train package which is the Heart of Project. It contains the following two nodes :-
turtle_train_controller: This node which consists of train logic, manages all turtles' info -
turtle_train_spawner: This node handles spawning of new turtles
-
-
turtle_train_interface: Package of custommsg&srv -
turtle_train_bringup: Contains launch & config files.turtle_train_config.yamlcontains parameters :- turtle_name_prefix : Name of spawned turtles
- spawn_frequency : Frequency of spawning turtles
Tip
Directly change parameters from config file, instead of CLI
sudo apt update && sudo apt upgrade
mkdir -p turtle_train_ws/src
cd turtle_train_ws/src
git clone "https://github.com/GJR-DHRL/turtle_train_ROS2.git"
cd ~/turtle_train_ws
colcon build
source install/setup.bash
ros2 launch turtle_train_bringup turtle_train.launch.xml
(Optional) (In other terminal after sourcing) Call /clear service manually, if visibility is decreased due to master turtle's pen
ros2 service call /clear std_srvs/srv/Empty
-
To make the new spawned turtles move randomly. Need to be able to keep an eye on each turtle, and thus dynamically create a subscription for each alive turtle’s pose! Will create a “middle” node whose goal is to monitor the playground, and tell the turtle controller where to go at any given time.
-
Change the pen color each time the “master turtle” has caught another turtle.
-
Add another “master turtle” node to catch turtles even faster!
