Running haptic thread in unity scene at 1000HZ

Hello,

I am currently working on a medical simulation scenario in Unity3D (version 2021.3.21) that incorporates haptic feedback using the Touch Haptic Device (Phantom Omni). I am utilizing the OpenHaptics plugin for Unity to achieve this functionality. Although I have successfully connected the haptic device to Unity and can manipulate it within the scene, I have encountered an issue where the feedback does not feel smooth and instead feels jerky when I apply forces to the haptic device.

Currently, the haptic device is represented as a rigid body, and forces are applied using the RigidBody.AddForce() function that runs within the FixedUpdate() method.

I am interested in exploring options to potentially run the haptic code in a separate thread to ensure that it runs at a consistent rate of 1000Hz, thereby providing real-time feedback.

I would greatly appreciate any suggestions or guidance on how to achieve this smoother haptic feedback experience.

Thank you for your assistance.

Unity isn’t suitable for that kind off application.

There is tons of things which can iterupt and distort results on such high frequencies.

If you want real time data, you want to build, aquire real time monitoring hardware. Perhaps even arduino could be suitable for that. Then captured signal can be compressed and smoothed out, then sent approximation to Unity for visualisation.

Mind that Unity predominantly is a Game engine. Not a medical device.

You can also try to checkout robotic sub forum, for any directions.

Please don’t cross-post: Run haptic feedback script at 1000Hz in a separate thread within unity

As its description mentions, General Discussion is not a support forum. Please use the dedicated support forums.

Thanks.