![Under construction](https://img.shields.io/badge/stage-under%20construction-blue.svg)
![PyPI](https://img.shields.io/pypi/v/robosim.svg)
![license](https://img.shields.io/github/license/lukzmu/robosim.svg)
[![Beerpay](https://beerpay.io/lukzmu/robosim/badge.svg?style=flat)](https://beerpay.io/lukzmu/robosim)

# RoboSim

`RoboSim` is a Python 3.6 based simulator for Robotics. I wrote it to test out my PhD AI algorithms and produce paper-ready result images in random mapping environments. The simulator uses `pygame`to present realtime results for robot navigation.

## Installation

RoboSim is now available on `pip`, so you just need to run the following command in your command line:

```
pip install robosim
```

## Map

Map generation is done using the [Random Walk algorithm](https://en.wikipedia.org/wiki/Random_walk).To generate a new map, you need to use the `generate_map()` function which returns an `array` as a result, as presented below:

```
[
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 
    [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], 
    [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], 
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1], 
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1], 
    [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1], 
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1], 
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1], 
    [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1], 
    [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1], 
    [1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1]
]
```

The amount of free space is presented by `0`'s and highly depends on the parameter values:

- `dimensions` (tuple, default `(64, 48)`),
- `tunnels` (int, default `1000`),
- `tunnel_length` (int, default `10`).

