This project demonstrates a game built on the ROS-based TurtleSim platform. The objective is to guide the virtual turtle along a precisely defined path while preventing it from straying outside the boundary. The system leverages real-time sensor feedback and service calls to dynamically enforce game constraints, challenging the user to maintain accuracy and control.
In the realm of robotics education and simulation, TurtleSim serves as a powerful tool for illustrating fundamental concepts in ROS. In this project, an interactive game is developed where users are tasked with driving the turtle along a predefined trajectory. By monitoring the turtle’s background color via the "/turtle1/color_sensor" topic, the system detects deviations from the safe path, triggering immediate warnings to the user. This project not only reinforces ROS service utilization but also demonstrates the integration of real-time feedback mechanisms in an engaging manner.
To successfully build and run this project, ensure that your development environment meets the following requirements:
The project is structured within a ROS Catkin workspace. Follow these steps to compile and launch the game:
cd ~/catkin_ws/src
git clone https://github.com/jerinpeter/turtle_game.git
cd ..
catkin_make
roslaunch turtle_launch.launch
The game operates by subscribing to the "/turtle1/color_sensor" topic, allowing it to continuously monitor the background color beneath the turtle. The system leverages two key ROS services:
/turtle1/set_pen
: Adjusts the drawing parameters to render a predefined shape that represents the safe path./turtle1/teleport_absolute
: Resets the turtle's position if needed.If the turtle deviates from the drawn path, the system issues a warning message to the user, thereby enforcing strict adherence to the game's constraints.
Future iterations of the game may include:
/turtle1/set_pen
service.