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

Commit 06f0ee41 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7736437 from 879f0910 to sc-v2-release

Change-Id: I8b69e3dd480dd7847f58cfddbdeca06c24337d0c
parents 852dac2c 879f0910
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ cc_binary {
        "libheadtracking",
        "libheadtracking-binding",
        "libsensor",
        "libutils",
    ],
}

+8 −1
Original line number Diff line number Diff line
@@ -19,9 +19,11 @@

#include <android/sensor.h>
#include <hardware/sensors.h>
#include <utils/SystemClock.h>

#include <media/SensorPoseProvider.h>

using android::elapsedRealtimeNano;
using android::media::Pose3f;
using android::media::SensorPoseProvider;
using android::media::Twist3f;
@@ -32,7 +34,12 @@ class Listener : public SensorPoseProvider::Listener {
  public:
    void onPose(int64_t timestamp, int32_t handle, const Pose3f& pose,
                const std::optional<Twist3f>& twist) override {
        std::cout << "onPose t=" << timestamp << " sensor=" << handle << " pose=" << pose
        int64_t now = elapsedRealtimeNano();

        std::cout << "onPose t=" << timestamp
                  << " lag=" << ((now - timestamp) / 1e6) << "[ms]"
                  << " sensor=" << handle
                  << " pose=" << pose
                  << " twist=";
        if (twist.has_value()) {
            std::cout << twist.value();