From 3871c6041dfc658bacfee80420b9bd5e50dfeec2 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 7 Mar 2024 18:10:37 +0100 Subject: [PATCH] Enable pose extrapolation --- server/driver/pose_list.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/server/driver/pose_list.cpp b/server/driver/pose_list.cpp index 5ae24b31..4c240b1e 100644 --- a/server/driver/pose_list.cpp +++ b/server/driver/pose_list.cpp @@ -18,13 +18,11 @@ */ #include "pose_list.h" -#include "math/m_eigen_interop.hpp" #include "math/m_space.h" #include "math/m_vec3.h" #include "xrt/xrt_defines.h" #include "xrt_cast.h" -using namespace xrt::auxiliary::math; using namespace xrt::drivers::wivrn; xrt_space_relation pose_list::interpolate(const xrt_space_relation & a, const xrt_space_relation & b, float t) @@ -40,28 +38,14 @@ xrt_space_relation pose_list::extrapolate(const xrt_space_relation & a, const xr if (t < ta) return a; - if (t > tb) - return b; - - float h = (tb - ta) / 1.e9; - - xrt_space_relation res; - res.relation_flags = b.relation_flags; + xrt_space_relation res = b; float dt = (t - tb) / 1.e9; // if (dt > 0.2) // dt = 0.2; // saturate dt to 200ms - res.linear_velocity = b.linear_velocity; res.pose.position = b.pose.position + b.linear_velocity * dt; - res.angular_velocity = b.angular_velocity; - xrt_vec3 dtheta = b.angular_velocity * dt; - xrt_quat dq; - math_quat_exp(&dtheta, &dq); - - map_quat(res.pose.orientation) = map_quat(b.pose.orientation) * map_quat(dq); - return res; }