![]() |
#1
|
|||
|
|||
tracking with multiple LEDS
Hello.
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 = viz.link(pos1,head,enabled=False,mask=viz.LINK_POS ) oriHeadLink = viz.link(head_ori,head,enabled=False,mask=viz.LINK _ORI) posHandLink = viz.link(pos2,hand,enabled=False,mask=viz.LINK_POS ) oriHandLink = viz.link(hand_ori,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 update() def getHead(): return head def getHand(): return hand def update(): y1 = pos1.getPosition()[1] y2 = pos2.getPosition()[1] if y2>y1 : posHandLink.setSrc(pos1) posHeadLink.setSrc(pos2) else : posHandLink.setSrc(pos2) posHeadLink.setSrc(pos1) #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(): head_ori.reset() hand_ori.reset() vizact.onkeydown(' ',update) vizact.onkeydown('t',resetPos) vizact.onkeydown('r',resetOri) if __name__ == '__main__' : viz.go() #myroom = viz.add('C:/Dan/WorldViz/Vizard30/tutorials/gettingstarted/room.wrl') setUp() marker1 = viz.add('marker.wrl') marker2 = viz.add('marker.wrl') viz.eyeheight(0) marker1.color([1,1,0]) viz.link(head,marker1) viz.link(hand,marker2) #viz.link(head,viz.MainView) ####################### END OF CODE ####################### I also looked at the forum post from 2003 http://www.worldviz.com/forum/showthread.php?t=175 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! dan |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to load multiple LEDs into PPT | ruddle | Precision Position Tracker (PPT) | 3 | 06-20-2007 01:21 AM |
ImmersaDesk system tracking | kgarr | Vizard | 10 | 09-14-2006 12:17 PM |
Identity of multiple leds | Jerry | Precision Position Tracker (PPT) | 1 | 06-22-2006 11:07 AM |
Tracking Multiple Lights | nickyee | Precision Position Tracker (PPT) | 5 | 12-19-2005 04:51 PM |
Virtual arrow with multiple tracking lights | Vmichaeljin | Vizard | 8 | 10-03-2005 09:53 AM |