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

Commit f0a0ad0f 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

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

Change-Id: Ibf702cbc43c69467ad23c628a1864e38527a1c4d
parents 9d7f9946 54f07586
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>());
            }