WorldViz User Forum  

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

Thread Tools Rate Thread Display Modes
Old 03-27-2008, 07:14 AM
dan12345 dan12345 is offline
Join Date: Jan 2008
Posts: 58
tracking with multiple LEDS

I've been trying to solve the age-old problem of tracking multiple LED lights,
and linking one of them to the head, despite the fact that there's no inherent
identity to the different lights.

We had the system installed just a while ago, and with Paul ( from worldviz )
we tried to work out something which would handle head+hand tracking.
attached is the code - it works on a tryouy with markers
and keyboard/mouse tracking, but get's messed up when i try it with PPT tracking, and things don't get tracked correctly. ( both ppt's end
up moving the head, and none the hand, and strange leaps occur )
### ##HERE IS THE CODE#######

import viz
import __main__
import viztracker

head = viz.addGroup()
hand = viz.addGroup()
pos1 = None
pos2 = None
headLink = None
handLink = None
head_ori = None
hand_ori = None
posHeadLink = None
posHandLink = None

STEP_SIZE = 4 # STEP_SIZE * real step in life = the step in the VR

def setUp():
global head,pos1,pos2, posHeadLink, posHandLink, head_ori,hand_ori
__main__.PORT_PPT = 1
pos1 = viz.add('vizppt.dls')
pos2 = viz.add('vizppt.dls')
__main__.PORT_INTERSENSE = 4
hand_ori = viz.add('intersense.dls')
__main__.PORT_INTERSENSE = 5
head_ori = viz.add('intersense.dls')

# pos1 = viztracker.Keyboard6DOF()
# pos2 = viztracker.MouseTracker()
# head_ori = viztracker.Keyboard6DOF()
# hand_ori = viztracker.Keyboard6DOF()

posHeadLink =,head,enabled=False,mask=viz.LINK_POS )
oriHeadLink =,head,enabled=False,mask=viz.LINK _ORI)
posHandLink =,hand,enabled=False,mask=viz.LINK_POS )
oriHandLink =,hand,enabled=False,mask=viz.LINK _ORI)
vizact.onupdate(viz.PRIORITY_PLUGINS+1,posHeadLink .update) #Manually update link after plugins
vizact.onupdate(viz.PRIORITY_PLUGINS+1,oriHeadLink .update) #Manually update link after plugins
vizact.onupdate(viz.PRIORITY_PLUGINS+1,posHandLink .update) #Manually update link after plugins
vizact.onupdate(viz.PRIORITY_PLUGINS+1,oriHandLink .update) #Manually update link after plugins

def getHead():
return head

def getHand():
return hand

def update():
y1 = pos1.getPosition()[1]
y2 = pos2.getPosition()[1]
if y2>y1 :
else :

#scaleLink = posHeadLink.postScale([STEP_SIZE,1,STEP_SIZE],target=viz.LINK_POS_OP) #Scale movement factor

def resetPos():
posHeadLink.reset(viz.RESET_X | viz.RESET_Z)
posHandLink.reset(viz.RESET_X | viz.RESET_Z)

def resetOri():

vizact.onkeydown(' ',update)

if __name__ == '__main__' :
#myroom = viz.add('C:/Dan/WorldViz/Vizard30/tutorials/gettingstarted/room.wrl')
marker1 = viz.add('marker.wrl')
marker2 = viz.add('marker.wrl')


I also looked at the forum post from 2003
which talks about the problem there, but i saw the solution given
there by the admin doesn't use updated viz terms, such as links and such,
( for example it uses the viz.tracker() command, which i see isn't
being used in the viztracker file, so i guessed it was outdated...)
but manually translates objects according to position. (Is the solution offered there still possible? would you advise it? )

Hope i was clear enough.... would be happy for any help i could get, i'm
pretty desperate myself. I actually want specifically to solve the problem
for 3 ppts and 2 orientation sensors ( Head, Hand, and one more PPT on the leg ), so if you could provide me a solution to that problem speficially that would be the best...
thanks alot!
Reply With Quote
Old 03-28-2008, 02:58 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
What are the specific constraints for your setup? Is the head always going to be above the hands? Will the user always be facing a specific direction? There is no general solution, so we need to know your exact requirements before we can provide a useful solution.
Reply With Quote
Old 03-29-2008, 02:52 PM
dan12345 dan12345 is offline
Join Date: Jan 2008
Posts: 58

