Example #1
0
WindEKFGlue::Result
WindEKFGlue::Update(const NMEAInfo &basic, const DerivedInfo &derived)
{
  // @todo accuracy: correct TAS for vertical speed if dynamic pullup

  // reset if flight hasnt started or airspeed instrument not available
  if (!derived.flight.flying ||
      !basic.airspeed_available || !basic.airspeed_real ||
      basic.true_airspeed < fixed_one) {
    reset();
    return Result(0);
  }

  // temporary manoeuvering, dont append this point
  if ((fabs(derived.turn_rate) > fixed(20)) ||
      (fabs(basic.acceleration.g_load - fixed_one) > fixed(0.3))) {

    blackout(basic.time);
    return Result(0);
  }

  if (in_blackout(basic.time))
    return Result(0);

  // clear blackout
  blackout((unsigned)-1);

  float V = basic.true_airspeed;
  float dynamic_pressure = V*V;
  float gps_vel[2];
  fixed gps_east, gps_north;
  basic.track.sin_cos(gps_east, gps_north);
  gps_vel[0] = (float)(gps_east * basic.ground_speed);
  gps_vel[1] = (float)(gps_north * basic.ground_speed);

  float dT = 1.0;

  StatePrediction(gps_vel, dT);
  Correction(dynamic_pressure, gps_vel);
  // CovariancePrediction(dT);
  const float* x = get_state();

  Result res;
  static int j=0;
  j++;
  if (j%10==0)
    res.quality = 1;
  else
    res.quality = 0;

  res.wind = SpeedVector(fixed(-x[0]), fixed(-x[1]));

  return res;
}
Example #2
0
int OutputMap_Test::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: initial(); break;
        case 1: appendPlugin(); break;
        case 2: notOutputPlugin(); break;
        case 3: setPatch(); break;
        case 4: claimReleaseDumpReset(); break;
        case 5: blackout(); break;
        case 6: pluginNames(); break;
        case 7: pluginOutputs(); break;
        case 8: universeNames(); break;
        case 9: configure(); break;
        case 10: slotConfigurationChanged(); break;
        case 11: mapping(); break;
        case 12: pluginStatus(); break;
        default: ;
        }
        _id -= 13;
    }
    return _id;
}