Software Archive
Read-only legacy content
17060 Discussions

Unity Tip: Easier Two-Handed Control With RealSense

MartyG
Honored Contributor III
247 Views

Hi everyone,

If you are using both hands to control something in your RealSense project then you have likely found that control of one of the hands is prone to stalling.  This is because the right and left hands (also known by the index numbers 0 and 1) are fighting to be the hand that is currently active.  

Usually, the hand that is most visible to the camera is recognized as the active one.  For example, if your right hand is in front of your left one then the camera prioritizes the right hand, and vice versa.  This means that sometimes, the only way to have both hands active at the same time is to take advantage of the fact that it can take a few seconds for a Unity object's motion to stall after the camera loses sight of a hand, by doing a weird "air drumming" action where your two hands are constantly weaving in front and behind each other as you move them. 

However, I have found a neat technique that avoids the left and right indexes fighting with each other by creating a setup where it is impossible for the second hand to be active unless both hands are actually visible to the camera.

STEP ONE

Set your primary hand (usually the right-handed hand for most people - though I'm a leftpaw myself) to be Index 0.  I also recommend a Start rule of 'Always' or 'Hand Detected' for this hand, though your particular project needs will determine which rule is best for you yourself to use.

1.jpg

STEP TWO

Set your other hand (the '1' index hand) to use a Start rule of 'Two Hands Detected'.)

2.jpg

You should now find that your right and left-controlled objects can now move completely independently with great smoothness, with no stalling of the second hand so long as both hands are within the camera view (i.e the camera is more forgiving if the Index 1 hand is positioned behind the Index 0 hand.). 

0 Kudos
0 Replies
Reply