hgjin Posted March 24, 2021 Share Posted March 24, 2021 (edited) LeapMotion is being tested using the Varjo HMD VR-2 Pro. The hand model of LeapMotion is output normally when the HMD is held and the hand is moved. On the other hand, moving or rotating the HMD causes problems. The hand model shakes as if it follows HMD's movement belatedly. During the test, I suspected that there was a problem getting the HMD's location. TestCode : [Init] varjo = static_cast<Plugins::AppVarjo*>(Engine::get()->getPluginData(Engine::get()->findPlugin("AppVarjo"))); [Update] m4Varjo_Before = m4Varjo_Current; m4Varjo_Current = (Mat4)varjo->getDevicePose(0); Vec3 CheckDist = Vec3(m4Varjo_Current.getTranslate().x - m4Varjo_Before.getTranslate().x, m4Varjo_Current.getTranslate().y - m4Varjo_Before.getTranslate().y, m4Varjo_Current.getTranslate().z - m4Varjo_Before.getTranslate().z); double dist = sqrt((CheckDist.x * CheckDist.x) + (CheckDist.y * CheckDist.y) + (CheckDist.z * CheckDist.z)); Log::message("checkDist [%f]\n\n", dist); [Result Log] 10:37:08 checkDist [0.000000] 10:37:08 10:37:08 checkDist [0.000000] 10:37:08 10:37:08 checkDist [0.000041] 10:37:08 10:37:08 checkDist [0.000645] 10:37:08 10:37:08 checkDist [0.001136] 10:37:08 10:37:08 checkDist [0.001289] 10:37:08 10:37:08 checkDist [0.002403] 10:37:08 10:37:08 checkDist [0.003544] 10:37:08 10:37:08 checkDist [0.037779] 10:37:08 10:37:08 checkDist [0.000088] 10:37:08 10:37:08 checkDist [0.000000]10:37:08 10:37:08 checkDist [0.000000]10:37:08 10:37:08 checkDist [0.000000]10:37:08 10:37:08 checkDist [0.000000] 10:37:08 10:37:08 checkDist [0.000038] 10:37:08 10:37:08 checkDist [0.000766] 10:37:08 10:37:08 checkDist [0.000760] 10:37:08 10:37:08 checkDist [0.001404] 10:37:08 10:37:08 checkDist [0.001655] 10:37:08 10:37:08 checkDist [0.001275] 10:37:08 10:37:08 checkDist [0.084758] 10:37:08 10:37:08 checkDist [0.000080] 10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:08 checkDist [0.000000]10:37:08 10:37:08 checkDist [0.000000]10:37:08 10:37:08 checkDist [0.000001] 10:37:08 10:37:08 checkDist [0.000015] 10:37:08 10:37:08 checkDist [0.000358] 10:37:08 10:37:08 checkDist [0.000675] 10:37:08 10:37:08 checkDist [0.000554] 10:37:08 10:37:08 checkDist [0.000421] 10:37:08 10:37:08 checkDist [0.000876] 10:37:08 10:37:08 checkDist [0.105317] 10:37:08 10:37:08 checkDist [0.000043] 10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:08 checkDist [0.000000]10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:08 checkDist [0.000000] 10:37:08 10:37:08 checkDist [0.000293] 10:37:08 10:37:08 checkDist [0.000145] 10:37:08 10:37:08 checkDist [0.000300] 10:37:08 10:37:08 checkDist [0.000258] 10:37:08 10:37:08 checkDist [0.000552] 10:37:08 10:37:08 checkDist [0.001274] 10:37:08 10:37:08 checkDist [0.097265] 10:37:08 10:37:08 checkDist [0.000046] 10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:08 checkDist [0.000001] 10:37:08 10:37:08 checkDist [0.000007] 10:37:08 10:37:08 checkDist [0.000514] 10:37:08 10:37:08 checkDist [0.000347] 10:37:08 10:37:08 checkDist [0.000249] 10:37:08 10:37:08 checkDist [0.000746] 10:37:08 10:37:08 checkDist [0.074681] 10:37:08 10:37:08 checkDist [0.000044] 10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:08 checkDist [0.000001]10:37:08 10:37:09 checkDist [0.000001]10:37:09 10:37:09 checkDist [0.000001] 10:37:09 10:37:09 checkDist [0.000209] 10:37:09 10:37:09 checkDist [0.000150] 10:37:09 10:37:09 checkDist [0.000953] 10:37:09 10:37:09 checkDist [0.000703] 10:37:09 10:37:09 checkDist [0.000662] 10:37:09 10:37:09 checkDist [0.049655] 10:37:09 10:37:09 checkDist [0.000077] 10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000] 10:37:09 10:37:09 checkDist [0.000362] 10:37:09 10:37:09 checkDist [0.000244] 10:37:09 10:37:09 checkDist [0.000629] 10:37:09 10:37:09 checkDist [0.001359] 10:37:09 10:37:09 checkDist [0.000935] 10:37:09 10:37:09 checkDist [0.001103] 10:37:09 10:37:09 checkDist [0.012626] 10:37:09 10:37:09 checkDist [0.000126] 10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000] 10:37:09 10:37:09 checkDist [0.000339] 10:37:09 10:37:09 checkDist [0.000481] 10:37:09 10:37:09 checkDist [0.000935] 10:37:09 10:37:09 checkDist [0.001535] 10:37:09 10:37:09 checkDist [0.002016] 10:37:09 10:37:09 checkDist [0.002850] 10:37:09 10:37:09 checkDist [0.044764] 10:37:09 10:37:09 checkDist [0.000121] 10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000] 10:37:09 10:37:09 checkDist [0.000010] 10:37:09 10:37:09 checkDist [0.000735] 10:37:09 10:37:09 checkDist [0.001028] 10:37:09 10:37:09 checkDist [0.001541] 10:37:09 10:37:09 checkDist [0.003049] 10:37:09 10:37:09 checkDist [0.091128] 10:37:09 10:37:09 checkDist [0.000118] 10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000]10:37:09 10:37:09 checkDist [0.000000] 10:37:09 10:37:09 checkDist [0.001022] 10:37:09 10:37:09 checkDist [0.000155] 10:37:09 10:37:09 checkDist [0.000783] 10:37:09 10:37:09 checkDist [0.000581] The above log content was created while the HMD was manually lifted and moved in the right direction. The HMD was moved not to stop, but Log showed that the position change was superimposed to zero and outputted. How can I solve this problem? The version of Unigine in use is 2.11. Edited March 24, 2021 by hgjin Link to comment
alexander Posted March 24, 2021 Share Posted March 24, 2021 Hi hgjin, How can I solve this problem? We don't do any custom logic in the AppVarjo::getDevicePose() method. We use the vr::IVRSystem::GetDeviceToAbsoluteTrackingPose() method to get the current device poses.I think the problem with "hand model shakes" is the execution sequence (camera position in update() and render() are two different positions).Try these modified files and rebuild the AppVarjo plugin. AppVarjo.hAppVarjo.cpp Best regards, Alexander Link to comment
silent Posted March 24, 2021 Share Posted March 24, 2021 In order to rebuild plugin you need to have Varjo SDK and %VARJOSDK% variable set. In attachment you can find all the required files to do that. varjo-sdk.zip How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
hgjin Posted March 24, 2021 Author Share Posted March 24, 2021 Thank you. I will try again with the attached files. Link to comment
hgjin Posted March 24, 2021 Author Share Posted March 24, 2021 I changed the return value of getDevicePose() function referring to the file you sent me, and it seems to be output correctly. Thank you for your quick support. If there is a problem, I will ask you an additional question. Thanks once again. 1 Link to comment
Recommended Posts