Skip to content

np-overflow/OverflowTrainV2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EvTrain

A project based on OverflowTrainV2 (https://github.com/np-overflow/OverflowTrainV2), it uses Computer Vision(CV) to allow people to select where an Ev3 robot goes to on a map.

CV is carried out by using Object Detection to detect the number of humans in each side of the frame.

To allow the computer running CV to let the Ev3 robot know the selected location, a MQTT broker is ran on the computer, where the selected destination is sent to a topic and the Ev3 robot receives the destination published to the topic.

overview of process

Set-up guide

1. Computer

  1. Install the MQTT broker (Downloads)
  2. Configure the broker to be accessible within the local network, add the following lines to mosquitto.conf
listener 1883 0.0.0.0 
allow_anonymous true
  1. Open up a terminal and run mosquitto with the mosquitto.conf file
# MacOS
/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
  1. Clone this repository and go to the backend directory in a terminal
# MacOS 
git clone <https_clone_of_repository>
cd EvTrain
cd backend
  1. (Optional) Create a virtual environment
# MacOS
python -m venv venv
source venv/bin/activate
  1. Install the modules in requirements.txt
# MacOS 
pip install -r requirements.txt
  1. (Optional) If you are running the broker on a seperate computer on the network, open the destination.py file and edit the HOST variable to the IP of the computer running the broker.
  2. Run destination.py
# MacOS
python destination.py

2. Ev3

  1. Install ev3dev (Getting Started) on a micro sd card, follow the guide till 'Step 4: Boot ev3dev'
  2. Plug in a Wifi dongle into the USB slot (request from school if neccessary)
  3. Follow the guide on networking 'With a Wi-Fi dongle' (Networking Guide)
  4. When the Ev3 has joined the network, ssh into the Ev3 (Connecting to Ev3 Using SSH)
  5. When you have successfully ssh'ed into the Ev3, install pip
wget https://bootstrap.pypa.io/pip/3.5/get-pip.py # If the network the Ev3 is connected to the IMac does not have internet access, download the get-pip.py file on the IMac while it is connected to a network with internet and transfer it to the Ev3 when you rejoin the network with the Ev3
python3 get-pip.py
  1. Install Ev3Dev Browser in VSCode (ev3dev-browser)
  2. Open up a new terminal and go to the ev3 directory
cd EvTrain
cd ev3
code . # Open up VSCode in this directory
  1. Open up the 'EV3DEV DEVICE BROWSER' tab in VSCode and connect to the Ev3
  2. Transfer the workspace into the Ev3
  3. Using the Ev3, navigate to the ev3 folder
  4. Install the necessary modules in requirements.txt
pip3 install -r requirements.txt # Make sure the Ev3 is connected to a network with internet access
  1. After they have been installed, start up the broker and run main.py
  2. When the Ev3 beeps run destination.py on the computer and off you go!

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages