Add SX template

This commit is contained in:
30hours 2024-03-05 12:28:04 +00:00
parent 885019ab08
commit b4f129c1e4
2 changed files with 44 additions and 3 deletions

View file

@ -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

View file

@ -16,6 +16,7 @@ import hashlib
from algorithm.associator.AdsbAssociator import AdsbAssociator from algorithm.associator.AdsbAssociator import AdsbAssociator
from algorithm.localisation.EllipseParametric import EllipseParametric from algorithm.localisation.EllipseParametric import EllipseParametric
from algorithm.localisation.EllipsoidParametric import EllipsoidParametric from algorithm.localisation.EllipsoidParametric import EllipsoidParametric
from algorithm.localisation.SphericalIntersection import SphericalIntersection
from common.Message import Message from common.Message import Message
from data.Ellipsoid import Ellipsoid from data.Ellipsoid import Ellipsoid
@ -29,6 +30,7 @@ tDelete = 60
adsbAssociator = AdsbAssociator() adsbAssociator = AdsbAssociator()
ellipseParametric = EllipseParametric() ellipseParametric = EllipseParametric()
ellipsoidParametric = EllipsoidParametric() ellipsoidParametric = EllipsoidParametric()
sphericalIntersection = SphericalIntersection()
async def event(): async def event():
@ -97,10 +99,12 @@ async def event():
return return
# localisation selection # localisation selection
if item["localisation"] == "ellipsoid-parametric": if item["localisation"] == "ellipse-parametric":
localisation = ellipsoidParametric
elif item["localisation"] == "ellipse-parametric":
localisation = ellipseParametric localisation = ellipseParametric
elif item["localisation"] == "ellipsoid-parametric":
localisation = ellipsoidParametric
elif item["localisation"] == "spherical-intersection":
localisation = sphericalIntersection
else: else:
print("Error: Localisation invalid.") print("Error: Localisation invalid.")
return return