Skip to content

Commit

Permalink
[TEMP] Add a hack to enable this from the latest mediapose-vr release
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
bobsayshilol committed Dec 12, 2022
1 parent 358f86a commit 13472e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions driver_files/src/Driver/TrackerDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ 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));
}
Expand Down

0 comments on commit 13472e7

Please sign in to comment.