Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Mar 7, 2024
1 parent f52c51b commit 2db21a6
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 196 deletions.
76 changes: 31 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,60 +27,46 @@
<br />
<div align="center">
<a href="https://iqtlabs.org/">
<img src="images/logo.png" alt="Logo" width="331" height="153">
<img src="images/logo.png" alt="Logo" width="331" height="153"/>
</a>

<h1 align="center">EdgeTech-Template</h1>

<p align="center">
This repo is a template of how to build on <a href="https://github.com/IQTLabs/edgetech-core">IQT Labs EdgeTech-Core</a> functionality to instantiate an <a href="https://projects.eclipse.org/projects/iot.mosquitto">MQTT</a> client. The philosophy behind EdgeTech-Core is to minimize development requirements for standing up the software stack of an "edge" system. The template includes all of the files and code scaffolds required to build in the EdgeTech framework. All of this functionality is wrapped in a Docker container for cross-platform compatibility.
<br/>
<br/>
You'll need to rename various files and directories as well as customize based on your functional needs, but the EdgeTech framework and scaffolding should minimize the development requirements. If you don't find that to be the case, submit a pull request and help us make this repository better!
<br/>
<br/>
<a href="https://github.com/IQTLabs/edgetech-template/pulls">Make Contribution</a>
·
<a href="https://github.com/IQTLabs/edgetech-template/issues">Report Bug</a>
·
<a href="https://github.com/IQTLabs/edgetech-template/issues">Request Feature</a>
</p>
</div>

<h1 align="center">EdgeTech Occlusion Mapper</h1>


Occlusion Mapper lets you record that area around a Pan Tilt Zoom camera that is a blocked by something in the way, like a building or trees. It produces an array of Azimuth and Elevation values. This array provides what is the lowest possible elevation that can be used at a given azimuth.


## Running Things
Occlusion Mapper is available as a Docker Image on Docker Hub. Unless you are looking on making modifications to the code, you can just use the Docker Image that is available there. The included [docker-compose](./docker-compose.yaml) file provides an example of how to use that file.


The [occlusion-mapper.env](./occlusion-mapper.env) file provides the set of environment variables that need to be set. Save a copy this file as `.env` and then modify it for your local install. You will probably need to change the Project & Device names, along with the IP address for the camera.


## Usage

Launch the container using Docker Compose: `docker compose up`

If the container is running locally, navigate to: [http://localhost:5000](http://localhost:5000) in your browser.

Otherwise, if the container is running on another machine, navigate to that IP address with port 5000. For example: `http://192.168.1.111:5000`

This will bring up a rudimentary web interface that lets you control the camera and record different Azimuth/Elevation values. To map out the ooclusions around your camera:

1. Starting at 0° azimuth, find the camera elevation where you begin to have a clear view of the sky in the middle of the screen.
1. Next hit the **Add Point** button to record this value. The Graph at the bottom of the screen should update with this value.
1. Move the camera to the right. If the center of the frame no longer lines up with where planes would begin to be visible, adjust the Elevation and then hit **Add Point**
1. Continue this process until you have arrive back at 0° azimuth



### Built With

[![Python][python]][python-url]
[![Poetry][poetry]][poetry-url]
[![Docker][docker]][docker-url]

### Modules Built Based on this Template

<p align="left">
- <a href="https://github.com/IQTLabs/edgetech-daisy">edgetech-daisy</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-filesaver">edgetech-filesaver</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-audio-recorder">edgetech-audio-recorder</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-c2">edgetech-c2</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-telemetry-pinephone">edgetech-telemetry-pinephone</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-s3-uploader">edgetech-s3-uploader</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-couchdb-startup">edgetech-couchdb-startup</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-couchdb-saver">edgetech-couchdb-saver</a>
<br/>
- <a href="https://github.com/IQTLabs/edgetech-http-uploader">edgetech-http-uploader</a>
<br/>
</p>

### Projects Built Using the EdgeTech Framework

<p align="left">
- <a href="https://github.com/IQTLabs/aisonobuoy-collector-pinephone">aisonobuoy-collector-pinephone</a>
</p>

### Prerequisites

Expand Down
139 changes: 0 additions & 139 deletions README_TEMPLATE.md

This file was deleted.

46 changes: 35 additions & 11 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,55 @@
version: "3"

networks:
skyscan:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 900

services:

mqtt:
image: iqtlabs/edgetech-mqtt:latest
networks:
- skyscan
image: iqtlabs/edgetech-mqtt-dev:latest
ports:
- "1883:1883"
- "9001:9001"
build:
context: ./mqtt
dockerfile: ./Dockerfile
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10M"
max-file: "10"
template:
image: iqtlabs/edgetech-template:latest
build:
context: ./template
dockerfile: ./Dockerfile

controller:
networks:
- skyscan
image: iqtlabs/edgetech-axis-ptz-controller:latest
volumes:
- ./data/to_sort:/data/to_sort
restart: unless-stopped
depends_on:
depends_on:
- mqtt
env_file:
- .env
- axis-ptz-controller.env

occlusion-mapper:
networks:
- skyscan
image: iqtlabs/edgetech-occlusion-mapper:latest
volumes:
- ./data/mapping:/data/mapping
ports:
- "5000:5000"
restart: unless-stopped
depends_on:
- mqtt
logging:
driver: "json-file"
options:
max-size: "10M"
max-file: "10"
env_file:
- template.env
- .env
25 changes: 24 additions & 1 deletion occlusion-mapper.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
PROJECT_NAME=<Project Name>
HOSTNAME=<Name of the Host Machine where SkyScan will be running>
MQTT_IP=mqtt

TRIPOD_LATITUDE=<The Latitude position of the Tripod>
TRIPOD_LONGITUDE=<The Longitude position of the Tripod>
TRIPOD_ALTITUDE=<The Alititude of the Tripod>

YAW=0.0
PITCH=0.0
ROLL=0.0

CAMERA_IP=<IP address for the camera>
#CAMERA_USER=<Axis Camera username>
#CAMERA_PASSWORD=<Axis Camera password>

MAPPING_FILEPATH=/data/mapping/occlusion.json

#axis-ptz topics
CONFIG_TOPIC=/${PROJECT_NAME}/${HOSTNAME}/Config/skyscan-c2/JSON
ORIENTATION_TOPIC=/${PROJECT_NAME}/${HOSTNAME}/Orientation/edgetech-auto-orienter/JSON
IMAGE_FILENAME_TOPIC=/${PROJECT_NAME}/${HOSTNAME}/Image_Filename/edgetech-axis-ptz-controller/JSON
IMAGE_CAPTURE_TOPIC=/${PROJECT_NAME}/${HOSTNAME}/Image_Capture/edgetech-axis-ptz-controller/JSON
MANUAL_CONTROL_TOPIC=/${PROJECT_NAME}/${HOSTNAME}/Manual_Control/edgetech-axis-ptz-controller/JSON
MAPPING_FILEPATH=/data/mapping/occlusion.json
LOGGER_TOPIC=/${PROJECT_NAME}/${HOSTNAME}/Logger/edgetech-axis-ptz-controller/JSON

0 comments on commit 2db21a6

Please sign in to comment.