Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JohsBL authored May 11, 2018
1 parent cd5da54 commit e089bc1
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,35 @@

This repository contains the Flappy Bird game modified to be controlled with ROS.

## Game description
## Game Description


Flappy Bird is in trouble again! This time it went into space and landed in an asteroid belt. If FlappyBird collides with the rocks it is game over. Luckily Flappy remembered his laser scanner that provides distance measurements. It will give you its velocity and the laserscans in return for an acceleration input. FlappyBird only asks for 60 seconds of your guidance. Help FlappyBird go through as many asteroid lines as possible before the time runs out!
Flappy Bird is in trouble again! This time it went into space and landed in an asteroid belt. If Flappy Bird collides with the asteroids it would be fatal. Luckily Flappy remembered his laser scanner that provides distance measurements. It will give you its velocity and the laserscans in return for an acceleration input. Flappy Bird only asks for 60 seconds of your guidance. Help Flappy Bird go through as many asteroid lines as possible before the time runs out!

![Flappy](flappy_cover.png)

## Getting Started

This game has been tested with Ubuntu 16.04 running ROS Kinetic and Python 2.7.
*This game has been tested with Ubuntu 16.04 running ROS Kinetic and Python 2.7.*

There are two recommended options for running the game. Either download the VirtualBox image that comes with a complete Ubuntu 16.04 setup or add the packages provided from this repository to your own ROS workspace.

### Option 1 - VirtualBox
First download VirtualBox from here [[VirtualBox link]](https://www.virtualbox.org/wiki/Downloads) and install it on your system. Then download the Ubuntu image that we have preconfigured with the game from here [[Image link]](https://www.virtualbox.org/wiki/Downloads). Once downloaded add the image to VirtualBox and boot up Ubuntu.
The username and password are both **FlyaTest** .
First download VirtualBox from here [[VirtualBox link]](https://www.virtualbox.org/wiki/Downloads) and install it on your system. Then download the Ubuntu image that we have preconfigured with ROS and the game from here [[Image link]](https://drive.google.com/file/d/17y5v5Xi0sAz9Wx4Ne6FB0_0nxOOnkKVi/view?usp=sharing). Once downloaded add the image to VirtualBox and boot up Ubuntu.
The username and password are both **FlyaTest** .

### Option 2 - Adding as ROS package
If you already have Ubuntu you can install ROS and setup a workspace as covered here [[ROS install guide]](http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment).
To add the automation game to your workspace clone the automation game repository to the source folder.

If you followed the tutorial it will look like this,
If you followed the ROS installation tutorial it will look like this,
```
cd ~/catkin_ws/src/
```
Clone the automation game,
```
git clone https://github.com/JohsBL/flappy_automation_test.git
```
Make sure you have Pygame installed
Make sure you have Pygame installed,
```
sudo apt-get install python-pygame
```
Expand All @@ -42,7 +41,7 @@ cd ~/catkin_ws/
catkin_make
```

## Running the game
## Run The Game

To run the game we use the roslaunch command. There are two ROS launch files depending on if you want to run the game with C++ or python automation code (whatever you prefer).

Expand All @@ -54,22 +53,20 @@ For C++ open a terminal and run,
```
roslaunch flappy_automation_code flappy_automation_code_cpp.launch
```
A GUI will become visible with the game start screen. For now the automation code does not do anything, so to start the game and move the bird press the arrow keys. Tapping the up key ↑ will start the game. You can then add velocity in a wanted direction by pressing the arrow keys ←↑↓→. Notice that it is not possible to go backwards and if hitting an obstacle the bird will crash.
A GUI will become visible with the game start screen. For now the automation code does not do anything other than printing out some laser ray information. To start the game and move the bird press the arrow keys. Tapping the up key ↑ will start the game. You can then add velocity in a wanted direction by pressing the arrow keys ←↑↓→. Notice that it is not possible to go backwards and if hitting an obstacle the game stops.

## Automate FlappyBird
Now that we have gotten familiar with the game we want to control FlappyBird. To do this a python and C++ template has been provided.
## Automate Flappy Bird
Now that we have gotten familiar with the game we want to control Flappy Bird. To do this a python and C++ template has been provided.

### Modifying the code

The templates are located in the **flappy_automation_code** folder.

For using python modify the file **flappy_automation_code_node.py** in the **scripts** folder.

The templates are located in the **flappy_automation_code** folder.
For using python modify the file **flappy_automation_code_node.py** in the **scripts** folder.
For using C++ modify the files **flappy_automation_code.cpp** in the **src** folder and **flappy_automation_code.hpp** in the **include** folder.

Take your pick.

To get the state of the bird velocity readings and laserscans are published and an acceleration command can be given for actuating the FlappyBird. In the code callbacks for these topics and examples of how to read the returned messages are provided.
To get the state of the bird velocity readings and laserscans are published and an acceleration command can be given for actuating the Flappy Bird. In the code callbacks for these topics and examples of how to read the returned messages are provided.

### Build and run
Once the code has been modified run the catkin_make command again,
Expand All @@ -89,7 +86,10 @@ C++,
roslaunch flappy_automation_code flappy_automation_code_cpp.launch
```

### Other info
## Handing In


## Other Information
Scaling: 1 pixel = 0.01 meter
Game and sensor update rates: 30 fps
Max acceleration x: 0.1 m/s^2
Expand Down

0 comments on commit e089bc1

Please sign in to comment.