feat: add chunks to autopilot, test for estimation
This commit is contained in:
130
test_autopilot.ipynb
Normal file
130
test_autopilot.ipynb
Normal file
@@ -0,0 +1,130 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
" [Pilot] translate: -1.1016611435961554 -11.000654444967525\n",
|
||||
" [Pilot] Drone Position: (11.00, 1.10)\n",
|
||||
" [Pilot] Angle: 5.7°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1802.7756377319947\n",
|
||||
"\n",
|
||||
" [Pilot] translate: -1.3733859493278928 -62.101186076671574\n",
|
||||
" [Pilot] Drone Position: (72.66, 8.66)\n",
|
||||
" [Pilot] Angle: 7.0°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1793.018946479205\n",
|
||||
"\n",
|
||||
" [Pilot] translate: -0.286107956133153 -61.700187952027996\n",
|
||||
" [Pilot] Drone Position: (133.86, 16.44)\n",
|
||||
" [Pilot] Angle: 7.3°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1737.8358192949638\n",
|
||||
"\n",
|
||||
" [Pilot] translate: -1.217279449147543 -61.59798129394066\n",
|
||||
" [Pilot] Drone Position: (194.81, 25.43)\n",
|
||||
" [Pilot] Angle: 8.4°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1683.363020511812\n",
|
||||
"\n",
|
||||
" [Pilot] translate: -0.5202028232620485 -61.25377666064388\n",
|
||||
" [Pilot] Drone Position: (255.34, 34.87)\n",
|
||||
" [Pilot] Angle: 8.9°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1628.8954458349883\n",
|
||||
"\n",
|
||||
" [Pilot] translate: 0.030834225184026082 -62.02734738952944\n",
|
||||
" [Pilot] Drone Position: (316.63, 44.41)\n",
|
||||
" [Pilot] Angle: 8.8°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1575.0091545970413\n",
|
||||
"\n",
|
||||
" [Pilot] translate: -0.4160221189622985 -62.497522722978935\n",
|
||||
" [Pilot] Drone Position: (378.32, 54.42)\n",
|
||||
" [Pilot] Angle: 9.2°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1521.0283267047403\n",
|
||||
"\n",
|
||||
" [Pilot] translate: 0.5176443048484498 -60.8909129531913\n",
|
||||
" [Pilot] Drone Position: (438.51, 63.67)\n",
|
||||
" [Pilot] Angle: 8.7°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1467.065793978559\n",
|
||||
"\n",
|
||||
" [Pilot] translate: -0.22161188590699135 -62.49031949249053\n",
|
||||
" [Pilot] Drone Position: (500.24, 73.38)\n",
|
||||
" [Pilot] Angle: 8.9°\n",
|
||||
" [Pilot] Target Index: 0\n",
|
||||
" [Pilot] Target Position: (1500, 1000)\n",
|
||||
" [Pilot] Distance: 1415.4431252709192\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from pathlib import Path\n",
|
||||
"from PIL import Image\n",
|
||||
"import numpy as np\n",
|
||||
"from autopilot import AutoPilot\n",
|
||||
"from visualization import VisualizationManager\n",
|
||||
"\n",
|
||||
"autopilot = AutoPilot([(1500, 1000)], [])\n",
|
||||
"imgs = [Image.open(Path('images') / f'photo_{i}.png') for i in range(10)]\n",
|
||||
"autopilot.handle(imgs[0])\n",
|
||||
"for i in range(1, 10):\n",
|
||||
" print()\n",
|
||||
" autopilot.handle(imgs[i])\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": ".venv",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.0"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue
Block a user