From 3d43f1cff1846a9c543a382101492697bb997a00 Mon Sep 17 00:00:00 2001 From: cranphin Date: Thu, 16 Sep 2010 22:32:49 +0000 Subject: [PATCH] GCS: Zero data structures, since this is not Java ;) I was getting some weird initial random values from the sim. This fixes that. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1667 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/hitlnew/fgsimulator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ground/src/plugins/hitlnew/fgsimulator.cpp b/ground/src/plugins/hitlnew/fgsimulator.cpp index 723f05442..7bb3a7f92 100644 --- a/ground/src/plugins/hitlnew/fgsimulator.cpp +++ b/ground/src/plugins/hitlnew/fgsimulator.cpp @@ -201,13 +201,15 @@ void FGSimulator::processUpdate(QString& data) // Update AltitudeActual object BaroAltitude::DataFields altActualData; - altActualData.Altitude = altitudeAGL; + memset(&altActualData, 0, sizeof(BaroAltitude::DataFields)); + altActualData.Altitude = altitudeAGL; altActualData.Temperature = temperature; altActualData.Pressure = pressure; altActual->setData(altActualData); // Update attActual object AttitudeActual::DataFields attActualData; + memset(&attActualData, 0, sizeof(AttitudeActual::DataFields)); attActualData.Roll = roll; attActualData.Pitch = pitch; attActualData.Yaw = yaw; @@ -219,7 +221,8 @@ void FGSimulator::processUpdate(QString& data) // Update gps objects PositionActual::DataFields gpsData; - gpsData.Altitude = altitude; + memset(&gpsData, 0, sizeof(PositionActual::DataFields)); + gpsData.Altitude = altitude; gpsData.Heading = heading; gpsData.Groundspeed = groundspeed; gpsData.Latitude = latitude;