my requirements -
at the beginning the head will be above the hand, but later on
the person being tracked is supposed to lift his hands above his heads, so not always - the same regarding the PPT we want to have on the person's leg -
at the beginning we planned to reset the positions, by assuming that
head > hand > leg height wise, but later on theoretically the person
might lower his hand beneath the ppt on the leg.

and the viewpoint should stay linked to the person's head...

so in conclusion there won't be any thing permanent throughout the
experiment, but we planned to perform an inital reset at the beginning,
and later on if for some reason something gets messed up, then to
have a keyboard callback which lets us press a key, and perform the same
height test, assuming head > arm > leg.

Reply With Quote
Old 04-01-2008, 02:01 AM
dan12345 dan12345 is offline
Join Date: Jan 2008
Posts: 58

just to make sure you haven't forgotten about me :\
Reply With Quote
Old 04-01-2008, 08:45 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
There is no easy solution to this. One method would be to save the initial location of the head/hand/feet when you perform a reset. Afterward, every frame compare the new PPT marker positions to the previous head/hand/feet positions. The marker that is closest to the previous head position will be the head position for the new frame, and so on for the arm/legs. However, this method will break down if you bring the markers close together, or if a marker becomes occluded for an extended amount of time.
Reply With Quote
Old 04-02-2008, 04:39 AM
dan12345 dan12345 is offline
Join Date: Jan 2008
Posts: 58
Why is it not simple to perform the links?

i'm a bit confounded :
The ppt is able to differentiate between different ppt devices
, after the initial recognition - this is obvious from the fact that watching
the ppt tracking program, each led gets it's own different color, and these
colors stay with the correct ppt device ( for the sake of the argument
let's assume that the ppt's don't get confused between each other or occluded ).

So what prevents us from implementing something which initially finds out
which device is the led/hand/head, according to the initial height of the
device? Assuming that there is no swapping or occlusion, am i wrong
to think that this would work correctly and consistently throughout
the tracking session?

And since assuming that occlusions and swapppings might occur, that's why
we wanted to provide some sort of callback (keyboard), that would perform
the height test again, and reorganize the links between the ppts and the different body parts.... i am abit confused about the different link objects
in vizard and their functions, and that's why i wasn't really able to implement this myself... ( assuming it's possible )

If this is not possible, i would be happy for an explanation where i'm wrong in my thought process, as i guess i'm missing something.....

Reply With Quote
Old 04-02-2008, 04:55 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
If you want to assume that the PPT won't swap markers then what exactly is the problem? Once you determine which marker is connected to the head/hand/legs you can link them to the appropriate Vizard objects (viewpoint,models,etc...) like usual.
Reply With Quote
Old 04-02-2008, 10:44 PM
dan12345 dan12345 is offline
Join Date: Jan 2008
Posts: 58
okay my bad

hey farshi
sadly i admit that there is actually no problem! indeed
it seems that it works fine, and the reason it didn't work before,
was just because i didn't update the number of trackers being tracked
from 1 to 2, and this caused the strange behaviour ( obviously ).
well, i'm new to the system!
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
How to load multiple LEDs into PPT ruddle Precision Position Tracker (PPT) 3 06-20-2007 12:21 AM
ImmersaDesk system tracking kgarr Vizard 10 09-14-2006 11:17 AM
Identity of multiple leds Jerry Precision Position Tracker (PPT) 1 06-22-2006 10:07 AM
Tracking Multiple Lights nickyee Precision Position Tracker (PPT) 5 12-19-2005 03:51 PM
Virtual arrow with multiple tracking lights Vmichaeljin Vizard 8 10-03-2005 08:53 AM

All times are GMT -7. The time now is 03:14 PM.

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