Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yeeshukant's branch #1

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
848cc92
Uploaded all files
Dec 24, 2022
3138527
PWM value changes for cmds in types.py
Dec 25, 2022
3f5917d
repo reorganised as main
Dec 26, 2022
768db2e
changes for imu data
Dec 26, 2022
6e2a953
conflicts resolved
Dec 26, 2022
168aabe
changes to get IMU data
Dec 26, 2022
0721eb5
Create keyboard_control.md
Yeeshukant Jan 9, 2023
e3e4d1e
merge of main into yeeshukant
Jan 14, 2023
fbffc4a
all function in one file in pluto dir
Jan 15, 2023
fbe5d3b
latest code
Jan 17, 2023
108a758
camera calibration files
Jan 18, 2023
1b2a46e
api changes incorporated
Jan 19, 2023
ec4c62b
latest pid values
Jan 19, 2023
a6fe506
Task 1 final 21/1/2023
harshahb Jan 21, 2023
d238c2e
Update keyboard_control.md
KshitijBhat Jan 22, 2023
d182ee5
cleanup
KshitijBhat Jan 22, 2023
306e827
remove unnecessary files
KshitijBhat Jan 22, 2023
e28a06c
Update requirements.txt
rohanjha04 Jan 22, 2023
b3dae2a
Create setup.py
SairajLoke Jan 22, 2023
e1ccc7c
Rename setup.py to Drone Swarm/setup.py
SairajLoke Jan 22, 2023
f7b0b09
Update requirements.txt
rohanjha04 Jan 22, 2023
bff215e
Adds comments and wrapping
rohanjha04 Jan 22, 2023
ee78284
restructure and add files for PID
KshitijBhat Jan 22, 2023
0984628
Merge branch
KshitijBhat Jan 22, 2023
8da75c5
Setup and links yet to be modified,
SairajLoke Jan 22, 2023
bca95bf
reset speed in keyboard control
Yeeshukant Jan 22, 2023
e8200e4
pid chages
KshitijBhat Jan 23, 2023
403fce8
Merge branch 'Drone_Swarm_Task_1' of github.com:DaemonLab/Drone-Swarm…
KshitijBhat Jan 23, 2023
0b51f40
Create task2.md
KshitijBhat Jan 23, 2023
6175aba
Update task2.md
KshitijBhat Jan 23, 2023
68ab99a
Update task2.md
KshitijBhat Jan 23, 2023
e0306ae
Update keyboard_control.md
Yeeshukant Jan 23, 2023
9bed7c8
Update README.md
SairajLoke Jan 23, 2023
50a897f
Update README.md
SairajLoke Jan 23, 2023
f0256c8
Update README.md
SairajLoke Jan 23, 2023
13ccc0f
Update and rename functions.md to Task1.md
rohanjha04 Jan 23, 2023
8fa9f9e
Update README.md
rohanjha04 Jan 23, 2023
ffd52ff
Update README.md
rohanjha04 Jan 23, 2023
5bd38f6
camera calibration files
Yeeshukant Jan 23, 2023
5598aad
Update kill.py
Yeeshukant Jan 24, 2023
5e4854a
Update marker.py
Yeeshukant Jan 24, 2023
0fd0162
Update PIDmain.py
KshitijBhat Jan 24, 2023
3b600bb
Update task2.md
rohanjha04 Jan 24, 2023
74e3630
Update task2.md
rohanjha04 Jan 24, 2023
8b0b2da
Update task2.md
Yeeshukant Jan 24, 2023
0b0c3dd
Update README.md
Yeeshukant Jan 24, 2023
a580dd0
Update README.md
Yeeshukant Jan 24, 2023
15f7b9f
Update README.md
Yeeshukant Jan 24, 2023
8304318
Update README.md
KshitijBhat Jan 24, 2023
3644f67
Rename task2.md to Task2.md
KshitijBhat Jan 24, 2023
69731a0
Update README.md
KshitijBhat Jan 24, 2023
3eae6f2
Delete TASKS.md
rohanjha04 Jan 24, 2023
3d2c6ef
Update README.md
Yeeshukant Jan 24, 2023
7c4ae8d
Update README.md
KshitijBhat Jan 24, 2023
a08c2b5
change folder name
KshitijBhat Jan 24, 2023
6401562
Merge remote-tracking branch 'origin/Drone_Swarm_Task_1' into yeeshukant
Jan 26, 2023
227af49
changes for two drones
Jan 26, 2023
58c7661
deleted old dir
Yeeshukant Jan 26, 2023
de5c2e0
deleted old dir
Yeeshukant Jan 26, 2023
4c09ad0
target points show, pose_dict error resolve
Jan 27, 2023
8b77e69
working hover PID
Jan 29, 2023
f43592b
task2 completed
Feb 2, 2023
f96476c
Update PIDmain.py
KshitijBhat Feb 2, 2023
4712272
updated set_all_speed
SairajLoke Feb 2, 2023
0034c49
Update Task1.md
SairajLoke Feb 2, 2023
225069b
Update marker.py
SairajLoke Feb 2, 2023
2cacea9
Update PIDmain.py
SairajLoke Feb 2, 2023
68db27a
doc changes
KshitijBhat Feb 2, 2023
5a2727d
Merge branch 'yeeshukant' of Drone-Swarm
KshitijBhat Feb 2, 2023
b3aa659
Update Task1.md
KshitijBhat Feb 2, 2023
a99bb5d
minor changes
KshitijBhat Feb 2, 2023
b6d752f
.
KshitijBhat Feb 2, 2023
614cdb0
add task 3
KshitijBhat Feb 4, 2023
1062a21
2 drone threading test
Feb 4, 2023
28c6c45
mission planner with move, hover
SairajLoke Feb 5, 2023
750c8ad
Delete task3_toge.py
SairajLoke Feb 6, 2023
55fee6f
Add files via upload
SairajLoke Feb 6, 2023
f2ade51
Create establish_connection.sh
KshitijBhat Feb 6, 2023
953af80
fps calculator
SairajLoke Feb 6, 2023
6e0391c
task3new.py
Feb 6, 2023
1565e6f
Merge branch 'yeeshukant' of https://github.com/DaemonLab/Drone-Swarm…
Feb 6, 2023
6a85fe2
Add files via upload
SairajLoke Feb 8, 2023
143dc58
Create Task3.md
KshitijBhat Feb 11, 2023
e6073cb
task3
Feb 12, 2023
13cfde8
Update README.md
KshitijBhat Mar 5, 2023
701664c
Add files via upload
KshitijBhat Mar 5, 2023
47ccb73
Update README.md
KshitijBhat Mar 5, 2023
a52efff
Update README.md
KshitijBhat Mar 5, 2023
6949030
README.md
NairAbhishek1403 Jun 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Presentation.pdf
Binary file not shown.
Binary file added Problem_Statement.pdf
Binary file not shown.
286 changes: 228 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,208 @@
<div id="top"></div>

