Update Drone.cs

This commit is contained in:
2025-06-27 02:01:41 +03:00
parent f4044e3939
commit c763581ebb

View File

@ -474,7 +474,7 @@ namespace DroneSimulator
of.X = RealOF.result.X; of.X = RealOF.result.X;
of.Y = RealOF.result.Y; of.Y = RealOF.result.Y;
of.Time = RealBar.timer; of.Time = RealOF.timer;
MoveOF = Vector2.Zero; MoveOF = Vector2.Zero;
@ -491,7 +491,7 @@ namespace DroneSimulator
gps.Head.Time = (uint)(Stopwatch.GetTimestamp() / (Stopwatch.Frequency / 1000)); gps.Head.Time = (uint)(Stopwatch.GetTimestamp() / (Stopwatch.Frequency / 1000));
GPS.Point p = new GPS.Point(); GPS.Point p = new GPS.Point();
p.x = PosXYZ.Y; p.y= PosXYZ.X; p.x = RealPos.result.Y; p.y= RealPos.result.X;
GPS.GlobalCoords g = new GPS.GlobalCoords(); GPS.GlobalCoords g = new GPS.GlobalCoords();
g.latitude=GPS.Home.Lat; g.longitude=GPS.Home.Lon; g.latitude=GPS.Home.Lat; g.longitude=GPS.Home.Lon;
@ -501,7 +501,7 @@ namespace DroneSimulator
gps.Lat = g.latitude; gps.Lon = g.longitude; gps.Lat = g.latitude; gps.Lon = g.longitude;
gps.Speed = MathF.Sqrt(SpdXYZ.X * SpdXYZ.X + SpdXYZ.Y * SpdXYZ.Y + SpdXYZ.Z * SpdXYZ.Z); gps.Speed = MathF.Sqrt(SpdXYZ.X * SpdXYZ.X + SpdXYZ.Y * SpdXYZ.Y + SpdXYZ.Z * SpdXYZ.Z);
gps.Alt = GPS.Home.Alt + PosXYZ.Z; gps.Alt = GPS.Home.Alt + RealPos.result.Z;
DateTime tim = DateTime.Now; DateTime tim = DateTime.Now;
gps.UTC = tim.Second + tim.Minute * 100 + tim.Hour * 10000; gps.UTC = tim.Second + tim.Minute * 100 + tim.Hour * 10000;
@ -514,6 +514,8 @@ namespace DroneSimulator
gps.Vdop = GPS.State.Vdop; gps.Vdop = GPS.State.Vdop;
gps.Pdop = GPS.State.Pdop; gps.Pdop = GPS.State.Pdop;
gps.Time = RealPos.timer;
return getBytes(gps); return getBytes(gps);
} }