A Roomba robot that clean a space following a command sequence
This project is write in Java and build by gradle, so you need at least to have them installed
- Java 1.8 or higher
- gradle 3.4 or higher
Clone or download the project from github
Once you have the project. Open your preferred command line tool and make sure you're located in the root folder of the project.
Then write: gradle build
and press enter.
After finish, you should see a BUILD SUCCESSFUL
message on the terminal.
When build finish the artifact and the coverage report are created.
You can find the .Jar
file in the folder build\libs
with the name Roomba-robot.jar
-
First of all, you need to have an Instructions file with the following structure test.json where:
- Map is the representation of the space to clean where:
"C"
and"null"
represent cleaned, space or obstacles and"S"
a dirty space.
- Start is the initial point with
x
andy
coordinates and a compassfacing
as one of the four cardinal points[N,E,S,O]
- commands is the list of command the robot will follow up where:
{TL: turn left, TR: turn right, A: advance, C: clean}
- battery is the amount of battery remaining in the robot.
- Map is the representation of the space to clean where:
-
In order to run this project, write in the terminal
$java -jar "Roomba-robot.jar" <source.json> <result.json>
where:<source.json>
is the file with the structure above<result.json>
is the file where the final state of the robot will be written.
- after building the project you can read the coverage report opening the following file
build\coverageJacocoReportDir\test\html\index.html