Mag active

This commit is contained in:
2025-07-26 02:35:15 +03:00
parent 65011e65ee
commit bb32111f29
4 changed files with 732 additions and 670 deletions

View File

@ -62,7 +62,7 @@ namespace DroneSimulator
private RealMode.Barometer RealBar = new RealMode.Barometer();
private RealMode.Range RealRange = new RealMode.Range();
private RealMode.OpticalFlow RealOF = new RealMode.OpticalFlow();
private RealMode.Magnetometer RealMagnetometer = new RealMode.Magnetometer();
private RealMode.Magnetometer RealMag = new RealMode.Magnetometer();
public static byte[] getBytes(object data)
{
@ -373,7 +373,7 @@ namespace DroneSimulator
bool of = RealOF.Update(of_xy, LaserRange, tick);
RealMagnetometer.Update(Quat, tick);
RealMag.Update(Quat, tick);
lock (this)
{
@ -481,8 +481,8 @@ namespace DroneSimulator
mag.Head.Type = DroneData.DataType.DataMag;
mag.Head.Time = (uint)(DateTime.Now.Ticks / Stopwatch.Frequency / 1000);
mag.Mag.X = 0; mag.Mag.Y = 0; mag.Mag.Z = 0;
mag.Time = Timer;
mag.Mag.X = RealMag.result.X; mag.Mag.Y = RealMag.result.Y; mag.Mag.Z = RealMag.result.Z;
mag.Time = RealMag.timer;
return getBytes(mag);
}