#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 {
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) { … }
}
OrientationEulerAnglesFusionAlgorithmUsingQuaternion::
OrientationEulerAnglesFusionAlgorithmUsingQuaternion(bool absolute)
: … { … }
OrientationEulerAnglesFusionAlgorithmUsingQuaternion::
~OrientationEulerAnglesFusionAlgorithmUsingQuaternion() = default;
bool OrientationEulerAnglesFusionAlgorithmUsingQuaternion::GetFusedDataInternal(
mojom::SensorType which_sensor_changed,
SensorReading* fused_reading) { … }
}