WorldViz User Forum  

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-18-2015, 05:34 AM
ichitaka ichitaka is offline
Member
 
Join Date: Jul 2015
Posts: 5
preEuler not working? or how to teleport subject multiple times

hello everybody i'm a psychology and computerscience student from germany.

so currently for our research project, we are implementing a basic trial in vizard.

basiclly whats happening is the following:
1-subject gets set into a specific spot with specific direction
2-subjects orientation gets set into a specific direction
3-subject needs to do something
4- 2 and 3 until loop finishes
5 - 1 till 4 until loop is finished

for the experiment we use the PPT and a oculus rift.

so we use a code that kinda looks simplified like this:

Code:
#first block is linking the HMD and PPT
hmd = oculus.Rift(window=viz.MainWindow, autoDetectMonitor=True)
sensor = hmd.getSensor()
vrpn = viz.add('vrpn7.dle')
tracker = vrpn.addTracker('PPT0@WV')
link_headtracker = viz.mergeLinkable(tracker, sensor)
linkAll = viz.link(link_headtracker, viz.MainView)

#then we set a pretrans
linkAll.preTrans([0.0,-0.18,0.09])#	-	Distance between marker and view

for spot in spotList:
	linkAll.setOffset(spot[0]) #		-	This "teleports" the subject to the location of desire
	linkAll.postEuler(spot[1], target=viz.LINK_ORI_OP)	#changing the orientation of view in headset
	linkAll.preEuler(spot[1], target=viz.LINK_POS_OP)	#changing the "axis" of the ppt
	for target in spot[2]:
		currentEuler = viz.MainView.getEuler()
		linkAll.postEuler([-currentEuler[0],0,0], target=viz.LINK_ORI_OP) #setting the postEuler back to 0
		linkAll.preEuler([-currentEuler[0],0,0], target=viz.LINK_POS_OP) #setting the preEuler back to 0
		linkAll.postEuler(target[0], target=viz.LINK_ORI_OP)
		linkAll.preEuler(target[1], target=viz.LINK_POS_OP)		#now we turned to subject into the direction we wanted
		doSomething()
	currentEuler = viz.MainView.getEuler()
	linkAll.postEuler([-currentEuler[0],0,0], target=viz.LINK_ORI_OP) #setting the postEuler back to 0
	linkAll.preEuler([-currentEuler[0],0,0], target=viz.LINK_POS_OP) #setting the preEuler back to 0
#now we set back everything before we start with the next spot
whats currently not working is the following. when i use the postEuler for the ppt-data, the offset gets turned too. the preEuler doesn't change anything at all, currently.
Some days ago everything seemed to work but then i had the problem that the preTrans didn't work with the changed orientation.
So i'm currently confused if i understood the methods from the viz module at all or if i'm using a code that is overcomplicating things too much?

any hints are welcome
Reply With Quote
  #2  
Old 12-19-2015, 04:27 AM
ichitaka ichitaka is offline
Member
 
Join Date: Jul 2015
Posts: 5
The solution was, using postEuler on viz.LINK_FULL_OP and instead of moving the subject with a Offset i moved the world of the subject. Now works also with the preTrans.

still don't know why preEuler didn't work but happy with my easy solution
Reply With Quote
Reply

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
Working w/ multiple scripts FlyingWren Vizard 3 10-16-2003 01:05 PM


All times are GMT -7. The time now is 08:44 AM.


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