Unity Hand Calibration

Your Nova Glove needs to know which cable extensions correspond to your finger movements - which is different for each user. To avoid any grotesque movements, you’ll need to move each sensor a little bit before the hand begins to animate.

Is your hand not moving in your Android build? It’s most likely because you haven’t included any calibration options.

Note

We’re aware this calibration setup is less than ideal, and are in the process of refactoring it for Nova Gloves. Check back here later for updates.

Use the ‘Calibration Layer’ on the blue hands

The Calibration Layer, or more specifcially, the SG_CalibrationSequence script, of our blue hand prefabs contains logic to calibrate our gloves through the SG_HapticGlove script.

When calibration is activated, the hand’s color will change to indicate calibration is active, and a small bit of text is placed under the wrist. The fingers of the hand(s) will cease to move until all sensors have moved a little bit. After they do, the algorithm will continue to collect calibration data until 10 seconds have passed. Calibration will automatically complete, and you’re good to go!

Manual Activation

Calling the StartCalibration() function of the SG_CalibrationSequence, you can manually activate calibration of the hand. You can access an SG_TrackedHand’s calibration script through the .calibration property; e.g. myHand.calibration.StartCalibration();.

Automatic Activation

You can automatically activate calibration when loading into a scene, by setting the checkCalibrationOnConnect variable to true, either through code or through the inspector:

../_images/integratedCalibration.png

Tip

You should not use this option when you’re using the Calibration Void option - to avoid doubling up the calibration. It’s enough to enable this option in the first scene you load into. Provided the fingers begin to move, you should be able to continue on to the next scene without needing to calibrate again.

Add the ‘Calibration Void’ as your first Scene

The ‘Calibration Void’ is a standard scene included in your Unity Plugin, located in SenseGlove/Calibration. It comes in two variations; one for 2D applications ( CalibrationVoid ) and one for XR applications ( CalibrationVoid_XR ) . It uses a logic script, SG_CalibrationVoid, to start and end calibration through the :code:`SG_CalibrationSequence`s described above.

../_images/calibrationVoid.png

This scene wil ‘lock’ your user into a dedicated void with instructions that follow their gaze, and example hands that demonstrate a series movements to make for calibration. If their hands have moved enough, they can confirm calibration by giving a ‘thumbs up’ gesture, after which they can (automatically) pass on to the next scene.

Setting this as the ‘Staring Scene’ (Build Index 0) of your build will ensure your user is properly calibrated before the simulation can begin.

Automatic Transition

Using the changeSceneAfter, goToSceneIndex and goToSceneName parameters, you can have the SG_CalibrationVoid script automatically transition to your main scene. The Calibration Void will load this next scene in the background once the first glove is detected, so once calibration is complete, this transition can be instant.

  • changeSceneAfter: If this value is < 0, the CalibrationVoid will not proceed to any next scene.

  • goToSceneName: The name of the scene to load, via UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(string sceneName);. If this value is an empty string, the algorithm will look to goToSceneIndex: for the next scene.

  • goToSceneIndex: The Build Index of the next scene to load, via UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(int sceneBuildIndex);. If this value is < 0, the CalibrationVoid will not proceed to any next scene.

The CalibrationVoid script has a CalibrationCompleted event, which fires once the algorithm completed. You can hook into this event to call your own scene transitions.

Use SenseCom’s built-in Calibration

When SenseCom discovers a new connection to a Nova Glove, a ‘Calibrate’ Button appears on the top menu. Pressing this button will allow you to (re)calibrate your Nova Glove. If you have ‘Automatic Calibration’ enabled in SenseCom’s Settings Menu, it will start the Calibration process once your first glove connects.

../_images/SC_calibration1.png

This process runs in the background, and can be completed without ever looking to SenseCom. However, a new profile is only loaded when the focus returns to your Unity Applications. Alternatively, you can force a reload of the calibration profiles by calling SG_HandProfiles.TryLoadFromDisk(); on the SG_HandProfiles script when you deem it necessary.

Note

This step is only useful when your demo is running on Windows or Linux. On Android, we cannot easily access files from a shared directory without extensive permissions. As such, Calibration on Android is only stored inside the App’s folder.