chromium/services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion.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/orientation_euler_angles_fusion_algorithm_using_quaternion.h"

#include <cmath>

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

namespace device {

namespace {

// Helper function to convert a quaternion to a rotation matrix. x, y, z, w
// are values of a quaternion representing the orientation of the device in
// 3D space. Returns a 9 element rotation matrix:
// r[ 0]   r[ 1]   r[ 2]
// r[ 3]   r[ 4]   r[ 5]
// r[ 6]   r[ 7]   r[ 8]
std::vector<double> ComputeRotationMatrixFromQuaternion(double x,
                                                        double y,
                                                        double z,
                                                        double w) {}

void ComputeEulerAnglesFromQuaternion(double x,
                                      double y,
                                      double z,
                                      double w,
                                      double* alpha_in_degrees,
                                      double* beta_in_degrees,
                                      double* gamma_in_degrees) {}

constexpr mojom::SensorType GetEulerAngleFusedType(bool absolute) {}

constexpr mojom::SensorType GetQuaternionSourceType(bool absolute) {}

}  // namespace

OrientationEulerAnglesFusionAlgorithmUsingQuaternion::
    OrientationEulerAnglesFusionAlgorithmUsingQuaternion(bool absolute)
    :{}

OrientationEulerAnglesFusionAlgorithmUsingQuaternion::
    ~OrientationEulerAnglesFusionAlgorithmUsingQuaternion() = default;

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

}  // namespace device