[Imstk-developers] high-speed thread in iMSTK

Sreekanth Arikatla sreekanth.arikatla at kitware.com
Thu Jun 8 18:23:50 EDT 2017


Please see below.

On Thu, Jun 8, 2017 at 5:42 PM, Zhaohui Xia <unihui at gmail.com> wrote:

> Hi Sreekanth,
>
>
>
> Theoretically, we can write and read force and other information to the
> haptic device via their API. Why iMSTK didn’t provide this interface?
>

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).


> 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.
>

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.

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.

>
>
> Thanks,
>
> Zhaohui
>
> *From:* Sreekanth Arikatla [mailto:sreekanth.arikatla at kitware.com]
> *Sent:* 2017年6月8日 16:17
> *To:* Zhaohui Xia <unihui at gmail.com>
> *Cc:* Andinet Enquobahrie <andinet.enqu at kitware.com>;
> imstk-developers at imstk.org
>
> *Subject:* Re: [Imstk-developers] high-speed thread in iMSTK
>
>
>
> Hi Zhaohui,
>
>                   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.
>
>
>
> Unfortunately the debug mode runs much slower. I'm not aware of any other
> way than setting the VS flags for speed
> <https://msdn.microsoft.com/en-us/library/k1ack8f1.aspx>. You may also
> try (if possible) using small mesh to debug code and run actual mesh in
> release.
>
>
>
> On Thu, Jun 8, 2017 at 3:33 PM, Zhaohui Xia <unihui at gmail.com> wrote:
>
> Hi Andinet,
>
>
>
> 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.
>
>
>
> I think there is no performance bottlenecks currently in the main thread
> under Release mode (60-70HZ), since the mesh size (1000 vertices) is not
> very big now.
>
> But under Debug mode, the speed is too slow, it is just 0.16HZ 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.
>
>
>
> Thanks,
>
> Zhaohui
>
> *From:* Andinet Enquobahrie [mailto:andinet.enqu at kitware.com]
> *Sent:* 2017年6月8日 13:29
> *To:* Zhaohui Xia <unihui at gmail.com>
> *Cc:* imstk-developers at imstk.org
> *Subject:* Re: [Imstk-developers] high-speed thread in iMSTK
>
>
>
> Zhaohui
>
>
>
> Can you profile your code and let us know the key performance bottlenecks
> in iMSTK?
>
>
>
> This is something Dr. Des is also interested. We will be exploring ways of
> accelerating some of the modules.
>
>
>
> thanks
>
> Andinet
>
>
>
>
>
>
>
> On Thu, Jun 8, 2017 at 12:40 PM, Zhaohui Xia <unihui at gmail.com> wrote:
>
> Hi All,
>
>
>
> 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.
>
> 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).
>
>
>
> Thanks,
>
> Zhaohui
>
> ------------------------------------------------------------
> -----------------------------------------------
>
> Zhaohui Xia, Ph.D.
> Postdoctoral Research Associate, Center for Modeling, Simulation and
> Imaging in Medicine (CeMSIM)
> Rensselaer Polytechnic Institute
>
>
> _______________________________________________
> Imstk-developers mailing list
> Imstk-developers at imstk.org
> http://public.kitware.com/mailman/listinfo/imstk-developers
>
>
>
>
>
> --
>
> Andinet Enquobahrie, Ph.D., MBA
> Director of Medical Computing
> Kitware, Inc.
>
> http://www.kitware.com
>
> (919) 969-6990 x311 <%28919%29%20969-6990%20x311>
>
>
>
>
>
>
> _______________________________________________
> Imstk-developers mailing list
> Imstk-developers at imstk.org
> http://public.kitware.com/mailman/listinfo/imstk-developers
>
>
>
>
>
> --
>
> Sreekanth Arikatla, Ph.D.,
>
> Senior R&D Engineer,
>
> Kitware, Inc. <http://www.kitware.com>, Carrboro, NC.
>
>
>



-- 
Sreekanth Arikatla, Ph.D.,
Senior R&D Engineer,
Kitware, Inc. <http://www.kitware.com>, Carrboro, NC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/imstk-developers/attachments/20170608/2bcad616/attachment.html>


More information about the Imstk-developers mailing list