Пример #1
0
TEST(IOBoardModelTest, Instantiation) {
    IOBoardModel test = IOBoardModel(
        Quaternionr(1, 0, 0, 0),
        Vector3r(0, 0, 0),
        Quaternionr(1, 0, 0, 0),
        Quaternionr(1, 0, 0, 0),
        Vector3r(0, 0, 0));

    EXPECT_EQ(test.collate(), MeasurementVector());
}
const MagneticModel::MeasurementVector& Magnetic::getVector(const Magnetic::Update& update, const State& state) {
  y_ = Measurement_<MagneticModel>::getVector(update, state) + deviation_;
  if (getModel()->hasMagnitude()) return y_;

  double c = 1.0 / y_.norm();
  if (isinf(c)) {
    y_ = MeasurementVector(0.0);
  } else {
    y_ = y_ * c;
  }
  return y_;
}
Пример #3
0
TEST(IOBoardModelTest, SetThenClear) {
    IOBoardModel test = IOBoardModel(
        Quaternionr(1, 0, 0, 0),
        Vector3r(0, 0, 0),
        Quaternionr(1, 0, 0, 0),
        Quaternionr(1, 0, 0, 0),
        Vector3r(0, 0, 0));

    test.set_accelerometer(Vector3r(1, 2, 3));
    test.set_gyroscope(Vector3r(4, 5, 6));
    test.set_barometer_amsl(7);
    test.clear();

    EXPECT_EQ(test.collate(), MeasurementVector());
}