Loading media/libheadtracking/include/media/Twist.h +10 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,16 @@ class Twist3f { mRotationalVelocity.isApprox(other.mRotationalVelocity, prec); } template<typename T> Twist3f operator*(const T& s) const { return Twist3f(mTranslationalVelocity * s, mRotationalVelocity * s); } template<typename T> Twist3f operator/(const T& s) const { return Twist3f(mTranslationalVelocity / s, mRotationalVelocity / s); } private: Eigen::Vector3f mTranslationalVelocity; Eigen::Vector3f mRotationalVelocity; Loading services/audiopolicy/service/SpatializerPoseController.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ constexpr float kMaxRotationalVelocity = 8; // twist (velocity). It should be set to a value that matches the characteristic durations of moving // one's head. The higher we set this, the more latency we are able to reduce, but setting this too // high will result in high prediction errors whenever the head accelerates (changes velocity). constexpr auto kPredictionDuration = 10ms; constexpr auto kPredictionDuration = 50ms; // After losing this many consecutive samples from either sensor, we would treat the measurement as // stale; Loading Loading @@ -236,7 +236,8 @@ void SpatializerPoseController::onPose(int64_t timestamp, int32_t sensor, const const std::optional<Twist3f>& twist, bool isNewReference) { std::lock_guard lock(mMutex); if (sensor == mHeadSensor) { mProcessor->setWorldToHeadPose(timestamp, pose, twist.value_or(Twist3f())); mProcessor->setWorldToHeadPose(timestamp, pose, twist.value_or(Twist3f()) / kTicksPerSecond); if (isNewReference) { mProcessor->recenter(true, false); } Loading Loading
media/libheadtracking/include/media/Twist.h +10 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,16 @@ class Twist3f { mRotationalVelocity.isApprox(other.mRotationalVelocity, prec); } template<typename T> Twist3f operator*(const T& s) const { return Twist3f(mTranslationalVelocity * s, mRotationalVelocity * s); } template<typename T> Twist3f operator/(const T& s) const { return Twist3f(mTranslationalVelocity / s, mRotationalVelocity / s); } private: Eigen::Vector3f mTranslationalVelocity; Eigen::Vector3f mRotationalVelocity; Loading
services/audiopolicy/service/SpatializerPoseController.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ constexpr float kMaxRotationalVelocity = 8; // twist (velocity). It should be set to a value that matches the characteristic durations of moving // one's head. The higher we set this, the more latency we are able to reduce, but setting this too // high will result in high prediction errors whenever the head accelerates (changes velocity). constexpr auto kPredictionDuration = 10ms; constexpr auto kPredictionDuration = 50ms; // After losing this many consecutive samples from either sensor, we would treat the measurement as // stale; Loading Loading @@ -236,7 +236,8 @@ void SpatializerPoseController::onPose(int64_t timestamp, int32_t sensor, const const std::optional<Twist3f>& twist, bool isNewReference) { std::lock_guard lock(mMutex); if (sensor == mHeadSensor) { mProcessor->setWorldToHeadPose(timestamp, pose, twist.value_or(Twist3f())); mProcessor->setWorldToHeadPose(timestamp, pose, twist.value_or(Twist3f()) / kTicksPerSecond); if (isNewReference) { mProcessor->recenter(true, false); } Loading