fix a chain of glove and hand-tracking bugs that render the hand-tracking state invalid at certain times

This commit is contained in:
Mamadou Babaei
2024-11-08 12:24:07 +01:00
parent 551e625c1f
commit 1e11ab6320
3 changed files with 20 additions and 3 deletions
@@ -51,7 +51,7 @@ struct SENSEGLOVESETTINGS_API FSGGloveTrackingSettings
public:
/**
* The interval in which the tracking module checks for glove connectivity.
* The interval in which the tracking module checks for glove connectivity (in milliseconds).
*
* The default is 16.666666f which means 60 times per second.
*/
@@ -58,7 +58,7 @@ struct USGGloveTracker::FImpl
{
const USGSettings* Settings{USGSettings::GetInstance()};
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
return Settings->GetTrackingSettings().GloveTrackingSettings.GloveConnectivityCheckInterval;
return Settings->GetTrackingSettings().GloveTrackingSettings.GloveConnectivityCheckInterval * 0.001f;
}
/************************
@@ -137,7 +137,16 @@ void USGGloveTracker::Initialize(FSubsystemCollectionBase& Collection)
Pimpl->GloveConnectivityCheckTimer, GloveConnectivityCheckHandler, GloveConnectivityCheckInterval,
true, -1.0f);
SGLOG("The glove connectivity check timer has been started successfully!");
if (ensureAlwaysMsgf(TimerManager.IsTimerActive(Pimpl->GloveConnectivityCheckTimer),
TEXT("GloveConnectivityCheckTimer is not active")))
{
SGLOG("The glove connectivity check timer has been started successfully!");
SGLOG("The glove connectivity timer interval is: ", GloveConnectivityCheckInterval);
}
else
{
SGLOG_ERROR("The glove connectivity check timer has failed to start!");
}
}
SGLOG("The SenseGlove tracking singleton has been successfully initialized with the world lifetime!");