cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

AR Tracker Coordinates

azaharia
1-Visitor

AR Tracker Coordinates

Hello,

I have set up an AR tracker project for one of the Thingmarks and I've been trying to extract the coordinates of the tracker.

To this purpose I have set up 3 application parameters (xCoord, yCoord, zCoord) and bound them to the X, Y, Z coordinates of the model that shows up when the Thingmark is found. From my understanding the placement of the Thingmark is at the (0,0,0) position. However, without initialising the application parameters to something in the 'Home.js' file, the values show up as Not a Number ('NaN'). Additionally, the values do not update live during tracking.

I understand that this happens because within the editor the model has a fixed position, it is only in the AR environment when I move the Thingmark that it changes. And since the model is following the Thingmark if also resets to (0,0,0. Does anyone have any idea if what I am trying to do is possible?

Thanks in advance!

6 REPLIES 6

Hello,

You can place the ThingMark anywhere in the Studio environment that you want to.  It doesn't have to be at (0,0,0).  If you use the translate tool at the top of the canvas, you can move the ThingMark anywhere and if you use the mate tool at the top of the canvas, you can mate the ThingMark anywhere on the geometry.

The ThingMark needs to be placed in the Studio environment in the same place that you put it in the real world.  Meaning if you place it on the physical part, you need to place the ThingMark in Studio at the corresponding location on the CAD model.

Are you moving the ThingMark in the real world after you start the AR experience?

I am not moving the ThingMark, what I meant is the coordinates of the Model/ThingMark with respect to the camera. Do you know whether this is possible?

The ThingMark is intended to be stationary.  Can you explain your use case?

Once I detect the ThingMark I want to Experience to show on the screen the coordinates of the ThingMark within the camera frame, so that I can deduce for e.g., the distance to it. So for example if I set the user/camera's position to be (0,0,0), I want to get the relative coordinates of the Mark.

Thingworx View does not have the ability to get the coordinates of the camera or the coordinates of the ThingMark with respect to the camera.  The coordinates are global.

You can get the global coordinates of the ThingMark in javascript.

var x_cord = $scope.view.wdg['thingMark-1]['x'];

var y_cord = $scope.view.wdg['thingMark-1]['y'];

var z_cord = $scope.view.wdg['thingMark-1]['z'];

Thank you!

Announcements

Top Tags