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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Can i get the coordinate of tracked target?

BC_10971006
5-Regular Member

Can i get the coordinate of tracked target?

Hello everyone. 

 

I want to get the coord of first target and second target to calculate distance between them. 

 

First, I duplicate target in home.json

and, remove binding of thingMark-2 markerId and vumark.

BC_10971006_0-1716443167581.pngBC_10971006_1-1716443180642.png

 

in this scene, the difference of coordX  is 0.025.

 

I want to get the distance between two thingmarks regardless of the project initialized coord(0.025).

 

for that, I need to get second target's tracked coord in the first target(thingmark-1)'s matrix. 

 

 

Or other way

Matrix changes according to the width of Thingmark (in vuforia and real).

can make it something using rate of size?

 

 

 

 

5 REPLIES 5

Hi @BC_10971006,

so far I remeber (you can not call 2 thingmarks in one view wdiget (I did not checked in the mean time if there are any changes but do not believe that)- let say the Home view. Scanning  a target  thisi will identify and initialize   your coordinate  system - for the root - world coordinates. So that scanning a second thingmark  - you need to navigate to second view widget  and scann it there - but this will initialize again the world coordinate system to zerro.

What will be possible: you read the coordinate system in the first view. And then you will go to the location of the second thingmark duing the tracking /extended tracking/ you need to ensure that tracking is not  lost! Then you can save the eyepostion regarding  to the first thingmark what is used for the tracking and then navigate to the new view where you  are asked to scann the second thingmark . Then you have the new locaiton and the new postion of the eyevector /mobile device postion. So you can then calculate the differenc  between both (old versus new) eyepostion/locaiton vectors. If you required also an orientation you need to consider also the eyevector /gaze vector of the device.

The eyelocaiton and gaze vector you can get during the tracking event from the event arguments.  

 

angular.element(document).ready(async () => {
$timeout(()=>{
         tml3dRenderer.setupTrackingEventsCommand (function(target,eyepos,eyedir,eyeup) {
         $scope.app.IntersectionEYEvectorTo3DWidget(target,eyepos,eyedir);
         })   
             },1000)//end of $timeout
})//end of ready 

 

 

BC_10971006
5-Regular Member
(To:RolandRaytchev)

Thank you for your answer. 

As far as I understand, in one place
scan mark1 and mark2 and calculate the difference in coordinate system.

And i can't find the function 'IntersectionEYEvectorTo3DWidget' from $scope.app.

 

maybe, it's the function i should implement.

...this was only an example function taken from one example project/mobile /project for HL /in the post  "Enhancement Request" Show/Get the coordinate of the tap location in vuforia view >>> https://community.ptc.com/t5/Vuforia-Studio/quot-Enhancement-Request-quot-Show-Get-the-coordinate-of-the-tap/m-p/941533 - where it should demonstrate that the arguments received by the tracking callbacks  are passed to a function. It calculated then a distance to the last measured point which are saved in the previous call of the method. You can check for more details then the home.js in the mentioned project above.

Here also some posts which contains relevant informaiton to you problem. I think in the example there /there are some projects attached to the posts - the handled mathematic operations are similar or more complex as required in your case . Please, review the mentioned links (above)

acctually in your case you need to save the last tracking coordinate eyelocaiton, eyediretion and eyeup (to applicaiton parameter - because value will not be lost when you navigate to another view widget) and then having the new values of the device vectors. I think you need to calculate the difference to the last device locaiton and then also the inverse transformation to the Root sys - because you need the distance between the thingmarks which represents after the scan to world coordinate system.

 

Hi @BC_10971006 ,

I have today a discussion with a customer , who uses 2 thingmarks in the same view widget. In his application used an extended tracking  where user scanned several (at least 2) thingmarks during the extended tracking. This was working in the past. It seems that in older version in Stuido , I believe Version <=9.16  it was able to add with copy and paste a second thingmark and it was working for large models, so far you will scan only the one thingmark- the requirement is the both thingmarks could not be scanned at the same time (large distance). In the current version when you perform the same action the second thingmark will  replace the previous thingmark, so that to scan second thingmark now it requires to navigate to second view , as I mentioned in last post.

I will check this change  with dev team if the change of this hidden functionality was intented and if it could be possibly reactivated. I  will share the further plans from dev team here as soon as I have further information

Again to thingmark feature-> So it determines the coordinate of the 3D Container widget and with it then also the position of the zero point of the  World coordinate system. The thingmark widget could have some x,y,z,rx,ry,rz property set. This means that it is moved in regard to the World coordinates system by these properties values. Then when you scan the thingmark in this case  the world coordinate system is calculated with the inverse transformation based on the thingmark scanned. 

So, in your case is the question what you d0 scan. When the thingmarks are fixed then you have to know then what is the difference between their property and there simple calculate the distance between them.

But in case that the second thingmark is placed on object which could have a dynamic position - means that the object with the thingmark is e.g. carridge which could be moved and you need to know the current distance , in this case you need possibly to try a calculation that I mentioned in the previous post. So, scanning the thingmark, then calculated the inverse transformation to World Coordinate system of the 3D container widget. Next calculating of the coordinate and orientation of the current device position (this shortly before you start to scan the second thingmrak) -in the next step you will navigate to the second view , scan the thingmark , calculate the new world coordinate and the device location. At the end the measure distance - I think you need to calculate the distance from both device positions  but also in regards to the vector to the thingmarks 1 and 2. That is something what I thing it could work in this case. If you need help here then , please , let me know I could check it more detailed. Thanks 

Hello @BC_10971006

 

It looks like you have some responses on your topic. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.

Announcements

Top Tags