Ellipse working

This commit is contained in:
30hours 2024-03-06 10:31:32 +00:00
parent 90694e6758
commit bb6ef6166d
2 changed files with 4 additions and 10 deletions

View file

@ -145,16 +145,10 @@ class EllipseParametric:
for i in range(len(r_1)): for i in range(len(r_1)):
# points to ECEF # points to ECEF
x, y, z = Geometry.enu2ecef( x, y, z = Geometry.enu2ecef(
r_1[i][0], r_1[i][1], 0, r_1[i][0], r_1[i][1], 100,
ellipsoid.midpoint_lla[0], ellipsoid.midpoint_lla[0],
ellipsoid.midpoint_lla[1], ellipsoid.midpoint_lla[1],
ellipsoid.midpoint_lla[2]) ellipsoid.midpoint_lla[2])
# points to LLA output.append([x, y, z])
[x, y, z] = Geometry.ecef2lla(x, y, z)
# only store points above ground
if z > 0:
# convert back to ECEF for simple distance measurements
[x, y, z] = Geometry.lla2ecef(x, y, z)
output.append([round(x, 3), round(y, 3), 0])
return output return output

View file

@ -149,10 +149,10 @@ async def event():
[x_rx, y_rx, z_rx], [x_rx, y_rx, z_rx],
radar["radar"] radar["radar"]
) )
points = ellipsoidParametric.sample(ellipsoid, radar["delay"]*1000, 50) points = localisation.sample(ellipsoid, radar["delay"]*1000, 50)
for i in range(len(points)): for i in range(len(points)):
lat, lon, alt = Geometry.ecef2lla(points[i][0], points[i][1], points[i][2]) lat, lon, alt = Geometry.ecef2lla(points[i][0], points[i][1], points[i][2])
points[i] = ([round(lat, 3), round(lon, 3), round(alt)]) points[i] = ([round(lat, 3), round(lon, 3), 0])
ellipsoids[radar["radar"]] = points ellipsoids[radar["radar"]] = points
# output data to API # output data to API