[![Issues][issues-shield]][issues-url]

# Drone Swarm Python
API for controlling The Pluto 1.2 nano drone
## Inter-IIT Tech Meet 11.0: Bronze medal winning solution to [Drona Aviation](https://github.com/DronaAviation)'s Pluto Drone Swarm Challenge

Team Members: [Yeeshukant Singh](https://github.com/Yeeshukant), [Kshitij Bhat](https://github.com/KshitijBhat), [Harsh Bardhan](https://github.com/harshahb), [Rohan Jha](https://github.com/rohanjha04), [Sairaj Loke](https://github.com/SairajLoke), [Akshit Raizada](https://github.com/AkshitRaizada), [Omkar Shirgaonkar](https://github.com/BulzEye), [Shivankar Sharma](https://github.com/Shivankar007), [Abhishek Nair](https://github.com/NairAbhishek1403) and Karandevsinh Khuman

- [Problem Statement](https://github.com/DaemonLab/Drone-Swarm-InterIIT-2023/blob/yeeshukant/Problem_Statement.pdf)

- [Presentation](https://github.com/DaemonLab/Drone-Swarm-InterIIT-2023/blob/yeeshukant/Presentation.pdf)

- [Report](https://github.com/DaemonLab/Drone-Swarm-InterIIT-2023/blob/yeeshukant/Report.pdf)

### API for controlling The Pluto 1.2 nano drone

![Pluto1 2-ISO-Front](https://user-images.githubusercontent.com/79806119/214293414-403e11c9-3395-4ed4-a8a5-4aa190e86979.png)

[![](https://img.shields.io/badge/License-GPLv3-blue.svg)]()

<!-- TABLE OF CONTENTS (ADD ONCE SUBTOPICS START COMING TOGETHER)-->


## Table of Contents


<p><a href="#ProjD">1. Project Description</a></p>
<p><a href="#RepoS">2. Repository Structure</a></p>
<p><a href="#TechS">3. Tech Stack</a></p>
<p><a href="#GetSL">4. Getting Started ( Linux / Windows) </a></p>

- <p><a href="#PreR">a. Prerequisite</a></p>
- <p><a href="#SetU">b. Setting Up </a></p>

- Python Env for Linux(Optional)
- pypluto package in Linux
- pypluto package in Windows

<p><a href="#Usg">5. Usage</a></p>

- a. Pre-Programmed Execution
- b. Camera Feedback Execution
- c. Keyboard Control
- d. Manually stopping (killing) the drone


<p><a href="#Video">6. Video</a></p>




<!-- PROJECT DESCRIPTION -->
<div id="ProjD"></div>

## 1. Project Description

*Task 1*:
Develop a Python wrapper for India's one and only number-one-selling educational nano drone, The Pluto.

*Task 2*:
Hovering a pluto drone on a particular height using ArUco Tag.
Set a web camera (which is not included in the kit) on the ceiling.
- A. Get a pose estimation of the drone using ArUco tag on the drone.
- B. Add PID to the script for controlling the droneC
- C. Hover the drone in one position.
- D. Move the drone in rectangular motion (1 x 2 meter)

*Task 3*:
Pluto Swarming (A second drone will be provided - both the drones should fly
at the same time)
A. Generate one more ArUco tag and place it on the second drone.
B. Initially, Drone2 will be at position0, and drone1 will be at position1. Write
commands to move Drone1 from position1 to position2. When Drone1 reaches
position2, drone2 should follow drone1 and reach position1 automatically.
C. Same way, create a rectangle motion. (1 x 2 meter)
D. Record a video and make the final submission similarly as the previous one.

## Project Description

*Task 1*: Develop a Python wrapper for India's one and only number-one-selling educational nano drone, The Pluto.
<p align="right">(<a href="#top">back to top</a>)</p>



<div id="RepoS"></div>


## 2. Repository structure
<pre>
├─ docs
│ ├─ Task1.md
| ├─ keyboard_control.md
│ └─ Task2.md
├─ pypluto
│ ├─ pypluto
│ │ ├─ Camera
│ │ | ├─ CAM_CONFIGS_lenovo.py
│ │ | └─ marker.py
│ │ |
│ │ ├─ Control
│ │ | └─ PIDmain.py
│ │ |
│ │ ├─ __init__.py
│ │ ├─ drone.py
│ │ └─ enforce.py
│ │
│ ├─ kill.py
│ ├─ main.py
│ └─ master.py
├─ PrimusV4-Pluto_1_2-1.hex
└─ requirements.txt

</pre>

<div id="TechS"></div>

## 3. Tech Stack

- python>=3.7
- numpy==1.17.4
- opencv_contrib_python==4.6.0.66
- setuptools==45.2.0
- matplotlib==3.1.2

*Task 2*: Hovering a pluto drone on a particular height using ArUco Tag. Set a web camera (which is not included in the kit) on the ceiling.

*Task 3*: Pluto Swarming (A second drone will be provided - both the drones should fly at the same time)
<p align="right">(<a href="#top">back to top</a>)</p>



<div id="GetSL"></div>

## 4. Getting Started

## Getting Started
<div id="PreR"></div>

### Prerequisites

<!-- *Put setup instructions here.* -->

The API is tested with the ```PrimusV4-Pluto_1_2-1.hex``` firmware installed on Pluto Drone.
Ensure that git is installed on the system.

If ```pip3``` is not installed, install it using the following command in Terminal

If ```pip3``` is not installed, install it using the following command on **linux**
```shell
$ sudo apt update
$ sudo apt install python3-pip
```
and for **Windows**

<div id="PyEnv"></div>

<details open>
<summary> Setting up a Python-Environment (optional) </summary>
<br>


```shell
$ pip install virtualenv
```
Now check your installation
```
$ virtualenv --version
```
Now create a virtual environment inside an appropriate folder, type
this in terminal for specific python-3 version
```
$ virtualenv -p /usr/bin/python3 Drone_Env
```
After this command, a folder named **Drone_Env** will be created.

Now at last we just need to activate it, using the command
```
$ source Drone_Env/bin/activate
```
Now you are in a Drone's Python virtual environment , follow the <a href="#SetU">following cmds</a> for installation of packages

Note:
You can deactivate environment using
```
$ deactivate
```
</details>


<div id="SetU"></div>

## Setting up pypluto package in Linux

```
$ git clone https://github.com/team53-interiit-11/Drona-Aviation-Team53
$ cd pypluto
```
Install the External Dependencies using the following command
```
pip install -r requirements.txt
```

<p align="right">(<a href="#top">back to top</a>)</p>


<div id="GetSW"></div>

**Note: For MacOS, follow the same procedure as Linux**

## Setting up pypluto package in Windows
Download [get-pip.py](https://bootstrap.pypa.io/get-pip.py) using cmd prompt
```
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Expand All @@ -42,6 +211,12 @@ To install run the following command using cmd prompt
```
python /path/to/get-pip.py
```
Run the following commands:
```
$ git clone https://github.com/team53-interiit-11/Drona-Aviation-Team53
$ cd pypluto
```

Install the External Dependencies using the following command
```
pip install -r requirements.txt
Expand All @@ -50,71 +225,66 @@ pip install -r requirements.txt

<p align="right">(<a href="#top">back to top</a>)</p>

### Usage

<div id="Usg"></div>

### 5. Usage

#### a. Pre-Programmed Execution
<!-- *Explain API cmds here.... might need a more detailed version like (make another section for structure)* -->

Use the ```main.py``` template file for programming the drone movement.<br>
or refer to the following sample program.
Use the ```main.py``` template file for pre-programming the drone movement( without using any external camera) .<br>

Following is a sample program.
note: you might need to change the trim values depending on your drone.
```python
from pypluto.pluto import *
from pypluto import pluto

if __name__ == '__main__':
client = Drone()

client.disarm()
time.sleep(5)

client.arm()
time.sleep(5)

client.trim(50, -50, 0, 0)
client.steer("up",400)
time.sleep(4)

client.land()
time.sleep(4)

client.disarm()
#initializing the drone
drone=pluto()
drone.connect()
drone.disarm()

#drone plan execution
drone.trim(-2,2,0,0)
drone.takeoff()
drone.throttle_speed(0,3)

#closing the execution
drone.land()
drone.disarm()

```

For detailed explanation on use of various movement functions refer to [functions.md](https://github.com/DaemonLab/Drone-Swarm/blob/main/docs/functions.md) <br>
For detailed explanation of use of various movement functions, refer to [Task1.md](/docs/Task1.md) <br>

User can also control the drone from keyboard by running the ```keyboard.py``` file in terminal / command prompt. Instructions for control via keyboard can be found in [keyboard_control.md](https://github.com/DaemonLab/Drone-Swarm/blob/main/docs/keyboard_control.md)
#### b. Camera Feedback Execution

### Manually stopping (killing) the drone
Instructions for controlling the drone using camera setup can be found in the
[Task2.md](/docs/Task2.md)

Sometimes, it may happen that the python program using the API may end without deactivating (landing and/or disarming) the drone, and the drone may stay on. In that case, one can run the ```kill.py``` script, which will send the required commands to properly deactivate the drone.

## Roadmap
#### c. Keyboard Control

### Finalized
- [x] Basic Control Commands
- [x] Sending commands continously with threading
- [x] Keyboard Control
- [x] ArUco Detection
- [x] Multiple Drones
- [ ] PID balancing with ArUco
- [ ] Take sensor data for height
User can also control the drone from keyboard by running the ```keyboard.py``` file in terminal/command prompt.
Instructions for control via keyboard can be found in [keyboard_control.md](/docs/keyboard_control.md)


<div id="ideas"></div>
### d. Manually stopping (killing) the drone

### Ideas
In case the drone does not arm after running ```main.py```, which may happen due to improper disarming of the drone, you can run ```kill.py``` instead of disconnecting the drone to disarm it properly and then run ```main.py``` to get regular operation

- [ ] Modes and other flips
- [ ] Amphibian support
<div id="Video"></div>

<p align="right">(<a href="#top">back to top</a>)</p>
#### 6. Video

Link to Drive : https://drive.google.com/file/d/1zlupXXNTnhAbURaeVlbYnx64emY9gVFm/view?usp=sharing

## Contact Us
Hover Task: 0:00 to 0:32

Members :
Control Task: 0:33 to 1:39

<p align="right">(<a href="#top">back to top</a>)</p>

[contributors-shield]: https://img.shields.io/github/contributors/DaemonLab/Drone-Swarm?color=informational&style=for-the-badge
[contributors-url]: https://github.com/DaemonLab/Drone-Swarm/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/DaemonLab/Drone-Swarm?color=blueviolet&style=for-the-badge
[forks-url]: https://github.com/DaemonLab/Drone-Swarm/fork
[stars-shield]: https://img.shields.io/github/stars/DaemonLab/Drone-Swarm?color=yellow&style=for-the-badge
[stars-url]: https://github.com/DaemonLab/Drone-Swarm/stargazers
[issues-shield]: https://img.shields.io/github/issues-raw/DaemonLab/Drone-Swarm?color=%23FF0000&style=for-the-badge
[issues-url]: https://github.com/DaemonLab/Drone-Swarm/issues
<div id="RoadM"></div>
Binary file added Report.pdf
Binary file not shown.
41 changes: 0 additions & 41 deletions TASKS.md

This file was deleted.

Loading