About Simulating Haptic Feedback in VR

Hi, thank you for providing such an amazing tool.

My question is about the implementation of the haptic feedback and how it is internally handled. applyForce, which is mentioned in the Docs/devices.md seems to handle the intensity, however I could not find how the passed in amount is calculated.

I am primarily using imstk-unity and my goal is to simulate haptic feedback through regular VR controllers. I am currently superimposing the handheld tool onto the VR controller via the UnityDrivenDevice and would like to manually pass the (calculated) haptic feedback intensity to the controllers.

Can you show any directions in this regard?
Thanks in advance.

The RigidController is the component responsible for generating the actual force that is being rendered on the device. The Controller implements a Virtual Tool Coupler, that is a mass-spring system that sits between the virtual tool (the simulated rigid body) and the users tool position in the physical world. The spring parameters that you edit in the RigidToolController in unity are the parameters of that spring.

The main driver for the is the difference of the virtual tool position and the physical device position. For example, the user pushes the virtual device into tissue, the system detects this collision, moves the two colliding objects apart, this effectively creates a difference in the virtual and physical position, this difference is taken up by the spring and that spring force is rendered on the device. The imstk docs have a section on Virtual coupling

Thank you for responding so promptly. This really helped me get on the right track.