From b4f129c1e4da0ab6e9556b748c4d50c235f7ff67 Mon Sep 17 00:00:00 2001 From: 30hours Date: Tue, 5 Mar 2024 12:28:04 +0000 Subject: [PATCH] Add SX template --- .../localisation/SphericalIntersection.py | 37 +++++++++++++++++++ event/event.py | 10 +++-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/event/algorithm/localisation/SphericalIntersection.py b/event/algorithm/localisation/SphericalIntersection.py index e69de29..9b787de 100644 --- a/event/algorithm/localisation/SphericalIntersection.py +++ b/event/algorithm/localisation/SphericalIntersection.py @@ -0,0 +1,37 @@ +""" +@file SphericalIntersection.py +@author 30hours +""" + +from data.Ellipsoid import Ellipsoid +from algorithm.geometry.Geometry import Geometry +import numpy as np +import math + +class SphericalIntersection: + + """ + @class SphericalIntersection + @brief A class for intersecting ellipsoids using SX method. + @details Uses associated detections from multiple radars. + @see blah2 at https://github.com/30hours/blah2. + """ + + def __init__(self): + + """ + @brief Constructor for the SphericalIntersection class. + """ + + def process(self, assoc_detections, radar_data): + + """ + @brief Perform target localisation using the SX method. + @param assoc_detections (dict): JSON of blah2 radar detections. + @param radar_data (dict): JSON of adsb2dd truth detections. + @return dict: Dict of associated detections. + """ + + output = {} + + return output \ No newline at end of file diff --git a/event/event.py b/event/event.py index 999f4f4..93843a1 100644 --- a/event/event.py +++ b/event/event.py @@ -16,6 +16,7 @@ import hashlib from algorithm.associator.AdsbAssociator import AdsbAssociator from algorithm.localisation.EllipseParametric import EllipseParametric from algorithm.localisation.EllipsoidParametric import EllipsoidParametric +from algorithm.localisation.SphericalIntersection import SphericalIntersection from common.Message import Message from data.Ellipsoid import Ellipsoid @@ -29,6 +30,7 @@ tDelete = 60 adsbAssociator = AdsbAssociator() ellipseParametric = EllipseParametric() ellipsoidParametric = EllipsoidParametric() +sphericalIntersection = SphericalIntersection() async def event(): @@ -97,10 +99,12 @@ async def event(): return # localisation selection - if item["localisation"] == "ellipsoid-parametric": - localisation = ellipsoidParametric - elif item["localisation"] == "ellipse-parametric": + if item["localisation"] == "ellipse-parametric": localisation = ellipseParametric + elif item["localisation"] == "ellipsoid-parametric": + localisation = ellipsoidParametric + elif item["localisation"] == "spherical-intersection": + localisation = sphericalIntersection else: print("Error: Localisation invalid.") return