This repository hosts the source code for the ROS
turtle_pong package which
implements the Pong arcade video game for the Robot Operating System (ROS 1 Noetic) using turtlesim.
To learn how the package was created, please read the documentation.
To use the
turtle_pong package clone this repository into the
src folder of your catkin workspace:
fjp@ubuntu:/home/fjp/catkin_ws/src$ git clone https://github.com/fjp/ros-turtle-pong.git
Then build the workspace with
catkin_make and source the new package:
# catkin-tools: fjp@ubuntu:/home/fjp/catkin_ws$ catkin build # or use fjp@ubuntu:/home/fjp/catkin_ws$ catkin_make # source your workspace using the setup.bash or setup.zsh depening on your shell fjp@ubuntu:/home/fjp/catkin_ws$ source devel/setup.bash fjp@ubuntu:/home/fjp/catkin_ws$ source devel/setup.zsh
roscore rosrun turtlesim turtlesim_node roslaunch turtle_pong pong.launch
Note that each of the three commands above should be executed from another terminal so that it will run in its own process.
The game can be played with the w/s keys and the up/down arrow keys to control the left and right player (turtle) respectively.
ROS Node Graph
Current Version and Missing Features
This is the first release (version 0.0.0). The following features are planned and contributions to them or new features and code improvements are welcome.
- Handle missed ball cases (left and right)
- Add score board logic (for example using new turtle to draw player scores)
- Fix bounce angle logic when ball hit a paddle.
- Add AI Player
- Improve keyboard input
- Fix order of node launches
The short video below gives more insights on what is currently implemented: