# University of Minnesota Drone Transportation Simulation
This is the codebase for the drone simulation for the final project for UMN CSCI 3081W Spring 2022.
See [here](https://drive.google.com/drive/folders/1fgAdUjJLMHCGxHTkZYYXL_1gVtQQaLwJ?usp=share_link) for the demo video, UML diagram, and final report.
## Team Members
- Benjamin Minneci
- Lucas Hoof
## Paths to Added and Modified Files
### Added
project/libs/transit/include:
- [DroneDecorator.h](project/libs/transit/include/DroneDecorator.h)
- [BatteryDecorator.h](project/libs/transit/include/BatteryDecorator.h)
- [hub.h](project/libs/transit/include/hub.h)
- [HubFactory.h](project/libs/transit/include/HubFactory.h)
project/libs/transit/src:
- [DroneDecorator.cc](project/libs/transit/src/DroneDecorator.cc)
- [BatteryDecorator.cc](project/libs/transit/src/BatteryDecorator.cc)
- [hub.cc](project/libs/transit/src/hub.cc)
- [HubFactory.cc](project/libs/transit/src/HubFactory.cc)
### Modified
project/libs/transit/include:
- [drone.h](project/libs/transit/include/drone.h)
- [Beeline.h](project/libs/transit/include/Beeline.h)
- [AstarStrategy.h](project/libs/transit/include/AstarStrategy.h)
- [DfsStrategy.h](project/libs/transit/include/DfsStrategy.h)
- [DijkstraStrategy.h](project/libs/transit/include/DijkstraStrategy.h)
- [CelebrationDecorator.h](project/libs/transit/include/CelebrationDecorator.h)
project/libs/transit/src:
- [drone.cc](project/libs/transit/src/drone.cc)
- [Beeline.cc](project/libs/transit/src/Beeline.cc)
- [AstarStrategy.cc](project/libs/transit/src/AstarStrategy.cc)
- [DfsStrategy.cc](project/libs/transit/src/DfsStrategy.cc)
- [DijkstraStrategy.cc](project/libs/transit/src/DijkstraStrategy.cc)
- [CelebrationDecorator.cc](project/libs/transit/src/CelebrationDecorator.cc)
## Getting Started
### Docker Setup
#### Docker Pre-requisites
* Windows 10 Home
* Install [wsl2 and Ubuntu](https://www.youtube.com/watch?v=ilKQHAFeQR0&list=RDCMUCzLbHrU7U3cUDNQWWAqjceA&start_radio=1&t=7) and [Windows 10 Doc](https://docs.microsoft.com/en-us/windows/wsl/install-manual)
* For [Windows 11](https://docs.microsoft.com/en-us/windows/wsl/install)
* Install [Docker Desktop](https://www.docker.com/products/docker-desktop) from [Docker Hub](https://hub.docker.com/)
* Linux
* Use [docker group instead of sudo](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)
#### Getting Started with Docker (after cloning the repository)
On Windows use the "Git Bash" terminal.
1. Navigate to the root directory of the repository
```bash
cd umn-drone/
```
3. Build docker image
```bash
bin/build-env.sh
```
3. Run docker image
```bash
#Usage bin/run-env.sh
bin/run-env.sh
```
### Build and Run
Here is a quick overview of how to run the simulation in the docker container (these steps are similar in each build environment):
# Go to the project directory
cd /path/to/repo/project
# You may need to run this command before the following ones
git config --global --add safe.directory /home/user/repo
# Clean the project
make clean
# Build the project
make -j
# Run the project (./build/web-app )
build/bin/transit_service 8081 apps/transit_service/web/
Navigate to http://127.0.0.1:8081 and you should see a visualization.
Navigate to http://127.0.0.1:8081/schedule.html and you should see a a page to schedule the trips. To view the entities, click on the right top of the visualization page (not the schedule page) and choose the entity to view such as drone or (robot name) that you give in the schedule page.