Log in or register to post comments

Compairing Coordinates from tracked objects

January 16, 2018 - 7:05am #1


i'm currently working on my Bachelor Thesis with the Hololens and Vuforia.

I reproduce the Game Towers of Hanoi, my task is to recognize the small objects ( 5 different discs) and the programm should tell me when i move the disc to another place if the game rules (only small on big discs ) is still okay.

The recognition with the objects works fine, i scanned the objects with the vuforia app and stored them in the database and put them into my unity project in the objecttargets. 

with the DefaulttrackableEventhandler.cs file i get the real world coordinates with calling this.transform.position into my unity cubes i place holographic when ever i detect an object. 

my problem now is i want to compare the x y z coordinates from two discs to check if they are placed right. Is their any good way to do so? cause at the moment i have a lot of trouble getting meaningfull coordinates to compare.

i first check if the x coordinates is +-0.3 inline with the compared object, then the same for the z coordinate. and my plan is now to check the y coordinate if the upper one minus the lower one is negative cause the y coordinate of the higher one should be bigger. 

but thats not working always :D

if anyone finds time or has help thank you

friendly greetings.

Compairing Coordinates from tracked objects

January 22, 2018 - 10:16am #4

Hey its me again,

I got question to the Camera Position relative to the tracked object.

My Camera in unity starts at (0,0,0).

Lets say i dont move and track the first target at (0,0,1) so 1 meter away from me and put it 1 meter to the right lets say at (1,0,1) and i'm moving with the hololens only to the side, is my camera position than (1,0,0) or do i have to manipulate the camera position in unity that it changes according to the realworld movement?

When i go back to the startposition in the real world, and lets say i have to take a step back in the real world (lets say (0,0,-1)) to track the next object on the same position where i tracked the first one, are the coordinates of the tracked object then (0,0,2) because i'm now 1 meter further away, or are they still (0,0,1) because the camera tracks it still at the same point?

I try to figure out if the tracked object coordinates are always relative to the hololens camera position or do i start at a fix point and when i move to objects even if im further away are still at the same position.

i start at (0,0,0) track at (0,0,1) so 1 meter distance now i move the camera 1 meter further away, are the coordinates of the tracked object now (0,0,2) cause 2 meter distance or still (0,0,1) cause the script knows that the camera moves away and not the object itselfs.

Sorry hard to explain :D

Still thanks if u can help

Friendly greetings

Compairing Coordinates from tracked objects

January 19, 2018 - 5:59am #3

Hey Thanks first for the fast replay.

My World Center Mode is already set to Camera. 

Is there any conversion for the Hololens Tracking, like 10cm moving with the camera is +/-1.0 in the coordinates?

The problem that i'm facing is, when i move my first disc (the smallest one)  like 20cm from the start tower to the right and then move the next bigger one on top of the smallest one, sometimes  the x and z coordinates are the same but not always, it makes it hard to write a gamelogic which checks for the right arrangement of the discs, because i only check the y coordinates if the x and z coordinates are already almost the same( which would imply that they are on top of eachother).

Or has anybody another possible way of compare small tracked real world object towards another, to check if they are well ordered.

Thanks for the help,

friendly greetings

Compairing Coordinates from tracked objects

January 16, 2018 - 10:11am #2

Hello Blobby09,

Checking the transform of the detected object is the correct way to get the position of the augmented object. What is your World Center Mode set to? If you are using "First Target" in this scenario you might end up with erratic positioning when changing which targets are detected. It might be better to switch this to be "Camera" as that'll make camera 0,0,0 and have the position of your targets all be relative to this.


Vuforia Support

Log in or register to post comments