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 13, 2022
1 parent c9e6605 commit a470ec1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions driver_files/src/Driver/TrackerDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a470ec1

Please sign in to comment.