Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with InteractionManager and Head Rotation #1900

Closed
Hobl1990 opened this issue Mar 31, 2018 · 8 comments
Closed

Problem with InteractionManager and Head Rotation #1900

Hobl1990 opened this issue Mar 31, 2018 · 8 comments
Labels
No Repro The developer couldn’t reproduce the bug

Comments

@Hobl1990
Copy link

Overview

I want to interact with an object with the help of the Interaction Manager. Therefore I used the following example: http://www.appzinside.com/2017/02/27/moving-holographic-objects-by-hand-using-the-hololens/

Expected Behavior

TryGetPosition(out handpos) returns coordinates of the hand. The "CursorWithFeedback" prefab will be mapped to this coordinates.

Actual Behavior

The mapping works great but when I go around an object use the gesture, it will be recognized but I can't see the mapped prefab. I attached two pictures. On both pictures the scene in the hololens emulator and the 3d view are mentioned. Furthermore the position of the hand is displayed in the debug log of visual studio. I used

orig_manipulation

The first picture shows that the gesture is in the recognition frame and also displayed in the scene.

rotated_manipulation

The second picture shows the scene after a head rotation. The gesture is detected in the frame but doesn't show in the scene.

@david-c-kline
Copy link

@Hobl1990, What version / branch of MRTK are you using? Thanks!

@Hobl1990
Copy link
Author

@davidkline-ms, I use the Version from 28th December 2017.

@david-c-kline
Copy link

Thanks for the update!

@david-c-kline
Copy link

@Hobl1990,
We are having a difficult time reproducing your issue. Would you be able to post the contents of the script you are using in your example? This will enable us to test exactly what you are running.

Thanks!

@david-c-kline david-c-kline added the No Repro The developer couldn’t reproduce the bug label May 23, 2018
@david-c-kline
Copy link

@Hobl1990,
One other question, i noticed that you posted emulator screen shots. How are you rotating the head in the emulator (which controls, modifier keys, etc). That will help us better understand the issue.

Thanks!

@Hobl1990
Copy link
Author

Hobl1990 commented Jun 14, 2018

Hi @davidkline-ms ,
I used this code for the interactionmanager events:

#region Interaction Source Detected Event, will be called when a registered gesture will be detected for the first time 
    private void InteractionManager_InteractionSourceDetected(InteractionSourceDetectedEventArgs obj)
    {
        if (obj.state.source.kind == InteractionSourceKind.Hand) //Check if the detected object is a hand
        {
            gesture_status.text = "Hand detected";
            ready.gameObject.SetActive(false); //Hide the Ready GameObject
            pressed.gameObject.SetActive(false); //Hide the Select GameObject
            ready.transform.SetParent(Camera.main.transform); //Set main camera as parent for the Ready GameObject
            pressed.transform.SetParent(Camera.main.transform); //Set main camera as parent for the Select GameObject
            Backup.orig_interact = false;

        }
    }
    #endregion

    #region Interaction Source Lost Event, will be called when the gestures are outside of the gesture frame
    private void InteractionManager_InteractionSourceLost(InteractionSourceLostEventArgs obj)
    {
        if (obj.state.source.kind == InteractionSourceKind.Hand) //Checks if the object is a hand
        {
            gesture_status.text = "Hand lost"; //Display the status in the textfield
            ready.gameObject.SetActive(false); //Hide the Ready GameObject
            pressed.gameObject.SetActive(false); //Hide the Select GameObject
            Backup.orig_interact = false;
            

           
        }
    }
    #endregion
private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdatedEventArgs obj)
    {
        if (obj.state.source.kind == InteractionSourceKind.Hand)    //Hand will be recognized
        {  
            if (obj.state.anyPressed) //If Select gesture is active
            {

              
                    //Assign the cursor GameObject depending on the recognized gesture
                    pressed.gameObject.SetActive(true);
                    ready.gameObject.SetActive(false);
                    obj.state.sourcePose.TryGetPosition(out position_hand); //Get the position of the hand
                   
                    
                   
                    //Move the GameObject for the select gesture 
                    pressed.transform.position = new Vector3(position_hand.x, position_hand.y, position_hand.z + 1);
            }

            else // If ready gesture is active
            {
                       
                pressed.gameObject.SetActive(false);
                ready.gameObject.SetActive(true);

                obj.state.sourcePose.TryGetPosition(out position_hand);


               ready.transform.position =  new Vector3(position_hand.x, position_hand.y, position_hand.z+1);

@Hobl1990
Copy link
Author

@davidkline-ms I used shift + one of the movements (W,A,S,D). Same result when I tested it on HoloLens

@wiwei
Copy link
Contributor

wiwei commented Apr 11, 2019

Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.

@wiwei wiwei closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Repro The developer couldn’t reproduce the bug
Projects
None yet
Development

No branches or pull requests

4 participants