Skip to content

Commit

Permalink
Merge pull request #14 from IQTLabs/notebook-server
Browse files Browse the repository at this point in the history
Notebook server
  • Loading branch information
luke-iqt authored May 19, 2021
2 parents ee05d2c + d88465b commit 65cf4f6
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ services:
- /run:exec,size=64M
- /var/log

notebook:
build: ./notebook-server
ports:
- "8888:8888"
restart: unless-stopped
depends_on:
- mqtt


mqtt:
build: ./mqtt
ports:
Expand Down
187 changes: 187 additions & 0 deletions notebook-server/Config.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SkyScan Config\n",
"Make temporary changes to a running SkyScan instance. It will revert back to the values in the environment file when restart."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"broker=\"mqtt\" # update with the IP for the Raspberry PI"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import paho.mqtt.client as mqtt\n",
"import json"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client = mqtt.Client(\"notebook-config\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Camera Zoom\n",
"This is how much the camera is zoomed in. It is an Int number between 0-9999 (max)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['cameraZoom'] = 9999 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Camera Delay\n",
"Float value for the number of seconds to wait after sending the camera move API command, before sending the take picture API command."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['cameraDelay'] = 0.25 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Camera Move Speed\n",
"This is how fast the camea will move. It is an Int number between 0-99 (max)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['cameraMoveSpeed'] = 99 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Camera Lead\n",
"This is how far the tracker should move the center point in front of the currently tracked plane. It is a float, and is measured in seconds, example: 0.25 . It is based on the planes current heading and how fast it is going. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['cameraLead'] = 0.45 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Camera Bearing\n",
"This is a float to correct the cameras heading to help it better align with True North. It can be from -180 to 180. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['cameraBearing'] = -2 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Minimum Elevation\n",
"The minimum elevation above the horizon which the Tracker will follow an airplane. Int value between 0-90 degrees."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['minElevation'] = 20 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
9 changes: 9 additions & 0 deletions notebook-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3

RUN apt-get update
RUN pip3 install --upgrade pip
RUN pip3 install jupyter paho-mqtt
RUN mkdir /opt/notebooks
COPY ./Config.ipynb /opt/notebooks

ENTRYPOINT jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password=''

0 comments on commit 65cf4f6

Please sign in to comment.