Update readme and minor fixes

This commit is contained in:
30hours 2024-03-16 05:20:34 +00:00
parent f737d5602d
commit 2ac180714e
6 changed files with 31 additions and 14 deletions

View file

@ -2,6 +2,10 @@
Target localisation for multi-static radar using ellipse intersections. Not a dating app.
See a live instance at [http://3lips.30hours.dev](http://3lips.30hours.dev).
![3lips example display](./example.png "3lips")
## Features
- Provides a JSON API for geolocation of targets given [blah2](http://github.com/30hours/blah2) radar nodes.
@ -12,6 +16,7 @@ Target localisation for multi-static radar using ellipse intersections. Not a da
- Install docker and docker-compose on the host machine.
- Clone this repository to some directory.
- Edit the [./config/config.yml](./config./config.yml) file for scenario.
- Run the docker compose command.
```bash
@ -46,6 +51,7 @@ The system architecture is as follows:
- Implement an association algorithm that is not reliant on ADS-B truth.
- Choose to use detection or track data from each radar.
- Long term plots to show metrics such as 2D location accuracy to ADS-B, number of aircraft tracked, etc.
- Scale number of samples in ellipse/ellipsoid to size of shape.
## License

View file

@ -20,7 +20,7 @@ function event_ellipsoid() {
removeEntitiesByType("ellipsoids");
}
else {
removeEntitiesOlderThanAndFade("ellipsoids", 5, 0.5);
removeEntitiesOlderThanAndFade("ellipsoids", 10, 0.5);
}
for (const key in data["ellipsoids"]) {
if (data["ellipsoids"].hasOwnProperty(key)) {
@ -54,7 +54,7 @@ function event_ellipsoid() {
}
var style_ellipsoid = {};
style_ellipsoid.color = 'rgba(0, 0, 255, 0.5)';
style_ellipsoid.color = 'rgba(0, 255, 255, 0.5)';
style_ellipsoid.pointSize = 16;
style_ellipsoid.type = "ellipsoids";
style_ellipsoid.timestamp = Date.now();

View file

@ -16,7 +16,7 @@ function event_radar() {
return;
}
removeEntitiesOlderThanAndFade("detection", 90, 0.5);
removeEntitiesOlderThanAndFade("detection", 10, 0.5);
for (const key in data["detections_localised"]) {
if (data["detections_localised"].hasOwnProperty(key)) {

View file

@ -31,8 +31,8 @@ tDelete = 60
adsbAssociator = AdsbAssociator()
ellipseParametricMean = EllipseParametric("mean", 150, 500)
ellipseParametricMin = EllipseParametric("min", 150, 500)
ellipsoidParametricMean = EllipsoidParametric("mean", 120, 1000)
ellipsoidParametricMin = EllipsoidParametric("min", 120, 1000)
ellipsoidParametricMean = EllipsoidParametric("mean", 60, 800)
ellipsoidParametricMin = EllipsoidParametric("min", 60, 800)
sphericalIntersection = SphericalIntersection()
adsbTruth = AdsbTruth(5)
save = True
@ -40,7 +40,7 @@ saveFile = '/app/save/' + str(int(time.time())) + '.ndjson'
async def event():
start_time = time.time()
print('Start event', flush=True)
global api, save
timestamp = int(time.time()*1000)
@ -101,6 +101,8 @@ async def event():
# main processing
for item in api_event:
start_time = time.time()
# extract dict for item
radar_dict_item = {
key: radar_dict[key]
@ -196,6 +198,9 @@ async def event():
item["ellipsoids"] = ellipsoids
item["time"] = stop_time - start_time
print('Method: ' + item["localisation"], flush=True)
print(item["time"], flush=True)
# delete old API requests
api_event = [
item for item in api_event if timestamp - item["timestamp"] <= tDelete*1000]
@ -234,7 +239,7 @@ def short_hash(input_string, length=10):
# message received callback
async def callback_message_received(msg):
print(f"Callback: Received message in event.py: {msg}", flush=True)
#print(f"Callback: Received message in event.py: {msg}", flush=True)
timestamp = int(time.time()*1000)

BIN
example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -164,20 +164,26 @@ def main():
# plot x, y, z
#plt.figure(figsize=(5,7))
position2 = {}
position2["ellipse-parametric-mean"] = position["ellipse-parametric-mean"]
position2["ellipsoid-parametric-mean"] = position["ellipsoid-parametric-mean"]
position2["spherical-intersection"] = position["spherical-intersection"]
mark = ['x', 'o', 's']
position_reord = ["ellipse-parametric-mean", "ellipsoid-parametric-mean", "spherical-intersection"]
fig, axes = plt.subplots(3, 1, figsize=(5, 7), sharex=True)
for i in range(3):
yaxis_truth = [pos[i] for pos in truth_position_resampled_enu]
plt.subplot(3, 1, i+1)
plt.plot(timestamp, yaxis_truth, label="ADS-B Truth")
for method in position:
for method in position_reord:
print(position[method])
if "detections_enu" not in position[method]:
continue
for i in range(3):
print(position)
#print(position)
yaxis_target = [pos[i] for pos in position[method]["detections_enu"]]
plt.subplot(3, 1, i+1)
plt.plot(position[method]["timestamp"], yaxis_target, 'x', label=method)
plt.plot(position[method]["timestamp"], yaxis_target, marker=mark[i], label=method)
plt.xlabel('Timestamp')
if i == 0:
plt.ylabel('ENU X (m)')
@ -187,7 +193,7 @@ def main():
plt.ylabel('ENU Z (m)')
plt.subplot(3, 1, 1)
plt.legend()
plt.legend(prop = {"size": 8})
plt.tight_layout()
filename = 'plot_accuracy_' + args.target_name + '.png'
plt.savefig('save/' + filename, bbox_inches='tight', pad_inches=0.01)
@ -206,9 +212,9 @@ def main():
yaxis_target = [pos[i] for pos in position[method]["detections_enu"]]
table[method][str(i)] = calculate_rmse(yaxis_target, yaxis_truth_target)
print('test')
print(yaxis_target)
print(yaxis_truth_target)
#print('test')
#print(yaxis_target)
#print(yaxis_truth_target)
print(table)