WorldViz User Forum  

Go Back   WorldViz User Forum > Precision Position Tracker (PPT)

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1  
Old 07-06-2009, 05:33 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Tracking with Marker ID plugin

Hello. I apologize if this is covered in the docs - I simply could not find an answer when I looked.

We are trying to track multiple lights with IDs using the new PPT-X system. We have 8 lights with IDs. If we are tracking 3 of them we increment the number of markers to 3. However, I'm not sure how to get the code in Vizard to be sure it is the marker of the correct number. Does the number just correspond the the number you add? In our old code we would do this:

Code:
ppt_1 = viz.add('ppt.dls')
ppt_2 = viz.add('ppt.dls')
ppt_3 = viz.add('ppt.dls')
If we do the same will we be guaranteed that ppt_1 is the marker corresponding to 1 and ppt_2 is the one corresponding to two? What if we were tracking 3 lights but their ids were 4,7,8. Then would ppt_1 correspond to light 4? I'm just not sure how the new system works.

Thanks!
Reply With Quote
  #2  
Old 07-07-2009, 05:57 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
We recommend using VRPN and then you can specify the sensor number when adding a tracker in Vizard. So, to connect to markers 4,7,8 you would do the following (sensor numbers begin at 0)
Code:
vrpn = viz.add('vrpn7.dle')
tracker4 = vrpn.addTracker('PPT0@hostname',3)
tracker7 = vrpn.addTracker('PPT0@hostname',6)
tracker8 = vrpn.addTracker('PPT0@hostname',7)
Reply With Quote
  #3  
Old 07-08-2009, 12:49 AM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Is there any way to do it with serial?
Reply With Quote
  #4  
Old 07-08-2009, 12:44 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
For example, if you only had one marker with ID 4 being tracked you would need to add ppt.dls four times to get marker 4. Trackers 1-3 would not have any data.
Code:
tracker1 = viz.add('vizppt.dls') 
tracker2 = viz.add('vizppt.dls') 
tracker3 = viz.add('vizppt.dls') 
tracker4 = viz.add('vizppt.dls')
Is it difficult for you to switch over to using VRPN?
Reply With Quote
  #5  
Old 07-09-2009, 02:29 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
We cannot easily switch to VPRN as we have an entire library of files that all use serial and we would prefer to leave the code.

We have tried the following code:

Code:
    viz.tracker()                        # start tracking
    
    lowarmleft_ppt_1 = viz.add('vizppt.dls')
    #lowarmleft_ppt_1.command(5,'',5)
    lowarmright_ppt_3 = viz.add('vizppt.dls')
    #lowarmright_ppt_3.command(5,'',5)
    uparmleft_ppt_2 = viz.add('vizppt.dls')
    uparmleft_ppt_2.command(5,'',5)
    uparmright_ppt_4 = viz.add('vizppt.dls')
    uparmright_ppt_4.command(5,'',5)
    
    lowarmleft_ppt_1.reset()
    lowarmright_ppt_3.reset()
    uparmleft_ppt_2.reset()
    uparmright_ppt_4.reset()
   


newline = ''
            newline += str(lowarmleft_ppt_1.get()[:]) + ' ' + str(lowarmright_ppt_3.get()[:]) + ' ' +  str(uparmleft_ppt_2.get()[:]) + ' ' +  str(uparmright_ppt_4.get()[:]) + '\n'
            print newline
We get all zeros.

Any suggestions?
Reply With Quote
  #6  
Old 07-09-2009, 08:38 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
It looks like the resets cause the values to be zero. What are the ID's of the markers used?
Reply With Quote
  #7  
Old 07-09-2009, 11:57 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
We were using IDs 1-4.

If we do not reset the ppts how will they know when they are in the center of the room? Normally we have our subject stand at a certain line and hit reset. That should only make 1 line be zeros, not all of them, right?
Reply With Quote
  #8  
Old 07-09-2009, 11:58 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
I should also note that on the PPT screen we do see numbers in the side panel. However, we do not see traces being traced. Instead we see a bunch of dots. Is this correct?
Reply With Quote
  #9  
Old 07-11-2009, 12:02 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Also, is there any way to run serial and vprn simlutaneously and just switch which plugin is active when runnign different scripts?
Reply With Quote
  #10  
Old 07-13-2009, 12:36 PM
wayne wayne is offline
Member
 
Join Date: May 2008
Location: Santa Barbara, CA
Posts: 9
You can run PPT with both Serial and VRPN7 plugins active at the same time. So you can write new code that uses VRPN, and your old legacy code will still work. I would recommend that you switch over to VRPN when possible, because it is designed to support more markers and faster updates such as that available in our PPT-H product. Also, I would recommend that in the future, you write your scripts to use the viztracker interface, so that way if your tracking system changes, you can easily just change the one viztracker file and all of your demos will then be changed at once instead of having to rewrite each one.

You should see traces in the PPT interface as you move around your lights. If you are seeing dots, then this is the trace. If you move too fast then the trace will probably appear disconnected.

The serial protocol is able to handle multiple markers, and it will deal with the order correctly. You do multiple viz.add('vizppt.dls') calls, and each call will return marker 1, 2, 3, 4, etc in that order. The nice part about the VRPN interface is you can request any marker you like in any order. But if the PPT GUI shows a marker 1, that is what you will get from your first call to viz.add('vizppt.dls').
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Vizard Sensor Plugin farshizzo Plug-in development 25 08-01-2019 01:24 AM
Live Characters plugin Frank Verberne Vizard 7 03-01-2012 03:23 AM
Howto debug a custom plugin? reedev Plug-in development 3 04-23-2009 03:16 PM
ImmersaDesk system tracking kgarr Vizard 10 09-14-2006 12:17 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 12:01 PM


All times are GMT -7. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC