Files
PhotonVision/README.md

154 lines
2.4 KiB
Markdown
Raw Normal View History

2019-08-13 23:43:50 +03:00
# Chameleon-Vision
2019-08-29 00:01:40 +03:00
a free software for FRC teams to use for vision proccesing on their robots
2019-08-13 23:43:50 +03:00
## getting started
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
2019-03-23 19:04:32 +00:00
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
### Prerequisites
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
so in order to run this project we will need to install python in order to run the backend and node.js with vue.js in order to run the fronted
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
#### backend
2019-08-29 00:01:40 +03:00
2019-08-15 05:18:20 +00:00
- python 3.7 and above
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- opencv 3.4.5
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- tornado web framework
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- robotpy-cscore
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- pynetworktables
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- pymq
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
#### frontend
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- vue.js
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- vuex
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- vue-router
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- less and less-loader
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- iView
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
- vue-native-websocket
2019-08-29 00:01:40 +03:00
### installing
2019-08-13 20:47:07 +00:00
#### for the backend
2019-08-29 00:01:40 +03:00
1. sudo apt-get update
2019-08-13 23:43:50 +03:00
2. apt-get dist-upgrade
2019-08-29 00:01:40 +03:00
3. sudo apt-get upgrade
2019-08-16 15:28:40 +00:00
4. sudo apt-get install python3-pip python3-dev cmake zip unzip build-essential git libnss-mdns --fix-missing
2019-08-29 00:01:40 +03:00
2019-08-16 18:10:49 +03:00
5. sudo pip3 install numpy (if on raspberry pi do "sudo apt-get install python3-numpy")
2019-08-29 00:01:40 +03:00
6. sudo apt-get install python3-opencv
7. pip3 install robotpy-cscore
8. pip3 install pyzmq
9. pip3 install tornado
2019-08-13 23:43:50 +03:00
to run the backend:
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
sudo python3 Main.py
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
if backed gets suck or no camera are recognized after a crash do:
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
sudo pkill -9 python3
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-28 21:08:51 +03:00
#### compiling:
2019-08-29 00:01:40 +03:00
in order to compile the program for runtime run: (still needs to install dependencies)
2019-08-28 21:08:51 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-28 21:08:51 +03:00
python3 -m nuitka --follow-imports Main.py
2019-08-29 00:01:40 +03:00
2019-08-28 21:08:51 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-13 20:47:07 +00:00
#### for the frontend
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
1. sudo apt-get install nodejs npm
2019-08-29 00:01:40 +03:00
2. cd chameleon-client
2019-08-13 23:43:50 +03:00
3. sudo npm install
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
4. sudo npm install @vue/cli
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
to run the front end you can open the cli ui by:
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
vue ui
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
of you can auto serve the ui by
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
npm run serve
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
```
2019-08-29 00:01:40 +03:00
## Hardware
2019-08-29 00:01:40 +03:00
this is important when choosing your sbc it is more important to have a good usb controller that a good cpu
on the odroid xu4 which is very fast i have got many bottlenecks from the usb controller and many times making the program crach
2019-08-29 00:01:40 +03:00
#### networking
2019-08-13 23:43:50 +03:00
2019-08-29 00:01:40 +03:00
it is very important to install Bonjour
2019-08-13 23:43:50 +03:00
## docs
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
main docs can be found at [google docs](https://docs.google.com/document/d/1qDuwHtpIPJfyXGIL8PJG89LZwRWbn2J9f-5g19lWL9U/edit?usp=sharing)
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
## Authors
2019-08-29 00:01:40 +03:00
* **Sagi Frimer** - *initial work* - websocket, settings manager, UI
* **Ori Agranat** - *main coder* - vision loop , UI, websocket, networktables
2019-08-13 23:43:50 +03:00
## Acknowledgments
2019-08-29 00:01:40 +03:00
2019-08-13 23:43:50 +03:00
* the [robotpy project](https://github.com/robotpy) and mainly the cscore libs
2019-08-29 00:01:40 +03:00
* basically all of stackoverflow