1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

GCS: Also zero the structures in the il2 sim.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1668 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
cranphin 2010-09-16 22:35:36 +00:00 committed by cranphin
parent 3d43f1cff1
commit b1b4b15ef4

View File

@ -209,6 +209,7 @@ void IL2Simulator::processUpdate(QString& data)
// Update AltitudeActual object // Update AltitudeActual object
BaroAltitude::DataFields altActualData; BaroAltitude::DataFields altActualData;
memset(&altActualData, 0, sizeof(BaroAltitude::DataFields));
altActualData.Altitude = current.Z; altActualData.Altitude = current.Z;
altActualData.Temperature = TEMP_GROUND + (current.Z * TEMP_LAPSE_RATE) - 273.0; altActualData.Temperature = TEMP_GROUND + (current.Z * TEMP_LAPSE_RATE) - 273.0;
altActualData.Pressure = PRESSURE(current.Z)/1000.0; // kpa altActualData.Pressure = PRESSURE(current.Z)/1000.0; // kpa
@ -216,6 +217,7 @@ void IL2Simulator::processUpdate(QString& data)
// Update attActual object // Update attActual object
AttitudeActual::DataFields attActualData; AttitudeActual::DataFields attActualData;
memset(&attActualData, 0, sizeof(AttitudeActual::DataFields));
attActualData.Roll = current.roll; attActualData.Roll = current.roll;
attActualData.Pitch = current.pitch; attActualData.Pitch = current.pitch;
attActualData.Yaw = current.azimuth; attActualData.Yaw = current.azimuth;
@ -227,6 +229,7 @@ void IL2Simulator::processUpdate(QString& data)
// Update gps objects // Update gps objects
PositionActual::DataFields gpsData; PositionActual::DataFields gpsData;
memset(&gpsData, 0, sizeof(PositionActual::DataFields));
gpsData.Altitude = current.Z; gpsData.Altitude = current.Z;
gpsData.Heading = current.azimuth; gpsData.Heading = current.azimuth;
gpsData.Groundspeed = current.groundspeed; gpsData.Groundspeed = current.groundspeed;