-
Create a Python virtual environment to install the dependencies for the project.
python3 -m venv <path_to_virtual_env> source <path_to_virtual_env>/bin/activate
-
Install the dependencies using the following command:
pip3 install -r requirements.txt
-
Download the weights for the following models using the provided links:
-
Create a folder named weights and place the downloaded weights in the folder.
-
Leader-Follower
- To execute the program, first change the IP address on line 31 in the file
main.py
to the IP address of your computer. - To execute the program for this problem, navigate to the submission folder and use the following commands
python3 main.py
- To execute the program, first change the IP address on line 31 in the file
sort.py
is referred fromsort_v2.py
in the tracking branch.
- Once the main server is started, follower.py code is run.
- To Run "follower.py" code in Rasberry Pi, first you need to ssh into Rasberry pi of the follower robot using "ssh username@password".
- Transfer the script file to the Rasberry Pi and install all necessary libraries such as opencv, flask, socket, imutils, numpy, gpio.
- Open a terminal and run the "follower.py" file while the main server of socket is running.
- Once the main server is started, leader.py code is run.
- To Run "leader.py" code in Rasberry Pi, first you need to ssh into Rasberry pi of the Leader robot using "ssh username@password".
- Transfer the script file to the Rasberry Pi and install all necessary libraries such as opencv, flask, socket, imutils, numpy, gpio.
- Open a terminal and run the "leader.py" file while the main server of socket is running.
- Results: The follower will be following the leader with a threshold distance as long as it tracks the leader. If a Dynamic Obstacle comes into the play the follower pauses the motion and communicates with the leader and other followers to stop. Once the obstacle goes out of the frame and the follower is tracking the leader the whole platoon system starts moving again. Link