Skip to content

turtle_train is a project based on turtlesim package of ros2

Notifications You must be signed in to change notification settings

GJR-DHRL/turtle_train_ROS2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle Train

Description

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

System Requirement

  • Ubuntu 24.04

  • ROS2 Jazzy

    sys_req

Packages Description

  • 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 custom msg & srv

  • turtle_train_bringup : Contains launch & config files.

    • turtle_train_config.yaml contains parameters :
      • turtle_name_prefix : Name of spawned turtles
      • spawn_frequency : Frequency of spawning turtles

Tip

Directly change parameters from config file, instead of CLI

Installation

Make turtle train workspace

sudo apt update && sudo apt upgrade
mkdir -p turtle_train_ws/src
cd turtle_train_ws/src

Clone the git repo

git clone "https://github.com/GJR-DHRL/turtle_train_ROS2.git"

Build the Workspace

cd ~/turtle_train_ws
colcon build
source install/setup.bash

Usage

Launch File

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

Future Updates

  • 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!

About

turtle_train is a project based on turtlesim package of ros2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published