chromium/services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h"

#include <cmath>

#include "base/check.h"
#include "base/numerics/math_constants.h"
#include "services/device/generic_sensor/orientation_util.h"
#include "services/device/generic_sensor/platform_sensor_fusion.h"

namespace {

// Helper function to compute the rotation matrix using gravity and geomagnetic
// data. Returns a 9 element rotation matrix:
// r[ 0]   r[ 1]   r[ 2]
// r[ 3]   r[ 4]   r[ 5]
// r[ 6]   r[ 7]   r[ 8]
// r is meaningful only when the device is not free-falling and it is not close
// to the magnetic north. If the device is accelerating, or placed into a
// strong magnetic field, the returned matricx may be inaccurate.
//
// Free fall is defined as condition when the magnitude of the gravity is less
// than 1/10 of the nominal value.
bool ComputeRotationMatrixFromGravityAndGeomagnetic(double gravity_x,
                                                    double gravity_y,
                                                    double gravity_z,
                                                    double geomagnetic_x,
                                                    double geomagnetic_y,
                                                    double geomagnetic_z,
                                                    std::vector<double>* r) {}

bool ComputeAbsoluteOrientationEulerAnglesFromGravityAndGeomagnetic(
    double gravity_x,
    double gravity_y,
    double gravity_z,
    double geomagnetic_x,
    double geomagnetic_y,
    double geomagnetic_z,
    double* alpha_in_degrees,
    double* beta_in_degrees,
    double* gamma_in_degrees) {}

}  // namespace

namespace device {

AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometer::
    AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometer()
    :{}

AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometer::
    ~AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometer() =
        default;

bool AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometer::
    GetFusedDataInternal(mojom::SensorType which_sensor_changed,
                         SensorReading* fused_reading) {}

}  // namespace device