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

Fixed timer bug in baroAlt.

This commit is contained in:
Kenz Dale 2012-08-29 16:09:01 +02:00
parent e123a88262
commit 034b366578

View File

@ -242,8 +242,7 @@ void Simulator::setupObjects()
setupInputObject(actDesired, settings.minOutputPeriod); //Input to the simulator setupInputObject(actDesired, settings.minOutputPeriod); //Input to the simulator
} }
setupOutputObject(posHome, 10000); setupOutputObject(posHome, 10000); //Hardcoded? Bleh.
setupOutputObject(baroAlt, 250);
if (settings.gpsPositionEnabled) if (settings.gpsPositionEnabled)
setupOutputObject(gpsPos, settings.gpsPosRate); setupOutputObject(gpsPos, settings.gpsPosRate);
@ -264,9 +263,12 @@ void Simulator::setupObjects()
} }
if (settings.attActualEnabled && !settings.attActHW) if (settings.attActualEnabled && !settings.attActHW)
setupOutputObject(attActual, 20); setupOutputObject(attActual, 20); //Hardcoded? Bleh.
else else
setupWatchedObject(attActual, 100); setupWatchedObject(attActual, 100); //Hardcoded? Bleh.
if(settings.baroAltitudeEnabled)
setupOutputObject(baroAlt, settings.baroAltRate);
} }
@ -668,11 +670,7 @@ void Simulator::updateUAVOs(Output2Hardware out){
baroAltData.Pressure = out.pressure + noise.baroAltData.Pressure; baroAltData.Pressure = out.pressure + noise.baroAltData.Pressure;
baroAlt->setData(baroAltData); baroAlt->setData(baroAltData);
// Update BaroAirspeed object baroAltTime=baroAltTime.addMSecs(settings.baroAltRate);
BaroAirspeed::DataFields baroAirspeedData;
memset(&baroAirspeedData, 0, sizeof(BaroAirspeed::DataFields));
baroAirspeedData.CalibratedAirspeed = out.calibratedAirspeed + noise.baroAirspeed.CalibratedAirspeed;
baroAirspeed->setData(baroAirspeedData);
} }
} }