Home › Forum › SOFA › Using SOFA › [SOLVED] Forces not getting rendered with Geomagic touch.
- This topic has 6 replies, 3 voices, and was last updated 4 years, 1 month ago by Singh.
-
AuthorPosts
-
14 July 2020 at 06:30 #16870SinghBlocked
Hello,
I am using Geomagic Touch on Windows 10, Visual Studio 2017, SOFA v20.06
I tried experimenting with the scene files available in src\applications\plugins\Geomagic\scenes
Below is the log when I load one such scene.[INFO] [runSofa] PluginRepository paths = C:/open_prj/sofa/build/v2006/plugins;C:/open_prj/sofa/build/v2006/bin/Release [INFO] [runSofa] DataRepository paths = C:/open_prj/sofa/src/share;C:/open_prj/sofa/src/examples [INFO] [runSofa] GuiDataRepository paths = C:/open_prj/sofa/src/applications/projects/runSofa/resources;C:/open_prj/sofa/src/modules/SofaGuiQt/src/sofa/gui/qt/resources [INFO] [runSofa] Loading automatically plugin list in C:\open_prj\sofa\build\v2006\applications\projects\runSofa/plugin_list.conf.default [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaSparseSolver.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaPreconditioner.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaHaptics.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaValidation.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaDenseSolver.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaNonUniformFem.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaOpenglVisual.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaExporter.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/CImgPlugin.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/SofaMiscCollision.dll [INFO] [PluginManager] Loaded plugin: C:/open_prj/sofa/build/v2006/bin/Release/Geomagic.dll Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing. The constructor with a QGLFormat is deprecated, use the regular contructor instead. [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias] [INFO] [SceneCheckerVisitor] Finished validating node "root". [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias] [INFO] [SceneCheckerVisitor] Finished validating node "root". **************************************** This is the DEVELOPER EDITION of OPENHAPTICS, commercial distribution is prohibited Please contact 3D Systems to obtain a commercial license **************************************** [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias] [INFO] [SceneCheckerVisitor] Finished validating node "root". **************************************** This is the DEVELOPER EDITION of OPENHAPTICS, commercial distribution is prohibited Please contact 3D Systems to obtain a commercial license ****************************************
I observe that although the tool moves according to the haptic device orientation, there is no force rendered. I verified with the demo application that comes with the Geomagic touch, they all are working fine i.e. I can feel the forces.
Any idea what could be the issue?18 July 2020 at 13:33 #16900SinghBlockedHello,
I added a log to check the forces rendered:
--- a/applications/plugins/Geomagic/src/Geomagic/GeomagicDriver.cpp +++ b/applications/plugins/Geomagic/src/Geomagic/GeomagicDriver.cpp @@ -144,6 +144,8 @@ HDCallbackCode HDCALLBACK stateCallback(void * userData) omni_force[1] = force_in_omni[1]; omni_force[2] = force_in_omni[2]; + std::cout << omni_force[0] << " " << omni_force[1] << " " << omni_force[2] << std::endl; + hdSetDoublev(HD_CURRENT_FORCE, omni_force);
Here are my findings:
1. For Geomagic-RigidCubes.scn
I could see the force vector reaching these values:0.965372 -0.0650974 0.274407 0.966204 -0.0645502 0.2723 0.966221 -0.0645658 0.272316 0.965388 -0.0651183 0.274447
Observation: I can feel the forces, however very less as compared to rigid body interaction with the Touch demo application.
2. For Geomagic-FEMLiver.scn were coming of the order:
0.0168471 0.0168061 0.0109535 0.0169753 0.0167133 0.0110079 0.0169876 0.0166903 0.011016 0.0169876 0.0166903 0.011016 0.0169876 0.0166903 0.011016 0.0169876 0.0166903 0.011016 0.0170215 0.0166911 0.0110239 0.0170215 0.0166911 0.0110239
Observation: I could hardly perceive forces, however the liver deformation happens.
3. For Geomagic-RigidSkull
-0.0320186 0.0520094 0.0841243 -0.0317458 0.05224 0.0840578 -0.0318995 0.0520695 0.0841263 -0.0320336 0.0519236 0.0841948 -0.0321138 0.051894 0.0841844 -0.0320637 0.0519552 0.084153 -0.03201 0.0520199 0.084121 -0.0319648 0.0520749 0.0840929 -0.0317474 0.052238 0.0840595 -0.0319021 0.0520664 0.0841284 -0.0320369 0.0519196 0.0841974 -0.0321115 0.0518953 0.0841864 -0.0320597 0.0519587 0.084154
Observation: I could perceive very faint forces.
Overall observation, if we uncheck the Animate button, the forces still keep rendering. As seen from the log values.
Since I had been interacting with the FEM Liver scene, and assumed that checking Animate button would compute forces and unchecking would stop, and I could hardly perceive any forces, I wrongly concluded that there is an issue with force rendering.However, I must say the force rendering is very faint as compared to the earlier version of Geomagic Plugin.
I would like to know how can one tune the forces being rendered so that it feels realistic.
20 July 2020 at 04:01 #16903SinghBlockedHello,
I added the same log to check the forces rendered in v19.06:
Here are my findings:
1. For Geomagic-RigidCubes.scn
– this scene is not present in v19.062. For Geomagic-FEMLiver.scn were coming of the order:
-0.352481 0.592706 0.539582 -0.352481 0.592706 0.539582 -0.354577 0.591537 0.535375 -0.357102 0.593033 0.537134 -0.356612 0.593141 0.536671 -0.356832 0.595202 0.539216 -0.356832 0.595202 0.539216
Observation: I could very well feel forces. And are much more in magnitude as compared to the v20.06. Consequently, the tool does not penetrate very easily into the liver object.
3. For Geomagic-RigidSkull
1.17827 1.10191 0.265511 1.18029 1.1175 0.265051 1.18029 1.1175 0.265051 1.18029 1.1175 0.265051 1.17963 1.1175 0.264865 1.17528 1.12405 0.263256
Observation: Forces do feel that as if I am interacting with a rigid object, the force vector magnitude is also much more than as observed with v20.06.
Overall: There is s remarkable difference in forces for a same scene between v20.06 and v19.06
20 July 2020 at 15:28 #16909epernodBlockedHi @Singh,
you are right, the force is working but is very small. A change of behavior has been introduced in the last release. We will correct it in the incoming week.
In the mean time, to recover the good behavior of the v19.06, in the .scn files you are using, for example “Geomagic-RigidCubes.scn” change all line:
<UncoupledConstraintCorrection/>
by
<UncoupledConstraintCorrection useOdeSolverIntegrationFactors="0"/>
Let me know if it works fine
Erik
22 July 2020 at 13:27 #16936HugoKeymasterHey @sukhraj
could you test instead changing the factor (keep it
useOdeSolverIntegrationFactors=1
), to rather change the data forceCoef in LCPForceFeedback to scale the force, likeforceCoef=0.01
?Hugo
7 September 2020 at 06:41 #17087SinghBlocked@hugo I checked the recent changes in the master, looks like the commit: https://github.com/sofa-framework/sofa/commit/55b1773abd2d0e380af794777d93ee7d8856b8f2#diff-135e5cfaf3fe28cc7d7e060995d54f1a
by @epernod does the same as you say in your comments. I think then we can topic as resolved.
I have not tested it as of now.P.S. Please excuse for a long delay in my reply, I had a bike accident that left me unable to work with a pc. Just started working this week.
20 September 2020 at 12:39 #17188 -
AuthorPosts
- You must be logged in to reply to this topic.