From 754ba4f6e128fb68b47f052422323b41f033f4a0 Mon Sep 17 00:00:00 2001 From: dime-online Date: Sun, 27 Sep 2026 07:17:54 -0400 Subject: [PATCH] driver: fix inverted interpolation factor in history::get_at interpolate(before, after, t) expects t = 0 at the before sample and t = 1 at the after sample (see hand_joints_list.cpp: radius = a.radius * (1 - t) + b.radius * t, and monado's m_space_relation_interpolate which lerps from the predecessor with the elapsed fraction). The factor was computed as (after - now) / (after - before), which is 1 - t: querying at the before timestamp returned the after sample, querying at the after timestamp returned the before sample, and queries in between returned the pose mirrored about the segment midpoint. Compute t from the before sample so hand and body skeleton queries between two tracking samples interpolate along the motion instead of against it. --- server/driver/history.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/driver/history.h b/server/driver/history.h index 3a7b20f9..ddf78edf 100644 --- a/server/driver/history.h +++ b/server/driver/history.h @@ -103,7 +103,7 @@ public: if (before and after) { - float t = float(after->at_timestamp_ns - at_timestamp_ns) / + float t = float(at_timestamp_ns - before->at_timestamp_ns) / (after->at_timestamp_ns - before->at_timestamp_ns); return {produced, static_cast(this)->interpolate(*before, *after, t)}; }