Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f64fb62 authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi Committed by Automerger Merge Worker
Browse files

Convert between sensor framework and head tracking frames am: 54f07586 am: f0a0ad0f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15821546

Change-Id: Ice791cca6694faff6681036041235278556a71c3
parents 78b6cf84 f0a0ad0f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -21,13 +21,14 @@
#include <inttypes.h>

#include <future>
#include <iostream>
#include <map>
#include <thread>

#include <android/looper.h>
#include <log/log_main.h>

#include "QuaternionUtil.h"

namespace android {
namespace media {
namespace {
@@ -217,6 +218,8 @@ class SensorPoseProviderImpl : public SensorPoseProvider {
            case ASENSOR_TYPE_ROTATION_VECTOR:
            case ASENSOR_TYPE_GAME_ROTATION_VECTOR: {
                Eigen::Quaternionf quat(event.data[3], event.data[0], event.data[1], event.data[2]);
                // Adapt to different frame convention.
                quat *= rotateX(-M_PI_2);
                return std::make_tuple(Pose3f(quat), std::optional<Twist3f>());
            }