mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
Removed "airspeed" field from Airspeed UAVO. Now everything is done either with true airspeed or calibrated airspeed
This commit is contained in:
parent
21527544f9
commit
aa5e5a9b01
@ -79,6 +79,8 @@
|
|||||||
|
|
||||||
#define F_PI 3.141526535897932f
|
#define F_PI 3.141526535897932f
|
||||||
#define DEG2RAD (F_PI/180.0f)
|
#define DEG2RAD (F_PI/180.0f)
|
||||||
|
#define T0 288.15f
|
||||||
|
#define BARO_TEMPERATURE_OFFSET 5
|
||||||
|
|
||||||
// Private types
|
// Private types
|
||||||
|
|
||||||
@ -211,12 +213,18 @@ static void airspeedTask(void *parameters)
|
|||||||
baro_airspeedGet(&airspeedData, &lastSysTime, airspeedSensorType, airspeedADCPin);
|
baro_airspeedGet(&airspeedData, &lastSysTime, airspeedSensorType, airspeedADCPin);
|
||||||
|
|
||||||
//Calculate true airspeed, not taking into account compressibility effects
|
//Calculate true airspeed, not taking into account compressibility effects
|
||||||
#define T0 288.15f
|
|
||||||
float baroTemperature;
|
float baroTemperature;
|
||||||
|
|
||||||
BaroAltitudeTemperatureGet(&baroTemperature);
|
BaroAltitudeTemperatureGet(&baroTemperature);
|
||||||
baroTemperature-=5; //Do this just because we suspect that the board heats up relative to its surroundings. THIS IS BAD(tm)
|
baroTemperature-=BARO_TEMPERATURE_OFFSET; //Do this just because we suspect that the board heats up relative to its surroundings. THIS IS BAD(tm)
|
||||||
airspeed_tas_baro=airspeedData.CAS * sqrtf((baroTemperature+273.15)/T0) + airspeedErrInt * GPS_AIRSPEED_BIAS_KI;
|
#ifdef GPS_AIRSPEED_PRESENT
|
||||||
|
//GPS present, so use baro sensor to filter TAS
|
||||||
|
airspeed_tas_baro=airspeedData.CalibratedAirspeed * sqrtf((baroTemperature+273.15)/T0) + airspeedErrInt * GPS_AIRSPEED_BIAS_KI;
|
||||||
|
#else
|
||||||
|
//No GPS, so TAS comes only from baro sensor
|
||||||
|
airspeedData.TrueAirspeed=airspeedData.CalibratedAirspeed * sqrtf((baroTemperature+273.15)/T0) + airspeedErrInt * GPS_AIRSPEED_BIAS_KI;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -266,6 +274,13 @@ static void airspeedTask(void *parameters)
|
|||||||
|
|
||||||
//There's already an airspeed sensor, so instead correct it for bias with P correction. The I correction happened earlier in the function.
|
//There's already an airspeed sensor, so instead correct it for bias with P correction. The I correction happened earlier in the function.
|
||||||
airspeedData.TrueAirspeed = airspeed_tas_baro + airspeedErr * GPS_AIRSPEED_BIAS_KP;
|
airspeedData.TrueAirspeed = airspeed_tas_baro + airspeedErr * GPS_AIRSPEED_BIAS_KP;
|
||||||
|
|
||||||
|
|
||||||
|
/* Note:
|
||||||
|
This would be a good place to change the airspeed calibration, so that it matches the GPS computed values. However,
|
||||||
|
this might be a bad idea, as their are two degrees of freedom here: temperature and sensor calibration. I don't
|
||||||
|
know how to control for temperature bias.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -274,18 +289,22 @@ static void airspeedTask(void *parameters)
|
|||||||
//case, filter the airspeed for smoother output
|
//case, filter the airspeed for smoother output
|
||||||
float alpha=gpsSamplePeriod_ms/(gpsSamplePeriod_ms + GPS_AIRSPEED_TIME_CONSTANT_MS); //Low pass filter.
|
float alpha=gpsSamplePeriod_ms/(gpsSamplePeriod_ms + GPS_AIRSPEED_TIME_CONSTANT_MS); //Low pass filter.
|
||||||
airspeedData.TrueAirspeed=v_air_GPS*(alpha) + airspeedData.TrueAirspeed*(1.0f-alpha);
|
airspeedData.TrueAirspeed=v_air_GPS*(alpha) + airspeedData.TrueAirspeed*(1.0f-alpha);
|
||||||
|
|
||||||
|
//Calculate calibrated airspeed from GPS, since we're not getting it from a discrete airspeed sensor
|
||||||
|
float baroTemperature;
|
||||||
|
BaroAltitudeTemperatureGet(&baroTemperature);
|
||||||
|
baroTemperature-=BARO_TEMPERATURE_OFFSET; //Do this just because we suspect that the board heats up relative to its surroundings. THIS IS BAD(tm)
|
||||||
|
airspeedData.CalibratedAirspeed =airspeedData.TrueAirspeed / sqrtf((baroTemperature+273.15)/T0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef BARO_AIRSPEED_PRESENT
|
||||||
|
else if (airspeedData.BaroConnected==BAROAIRSPEED_BAROCONNECTED_TRUE){
|
||||||
|
//No GPS velocity estimate this loop, so filter data with baro airspeed
|
||||||
|
float alpha=gpsSamplePeriod_ms/(gpsSamplePeriod_ms + GPS_AIRSPEED_TIME_CONSTANT_MS); //Low pass filter.
|
||||||
|
airspeedData.TrueAirspeed=airspeedData.TrueAirspeed*(alpha) + airspeedData.TrueAirspeed*(1.0f-alpha);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Legacy UAVO support, this needs to be removed in favor of using TAS and CAS, as appropriate.
|
|
||||||
if (airspeedData.BaroConnected==BAROAIRSPEED_BAROCONNECTED_FALSE){ //If we only have a GPS, use GPS data as airspeed...
|
|
||||||
airspeedData.Airspeed=airspeedData.TrueAirspeed;
|
|
||||||
}
|
|
||||||
else{ //...otherwise, use the only baro airspeed because we still don't trust true airspeed calculations
|
|
||||||
airspeedData.Airspeed=airspeedData.CAS;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set the UAVO
|
//Set the UAVO
|
||||||
BaroAirspeedSet(&airspeedData);
|
BaroAirspeedSet(&airspeedData);
|
||||||
|
|
||||||
|
@ -151,10 +151,10 @@ void baro_airspeedGet(BaroAirspeedData *baroAirspeedData, portTickType *lastSysT
|
|||||||
}
|
}
|
||||||
//Filter CAS
|
//Filter CAS
|
||||||
float alpha=SAMPLING_DELAY_MS_MPXV/(SAMPLING_DELAY_MS_MPXV + ANALOG_BARO_AIRSPEED_TIME_CONSTANT_MS); //Low pass filter.
|
float alpha=SAMPLING_DELAY_MS_MPXV/(SAMPLING_DELAY_MS_MPXV + ANALOG_BARO_AIRSPEED_TIME_CONSTANT_MS); //Low pass filter.
|
||||||
float filteredAirspeed = calibratedAirspeed*(alpha) + baroAirspeedData->CAS*(1.0f-alpha);
|
float filteredAirspeed = calibratedAirspeed*(alpha) + baroAirspeedData->CalibratedAirspeed*(1.0f-alpha);
|
||||||
|
|
||||||
//Set two values, one for the UAVO airspeed sensor reading, and the other for the GPS corrected one
|
//Set two values, one for the UAVO airspeed sensor reading, and the other for the GPS corrected one
|
||||||
baroAirspeedData->CAS = filteredAirspeed;
|
baroAirspeedData->CalibratedAirspeed = filteredAirspeed;
|
||||||
#else
|
#else
|
||||||
//Whoops, no sensor defined in pios_config.h. Revert to GPS.
|
//Whoops, no sensor defined in pios_config.h. Revert to GPS.
|
||||||
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_FALSE;
|
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_FALSE;
|
||||||
@ -179,7 +179,7 @@ void baro_airspeedGet(BaroAirspeedData *baroAirspeedData, portTickType *lastSysT
|
|||||||
baroAirspeedData->SensorValue = PIOS_ETASV3_ReadAirspeed();
|
baroAirspeedData->SensorValue = PIOS_ETASV3_ReadAirspeed();
|
||||||
if (baroAirspeedData->SensorValue==-1) {
|
if (baroAirspeedData->SensorValue==-1) {
|
||||||
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_FALSE;
|
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_FALSE;
|
||||||
baroAirspeedData->Airspeed = 0;
|
baroAirspeedData->CalibratedAirspeed = 0;
|
||||||
BaroAirspeedSet(&baroAirspeedData);
|
BaroAirspeedSet(&baroAirspeedData);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -204,7 +204,7 @@ void baro_airspeedGet(BaroAirspeedData *baroAirspeedData, portTickType *lastSysT
|
|||||||
float calibratedAirspeed = ETS_AIRSPEED_SCALE * sqrtf((float)abs(baroAirspeedData->SensorValue - airspeedSettingsData.ZeroPoint)); //Is this calibrated or indicated airspeed?
|
float calibratedAirspeed = ETS_AIRSPEED_SCALE * sqrtf((float)abs(baroAirspeedData->SensorValue - airspeedSettingsData.ZeroPoint)); //Is this calibrated or indicated airspeed?
|
||||||
|
|
||||||
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_TRUE;
|
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_TRUE;
|
||||||
baroAirspeedData->CAS = calibratedAirspeed;
|
baroAirspeedData->CalibratedAirspeed = calibratedAirspeed;
|
||||||
#else
|
#else
|
||||||
//Whoops, no EagleTree sensor defined in pios_config.h. Declare it unconnected...
|
//Whoops, no EagleTree sensor defined in pios_config.h. Declare it unconnected...
|
||||||
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_FALSE;
|
baroAirspeedData->BaroConnected = BAROAIRSPEED_BAROCONNECTED_FALSE;
|
||||||
|
@ -363,7 +363,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
|
|
||||||
// float groundspeedActual;
|
// float groundspeedActual;
|
||||||
float groundspeedDesired;
|
float groundspeedDesired;
|
||||||
float airspeedActual;
|
float calibratedAirspeedActual;
|
||||||
float airspeedDesired;
|
float airspeedDesired;
|
||||||
float airspeedError;
|
float airspeedError;
|
||||||
float accelActual;
|
float accelActual;
|
||||||
@ -401,8 +401,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
|
|
||||||
// Current ground speed
|
// Current ground speed
|
||||||
// groundspeedActual = sqrtf( velocityActual.East*velocityActual.East + velocityActual.North*velocityActual.North );
|
// groundspeedActual = sqrtf( velocityActual.East*velocityActual.East + velocityActual.North*velocityActual.North );
|
||||||
// airspeedActual = groundspeedActual + baroAirspeedBias;
|
calibratedAirspeedActual = baroAirspeed.CalibratedAirspeed;
|
||||||
airspeedActual = baroAirspeed.Airspeed;
|
|
||||||
|
|
||||||
// Desired ground speed
|
// Desired ground speed
|
||||||
groundspeedDesired = sqrtf(velocityDesired.North*velocityDesired.North + velocityDesired.East*velocityDesired.East);
|
groundspeedDesired = sqrtf(velocityDesired.North*velocityDesired.North + velocityDesired.East*velocityDesired.East);
|
||||||
@ -411,7 +410,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
fixedwingpathfollowerSettings.CruiseSpeed);
|
fixedwingpathfollowerSettings.CruiseSpeed);
|
||||||
|
|
||||||
// Airspeed error
|
// Airspeed error
|
||||||
airspeedError = airspeedDesired - airspeedActual;
|
airspeedError = airspeedDesired - calibratedAirspeedActual;
|
||||||
|
|
||||||
// Vertical speed error
|
// Vertical speed error
|
||||||
descentspeedDesired = bound (
|
descentspeedDesired = bound (
|
||||||
@ -429,28 +428,28 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
// Error condition: plane too slow or too fast
|
// Error condition: plane too slow or too fast
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_HIGHSPEED] = 0;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_HIGHSPEED] = 0;
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_LOWSPEED] = 0;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_LOWSPEED] = 0;
|
||||||
if ( airspeedActual > fixedwingpathfollowerSettings.AirSpeedMax) {
|
if ( calibratedAirspeedActual > fixedwingpathfollowerSettings.AirSpeedMax) {
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_OVERSPEED] = 1;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_OVERSPEED] = 1;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
if ( airspeedActual > fixedwingpathfollowerSettings.CruiseSpeed * 1.2f) {
|
if ( calibratedAirspeedActual > fixedwingpathfollowerSettings.CruiseSpeed * 1.2f) {
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_HIGHSPEED] = 1;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_HIGHSPEED] = 1;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
if (airspeedActual < fixedwingpathfollowerSettings.BestClimbRateSpeed * 0.8f && 1) { //The next three && 1 are placeholders for UAVOs representing LANDING and TAKEOFF
|
if (calibratedAirspeedActual < fixedwingpathfollowerSettings.BestClimbRateSpeed * 0.8f && 1) { //The next three && 1 are placeholders for UAVOs representing LANDING and TAKEOFF
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_LOWSPEED] = 1;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_LOWSPEED] = 1;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
if (airspeedActual < fixedwingpathfollowerSettings.StallSpeedClean && 1 && 1) { //Where the && 1 represents the UAVO that will control whether the airplane is prepped for landing or not
|
if (calibratedAirspeedActual < fixedwingpathfollowerSettings.StallSpeedClean && 1 && 1) { //Where the && 1 represents the UAVO that will control whether the airplane is prepped for landing or not
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_STALLSPEED] = 1;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_STALLSPEED] = 1;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
if (airspeedActual < fixedwingpathfollowerSettings.StallSpeedDirty && 1) {
|
if (calibratedAirspeedActual < fixedwingpathfollowerSettings.StallSpeedDirty && 1) {
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_STALLSPEED] = 1;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_STALLSPEED] = 1;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (airspeedActual<1e-6) {
|
if (calibratedAirspeedActual<1e-6) {
|
||||||
// prevent division by zero, abort without controlling anything. This guidance mode is not suited for takeoff or touchdown, or handling stationary planes
|
// prevent division by zero, abort without controlling anything. This guidance mode is not suited for takeoff or touchdown, or handling stationary planes
|
||||||
// also we cannot handle planes flying backwards, lets just wait until the nose drops
|
// also we cannot handle planes flying backwards, lets just wait until the nose drops
|
||||||
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_LOWSPEED] = 1;
|
fixedwingpathfollowerStatus.Errors[FIXEDWINGPATHFOLLOWERSTATUS_ERRORS_LOWSPEED] = 1;
|
||||||
@ -555,7 +554,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
*/
|
*/
|
||||||
// compute desired acceleration
|
// compute desired acceleration
|
||||||
if(0){
|
if(0){
|
||||||
accelDesired = bound( (airspeedError/airspeedActual) * fixedwingpathfollowerSettings.SpeedP[FIXEDWINGPATHFOLLOWERSETTINGS_SPEEDP_KP],
|
accelDesired = bound( (airspeedError/calibratedAirspeedActual) * fixedwingpathfollowerSettings.SpeedP[FIXEDWINGPATHFOLLOWERSETTINGS_SPEEDP_KP],
|
||||||
-fixedwingpathfollowerSettings.SpeedP[FIXEDWINGPATHFOLLOWERSETTINGS_SPEEDP_MAX],
|
-fixedwingpathfollowerSettings.SpeedP[FIXEDWINGPATHFOLLOWERSETTINGS_SPEEDP_MAX],
|
||||||
fixedwingpathfollowerSettings.SpeedP[FIXEDWINGPATHFOLLOWERSETTINGS_SPEEDP_MAX]);
|
fixedwingpathfollowerSettings.SpeedP[FIXEDWINGPATHFOLLOWERSETTINGS_SPEEDP_MAX]);
|
||||||
fixedwingpathfollowerStatus.Error[FIXEDWINGPATHFOLLOWERSTATUS_ERROR_SPEED] = airspeedError;
|
fixedwingpathfollowerStatus.Error[FIXEDWINGPATHFOLLOWERSTATUS_ERROR_SPEED] = airspeedError;
|
||||||
@ -579,7 +578,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
fixedwingpathfollowerStatus.ErrorInt[FIXEDWINGPATHFOLLOWERSTATUS_ERRORINT_ACCEL] = accelIntegral;
|
fixedwingpathfollowerStatus.ErrorInt[FIXEDWINGPATHFOLLOWERSTATUS_ERRORINT_ACCEL] = accelIntegral;
|
||||||
fixedwingpathfollowerStatus.Command[FIXEDWINGPATHFOLLOWERSTATUS_COMMAND_ACCEL] = accelCommand;
|
fixedwingpathfollowerStatus.Command[FIXEDWINGPATHFOLLOWERSTATUS_COMMAND_ACCEL] = accelCommand;
|
||||||
|
|
||||||
pitchCommand= -accelCommand + bound ( (-descentspeedError/airspeedActual) * fixedwingpathfollowerSettings.VerticalToPitchCrossFeed[FIXEDWINGPATHFOLLOWERSETTINGS_VERTICALTOPITCHCROSSFEED_KP],
|
pitchCommand= -accelCommand + bound ( (-descentspeedError/calibratedAirspeedActual) * fixedwingpathfollowerSettings.VerticalToPitchCrossFeed[FIXEDWINGPATHFOLLOWERSETTINGS_VERTICALTOPITCHCROSSFEED_KP],
|
||||||
-fixedwingpathfollowerSettings.VerticalToPitchCrossFeed[FIXEDWINGPATHFOLLOWERSETTINGS_VERTICALTOPITCHCROSSFEED_MAX],
|
-fixedwingpathfollowerSettings.VerticalToPitchCrossFeed[FIXEDWINGPATHFOLLOWERSETTINGS_VERTICALTOPITCHCROSSFEED_MAX],
|
||||||
fixedwingpathfollowerSettings.VerticalToPitchCrossFeed[FIXEDWINGPATHFOLLOWERSETTINGS_VERTICALTOPITCHCROSSFEED_MAX]
|
fixedwingpathfollowerSettings.VerticalToPitchCrossFeed[FIXEDWINGPATHFOLLOWERSETTINGS_VERTICALTOPITCHCROSSFEED_MAX]
|
||||||
);
|
);
|
||||||
@ -715,7 +714,7 @@ static void baroAirspeedUpdatedCb(UAVObjEvent * ev)
|
|||||||
float groundspeed = sqrtf(velocityActual.East*velocityActual.East + velocityActual.North*velocityActual.North );
|
float groundspeed = sqrtf(velocityActual.East*velocityActual.East + velocityActual.North*velocityActual.North );
|
||||||
|
|
||||||
|
|
||||||
baroAirspeedBias = baroAirspeed.Airspeed - groundspeed;
|
baroAirspeedBias = baroAirspeed.TrueAirspeed - groundspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ static uint8_t conditionAboveSpeed() {
|
|||||||
BaroAirspeedData baroAirspeed;
|
BaroAirspeedData baroAirspeed;
|
||||||
BaroAirspeedGet (&baroAirspeed);
|
BaroAirspeedGet (&baroAirspeed);
|
||||||
if (baroAirspeed.BaroConnected == BAROAIRSPEED_BAROCONNECTED_TRUE) {
|
if (baroAirspeed.BaroConnected == BAROAIRSPEED_BAROCONNECTED_TRUE) {
|
||||||
velocity = baroAirspeed.Airspeed;
|
velocity = baroAirspeed.TrueAirspeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ void FGSimulator::processUpdate(const QByteArray& inp)
|
|||||||
out.altitude = altitude;
|
out.altitude = altitude;
|
||||||
out.groundspeed = groundspeed;
|
out.groundspeed = groundspeed;
|
||||||
|
|
||||||
out.airspeed = airspeed;
|
out.calibratedAirspeed = airspeed;
|
||||||
|
|
||||||
|
|
||||||
// Update BaroAltitude object
|
// Update BaroAltitude object
|
||||||
|
@ -72,6 +72,6 @@ Noise HitlNoiseGeneration::generateNoise(){
|
|||||||
noise.accelData.y=0;
|
noise.accelData.y=0;
|
||||||
noise.accelData.z=0;
|
noise.accelData.z=0;
|
||||||
|
|
||||||
noise.baroAirspeed.Airspeed=0;
|
noise.baroAirspeed.CalibratedAirspeed=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ void IL2Simulator::processUpdate(const QByteArray& inp)
|
|||||||
out.longitude = settings.longitude.toFloat() * 1e7;
|
out.longitude = settings.longitude.toFloat() * 1e7;
|
||||||
out.groundspeed = current.groundspeed;
|
out.groundspeed = current.groundspeed;
|
||||||
|
|
||||||
out.airspeed = current.ias;
|
out.calibratedAirspeed = current.ias;
|
||||||
|
|
||||||
out.dstN=current.Y;
|
out.dstN=current.Y;
|
||||||
out.dstE=current.X;
|
out.dstE=current.X;
|
||||||
|
@ -414,7 +414,7 @@ void Simulator::updateUAVOs(Output2OP out){
|
|||||||
// Update BaroAirspeed object
|
// Update BaroAirspeed object
|
||||||
BaroAirspeed::DataFields baroAirspeedData;
|
BaroAirspeed::DataFields baroAirspeedData;
|
||||||
memset(&baroAirspeedData, 0, sizeof(BaroAirspeed::DataFields));
|
memset(&baroAirspeedData, 0, sizeof(BaroAirspeed::DataFields));
|
||||||
baroAirspeedData.Airspeed = out.airspeed + noise.baroAirspeed.Airspeed;
|
baroAirspeedData.CalibratedAirspeed = out.calibratedAirspeed + noise.baroAirspeed.CalibratedAirspeed;
|
||||||
baroAirspeed->setData(baroAirspeedData);
|
baroAirspeed->setData(baroAirspeedData);
|
||||||
|
|
||||||
//Update gyroscope sensor data
|
//Update gyroscope sensor data
|
||||||
|
@ -118,7 +118,7 @@ struct Output2OP{
|
|||||||
float altitude;
|
float altitude;
|
||||||
float heading;
|
float heading;
|
||||||
float groundspeed; //[m/s]
|
float groundspeed; //[m/s]
|
||||||
float airspeed; //[m/s]
|
float calibratedAirspeed; //[m/s]
|
||||||
float pitch;
|
float pitch;
|
||||||
float roll;
|
float roll;
|
||||||
float pressure;
|
float pressure;
|
||||||
|
@ -301,7 +301,7 @@ void XplaneSimulator::processUpdate(const QByteArray& dataBuf)
|
|||||||
out.altitude = altitude;
|
out.altitude = altitude;
|
||||||
out.groundspeed = groundspeed_ktgs*1.15*1.6089/3.6; //Convert from [kts] to [m/s]
|
out.groundspeed = groundspeed_ktgs*1.15*1.6089/3.6; //Convert from [kts] to [m/s]
|
||||||
|
|
||||||
out.airspeed = airspeed_keas*1.15*1.6089/3.6; //Convert from [kts] to [m/s]
|
out.calibratedAirspeed = airspeed_keas*1.15*1.6089/3.6; //Convert from [kts] to [m/s]
|
||||||
|
|
||||||
// Update BaroAltitude object
|
// Update BaroAltitude object
|
||||||
out.temperature = temperature;
|
out.temperature = temperature;
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
<description>The raw data from the dynamic pressure sensor with pressure, temperature and airspeed.</description>
|
<description>The raw data from the dynamic pressure sensor with pressure, temperature and airspeed.</description>
|
||||||
<field name="BaroConnected" units="" type="enum" elements="1" options="False,True"/>
|
<field name="BaroConnected" units="" type="enum" elements="1" options="False,True"/>
|
||||||
<field name="SensorValue" units="raw" type="uint16" elements="1"/>
|
<field name="SensorValue" units="raw" type="uint16" elements="1"/>
|
||||||
<field name="Airspeed" units="m/s" type="float" elements="1"/>
|
<field name="CalibratedAirspeed" units="m/s" type="float" elements="1"/>
|
||||||
<field name="CAS" units="m/s" type="float" elements="1"/>
|
|
||||||
<field name="GPSAirspeed" units="m/s" type="float" elements="1"/>
|
<field name="GPSAirspeed" units="m/s" type="float" elements="1"/>
|
||||||
<field name="TrueAirspeed" units="m/s" type="float" elements="1"/>
|
<field name="TrueAirspeed" units="m/s" type="float" elements="1"/>
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user