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.
This commit is contained in:
dime-online
2026-09-27 19:17:06 +02:00
committed by xytovl
parent 8e3fd29c94
commit 754ba4f6e1
+1 -1
View File
@@ -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<Derived *>(this)->interpolate(*before, *after, t)};
}