<div dir="ltr">Please see below.<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 5:42 PM, Zhaohui Xia <span dir="ltr"><<a href="mailto:unihui@gmail.com" target="_blank">unihui@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_8043964372245710452WordSection1"><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)">Hi Sreekanth,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)">Theoretically, we can write and read force and other information to the haptic device via their API. Why iMSTK didn’t provide this interface? </span></p></div></div></blockquote><div><br></div><div>The idea is to make sure we have a common interface for I/O with external devices no matter the device. In order to do this their API gets wrapped inside our interface classes (Please refer the implementation of imstkVRPNDeviceServer and imstkVRPNDeviceClient and related classes).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_8043964372245710452WordSection1"><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)">60-70HZ is not a smooth force even it is a zeroth-order hold, we need to consider the force filter in the high-speed thread.</span></p></div></div></blockquote><div><br></div><div>Yes, it won't be smooth especially if the forces are varying a lot between frames. I was trying to establish what is actually happening when you have a low frame rate simulation thread in iMSTK. </div><div><br></div><div>The force filter depends on the application, so if you want to implement a custom filter for your application, one needs to add the feature to supply the custom filter to the device callback. Please feel free to implement this feature or we can help you with this if needed.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_8043964372245710452WordSection1"><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"\005fae\008f6f\0096c5\009ed1 Light",sans-serif;color:rgb(31,73,125)">Zhaohui<u></u><u></u></span></p><p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> Sreekanth Arikatla [mailto:<a href="mailto:sreekanth.arikatla@kitware.com" target="_blank">sreekanth.arikatla@<wbr>kitware.com</a>] <br><b>Sent:</b> 2017</span><span lang="ZH-CN" style="font-size:11pt;font-family:微软雅黑,sans-serif">年</span><span style="font-size:11pt;font-family:Calibri,sans-serif">6</span><span lang="ZH-CN" style="font-size:11pt;font-family:微软雅黑,sans-serif">月</span><span style="font-size:11pt;font-family:Calibri,sans-serif">8</span><span lang="ZH-CN" style="font-size:11pt;font-family:微软雅黑,sans-serif">日</span><span style="font-size:11pt;font-family:Calibri,sans-serif"> 16:17<br><b>To:</b> Zhaohui Xia <<a href="mailto:unihui@gmail.com" target="_blank">unihui@gmail.com</a>><br><b>Cc:</b> Andinet Enquobahrie <<a href="mailto:andinet.enqu@kitware.com" target="_blank">andinet.enqu@kitware.com</a>>; <a href="mailto:imstk-developers@imstk.org" target="_blank">imstk-developers@imstk.org</a></span></p><div><div class="gmail-h5"><br><b>Subject:</b> Re: [Imstk-developers] high-speed thread in iMSTK<u></u><u></u></div></div><p></p><div><div class="gmail-h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi Zhaohui,<u></u><u></u></p><div><p class="MsoNormal"> I'm guessing you are using phantom omni. If so yes, it has its own servo thread that starts after hdStartScheduler() call. Its rate is much higher and can be set with hdSetSchedulerRate() but is left to the default value in iMSTK. The forces are still updated at 60-70 Hz but applied in zeroth-order hold fashion.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Unfortunately the debug mode runs much slower. I'm not aware of any other way than setting the VS flags for <a href="https://msdn.microsoft.com/en-us/library/k1ack8f1.aspx" target="_blank">speed</a>. You may also try (if possible) using small mesh to debug code and run actual mesh in release. <u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Thu, Jun 8, 2017 at 3:33 PM, Zhaohui Xia <<a href="mailto:unihui@gmail.com" target="_blank">unihui@gmail.com</a>> wrote:<u></u><u></u></p><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt"><div><div><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">Hi Andinet,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">I am afraid I made a mistake. The device thread is definitely a high-speed thread. I figure out the issue, because I forget to close something when I change the code in that thread.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">I think there is no performance bottlenecks currently in the main thread under </span><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:red">Release </span><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">mode (60-70HZ), since the mesh size (1000 vertices) is not very big now.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">But under </span><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:red">Debug </span><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">mode, the speed is too slow, it is just </span><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:red">0.16HZ </span><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">for the same mesh. Do we have any ways to improve it, e.g. changing some settings? It would be very helpful for work if it can run faster.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">Thanks,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft JhengHei Light",sans-serif;color:rgb(31,73,125)">Zhaohui</span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> Andinet Enquobahrie [mailto:</span><a href="mailto:andinet.enqu@kitware.com" target="_blank"><span style="font-size:11pt;font-family:Calibri,sans-serif">andinet.enqu@kitware.<wbr>com</span></a><span style="font-size:11pt;font-family:Calibri,sans-serif">] <br><b>Sent:</b> 2017</span><span lang="ZH-CN" style="font-size:11pt;font-family:等线">年</span><span style="font-size:11pt;font-family:Calibri,sans-serif">6</span><span lang="ZH-CN" style="font-size:11pt;font-family:等线">月</span><span style="font-size:11pt;font-family:Calibri,sans-serif">8</span><span lang="ZH-CN" style="font-size:11pt;font-family:等线">日</span><span style="font-size:11pt;font-family:Calibri,sans-serif"> 13:29<br><b>To:</b> Zhaohui Xia <</span><a href="mailto:unihui@gmail.com" target="_blank"><span style="font-size:11pt;font-family:Calibri,sans-serif">unihui@gmail.com</span></a><span style="font-size:11pt;font-family:Calibri,sans-serif">><br><b>Cc:</b> </span><a href="mailto:imstk-developers@imstk.org" target="_blank"><span style="font-size:11pt;font-family:Calibri,sans-serif">imstk-developers@imstk.org</span></a><span style="font-size:11pt;font-family:Calibri,sans-serif"><br><b>Subject:</b> Re: [Imstk-developers] high-speed thread in iMSTK</span><u></u><u></u></p><div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Zhaohui<u></u><u></u></p><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Can you profile your code and let us know the key performance bottlenecks in iMSTK?<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">This is something Dr. Des is also interested. We will be exploring ways of accelerating some of the modules.<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">thanks<u></u><u></u></p></div><div><p class="MsoNormal">Andinet<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">On Thu, Jun 8, 2017 at 12:40 PM, Zhaohui Xia <<a href="mailto:unihui@gmail.com" target="_blank">unihui@gmail.com</a>> wrote:<u></u><u></u></p><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt"><div><div><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif">Hi All,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif">Do we have a high-speed thread (e.g. 1000HZ) in iMSTK? I tried different modules e.g VRPNDeviceServer (device) and SceneMange (main thread), but the maximum frame rates of them are 60-70HZ under Release mode.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif">I also tried to set the Loopdelay to 0.001 or smaller (from my understand, its default value is 0 should have the fastest speed, but it also 60-70HZ).</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif">Thanks,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei UI",sans-serif">Zhaohui</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:Verdana,sans-serif;color:rgb(59,56,56);background:white">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----------------</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Microsoft YaHei Light";background:white">Zhaohui Xia, Ph.D.</span><span style="font-family:"Microsoft YaHei Light""><br><span style="background:white">Postdoctoral Research Associate, Center for Modeling, Simulation and Imaging in Medicine (CeMSIM)</span><br><span style="background:white">Rensselaer Polytechnic Institute</span></span><u></u><u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12pt"><br>______________________________<wbr>_________________<br>Imstk-developers mailing list<br><a href="mailto:Imstk-developers@imstk.org" target="_blank">Imstk-developers@imstk.org</a><br><a href="http://public.kitware.com/mailman/listinfo/imstk-developers" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/imstk-<wbr>developers</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div><div><div><div><div><div><div><div><p class="MsoNormal">Andinet Enquobahrie, Ph.D., MBA<br>Director of Medical Computing<br>Kitware, Inc.<br><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><u></u><u></u></p></div><div><p class="MsoNormal"><a href="tel:%28919%29%20969-6990%20x311" target="_blank"><span style="font-size:9.5pt;color:rgb(17,85,204)">(919) 969-6990 x311</span></a><u></u><u></u></p></div><div><div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt"><div><p class="MsoNormal"><span style="font-size:9.5pt"> </span><u></u><u></u></p></div></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal" style="margin-bottom:12pt"><br>______________________________<wbr>_________________<br>Imstk-developers mailing list<br><a href="mailto:Imstk-developers@imstk.org" target="_blank">Imstk-developers@imstk.org</a><br><a href="http://public.kitware.com/mailman/listinfo/imstk-developers" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/imstk-<wbr>developers</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div><div><div><div><div><div><div><div><div><div><div><div><div><div><p class="MsoNormal">Sreekanth Arikatla, Ph.D.,<u></u><u></u></p></div><div><p class="MsoNormal">Senior R&D Engineer,<u></u><u></u></p></div><div><p class="MsoNormal"><a href="http://www.kitware.com" target="_blank"><span style="font-size:9.5pt">Kitware, Inc.</span></a>, Carrboro, NC.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Sreekanth Arikatla, Ph.D.,</div><div dir="ltr">Senior R&D Engineer,</div><div dir="ltr"><a href="http://www.kitware.com" style="font-size:12.8px" target="_blank">Kitware, Inc.</a>, Carrboro, NC.<div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>