Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# tello_sim

**tello_sim** is a simple Python simulator (sim) that can be used by students to test their [tello](https://www.ryzerobotics.com/tello-edu) flight plans before deploying them to a real drone. It was inspired by the [easyTello](https://github.com/Virodroid/easyTello) library and uses it for the drone interface.
**tello_sim** is a simple Python simulator (sim) that can be used by students to test their [tello](https://www.ryzerobotics.com/tello-edu) flight plans before deploying them to a real drone. In this fork, it uses [DJITellopy](https://github.com/damiafuentes/DJITelloPy)

This is a fork of a previous project written by [Fireline-Science](https://github.com/Fireline-Science/tello_sim), so all credit goes to him for the heavy lifting. I simply am just updating it to help teach my classes.

One suggested use for the sim is to develop an in-class obstacle course for students to fly their drone through. For example, you could have designated launch and landing positions that are separated by a series of obstacles. Obstacles could include tunnels to fly through or corners to navigate around.

Expand Down Expand Up @@ -63,20 +65,20 @@ my_drone.takeoff()
![](/images/takeoff.png)

```python
my_drone.forward(40)
my_drone.move_forward(40)
```
![](/images/forward.png)

By default, the simulator plots a 25 cm error region in light blue around the flight path. For more advanced projects, you can override the default parameter by including the optional second error bar parameter in centimeters like ```forward(40, e=50)```. This is useful when you want to change the model (simulation) based on empirical (actual) testing.


```python
my_drone.cw(45)
my_drone.rotate_counter_clockwise(45)
```
![](/images/cw.png)

```python
my_drone.forward(50)
my_drone.move_forward(50)
```
![](/images/forward_2.png)

Expand Down Expand Up @@ -105,13 +107,13 @@ In a classroom, it can be useful to allow students to share their command script
]
},
{
"command": "cw",
"command": "rotate_counter_clockwise",
"arguments": [
90
]
},
{
"command": "forward",
"command": "move_forward",
"arguments": [
100
]
Expand Down Expand Up @@ -143,7 +145,7 @@ my_drone.reset()
```

## Deploying to a Real Drone
We are using the [easytello](https://github.com/Virodroid/easyTello) library to allow you to deploy your simulated flight to a real drone. Once you are connected to your drone via WiFi, you can deploy the commands you built up in an interactive session or loaded via a command file in Jupyter with the following command:
We are using the [DJITellopy](https://github.com/damiafuentes/DJITelloPy) library to allow you to deploy your simulated flight to a real drone. Once you are connected to your drone via WiFi, you can deploy the commands you built up in an interactive session or loaded via a command file in Jupyter with the following command:

```python
my_drone.deploy()
Expand Down Expand Up @@ -171,3 +173,10 @@ Note: if you are running multiple scripts to the drone, you may have to kill the
lsof -i:8889
kill XXXX
```

If you're on Windows the following commands should work
```

netstat -p tcp -ano | findstr ":21" (Outpuuted as Protocol Local Address Foreign Address State PID)
taskkill /F /ID XXXX
```
76 changes: 38 additions & 38 deletions commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,67 @@
"arguments": []
},
{
"command": "forward",
"command": "move_forward",
"arguments": [
100
]
},
{
"command": "cw",
"arguments": [
90
]
"command": "rotate_clockwise",
"arguments": [
90
]
},
{
"command": "forward",
"arguments": [
100
]
"command": "move_forward",
"arguments": [
100
]
},
{
"command": "cw",
"arguments": [
90
]
"command": "rotate_clockwise",
"arguments": [
90
]
},
{
"command": "forward",
"arguments": [
100
]
"command": "move_forward",
"arguments": [
100
]
},
{
"command": "cw",
"arguments": [
90
]
"command": "rotate_clockwise",
"arguments": [
90
]
},
{
"command": "forward",
"arguments": [
100
]
"command": "move_forward",
"arguments": [
100
]
},
{
"command": "cw",
"arguments": [
45
]
"command": "rotate_clockwise",
"arguments": [
45
]
},
{
"command": "forward",
"arguments": [
50
]
"command": "move_forward",
"arguments": [
50
]
},
{
"command": "flip",
"arguments": [
"r"
]
"command": "flip",
"arguments": [
"r"
]
},
{
"command": "land",
"arguments": []
}
]
]
6 changes: 3 additions & 3 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# flight commands are below
my_drone.takeoff()
my_drone.forward(130)
my_drone.ccw(90)
my_drone.forward(80)
my_drone.move_forward(130)
my_drone.rotate_clockwise(90)
my_drone.move_forward(80)
my_drone.land()
99 changes: 42 additions & 57 deletions example_flight_notebook.ipynb

Large diffs are not rendered by default.

Binary file modified images/cw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/forward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/jupyter_notebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions my_first_flight.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
"arguments": []
},
{
"command": "forward",
"command": "move_forward",
"arguments": [
50
]
},
{
"command": "cw",
"command": "rotate_clockwise",
"arguments": [
90
]
},
{
"command": "forward",
"command": "move_forward",
"arguments": [
100
]
Expand Down
43 changes: 43 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
asttokens==2.4.1
av==12.3.0
colorama==0.4.6
comm==0.2.2
contourpy==1.2.1
cycler==0.12.1
debugpy==1.8.2
decorator==5.1.1
djitellopy==2.5.0
executing==2.0.1
fonttools==4.53.1
ipykernel==6.29.5
ipython==8.26.0
jedi==0.19.1
jupyter_client==8.6.2
jupyter_core==5.7.2
kiwisolver==1.4.5
matplotlib==3.9.1
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
numpy==2.0.1
opencv-python==4.10.0.84
packaging==24.1
pandas==2.2.2
parso==0.8.4
pillow==10.4.0
platformdirs==4.2.2
prompt_toolkit==3.0.47
psutil==6.0.0
pure_eval==0.2.3
Pygments==2.18.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
pytz==2024.1
pywin32==306
pyzmq==26.0.3
six==1.16.0
stack-data==0.6.3
tornado==6.4.1
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.1
wcwidth==0.2.13
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
install_requires=[
'pandas',
'matplotlib',
'easytello'
'djitellopy'
],
classifiers=[
'Programming Language :: Python :: 3',
Expand Down
Binary file modified teaching_materials/simulation_intro.pdf
Binary file not shown.
Binary file modified teaching_materials/simulation_intro.pptx
Binary file not shown.
Binary file modified teaching_materials/simulation_teaching.pdf
Binary file not shown.
Binary file modified teaching_materials/simulation_teaching.pptx
Binary file not shown.
Loading