mirror of
https://gitlab.ewi.tudelft.nl/ee2l1/2025-2026/A.K.03.git
synced 2025-12-12 15:30:57 +01:00
76 lines
1.5 KiB
Plaintext
76 lines
1.5 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from Manual.KITT_Simulator.gui import GUI\n",
|
|
"from Manual.KITT_Simulator.shared_state import SharedState\n",
|
|
"\n",
|
|
"import time\n",
|
|
"import numpy as np"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"application/vnd.jupyter.widget-view+json": {
|
|
"model_id": "b37d900d82e94817a23ed79f23068d41",
|
|
"version_major": 2,
|
|
"version_minor": 0
|
|
},
|
|
"text/plain": [
|
|
"Canvas(height=520, width=520)"
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"state = SharedState()\n",
|
|
"gui = GUI(state)\n",
|
|
"gui.display()\n",
|
|
"\n",
|
|
"for i in range(100):\n",
|
|
" state.x = i + 20\n",
|
|
" state.y = 2*i + 20\n",
|
|
" state.theta = np.pi/2 - i/100\n",
|
|
" gui.update()\n",
|
|
" time.sleep(0.1)\n",
|
|
" if i == 50:\n",
|
|
" state.beacon = True\n",
|
|
"\n",
|
|
"gui.stop()"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "OpenEdVenv",
|
|
"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.12.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|