From a470ec1ca14a147c1ce28a645f9b385fe18ac8bb Mon Sep 17 00:00:00 2001 From: bobsayshilol Date: Mon, 12 Dec 2022 20:14:47 +0000 Subject: [PATCH] [TEMP] Add a hack to enable this from the latest mediapose-vr release Setting a -ve "additional smoothing" will enable the velocity based tracking and >1 will disable it again, and this will persist until you change it to a value outside of [0,1). --- driver_files/src/Driver/TrackerDevice.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/driver_files/src/Driver/TrackerDevice.cpp b/driver_files/src/Driver/TrackerDevice.cpp index bc856fba..6aebe990 100644 --- a/driver_files/src/Driver/TrackerDevice.cpp +++ b/driver_files/src/Driver/TrackerDevice.cpp @@ -37,18 +37,21 @@ void ExampleDriver::TrackerDevice::reinit(int msaved, double mtime, double msmoo if (msaved < 5) //prevent having too few values to calculate linear interpolation, and prevent crash on 0 msaved = 5; - if (msmooth < 0) + if (msmooth < 0) { msmooth = 0; - else if (msmooth > 0.99) + use_velocity = true; + } else if (msmooth > 0.99) { msmooth = 0.99; + use_velocity = false; + } prev_positions.clear(); prev_positions.resize(msaved); max_time = mtime; smoothing = msmooth; - use_velocity = velocity; + //use_velocity = velocity; - Log("Settings changed! " + std::to_string(msaved) + ' ' + std::to_string(mtime) + ' ' + std::to_string(msmooth) + ' ' + std::to_string(velocity)); + Log("Settings changed! " + std::to_string(msaved) + ' ' + std::to_string(mtime) + ' ' + std::to_string(msmooth) + ' ' + std::to_string(use_velocity)); } void ExampleDriver::TrackerDevice::Update()