WorldViz User Forum

WorldViz User Forum (
-   Precision Position Tracker (PPT) (
-   -   Adjusting starting head orientation of viztracker (

surf3rguy 01-05-2012 05:23 PM

Adjusting starting head orientation of viztracker
I want to use viztracker but everytime i set the user in the desired starting position, the head orientation is incorrect. I want to rotate it. i have tried setting the post euler in the vizsetupcfg to what i need it to be, but then the tracking of the head is flipped around. any ideas?

Jeff 01-06-2012 10:15 AM

If you face the user towards PPT North with the script running and press 'Alt + r' is the alignment working for you? Try that without the postEuler operator.

Can you attach your vizsetupcfg file with the hardcoded offset?

surf3rguy 01-06-2012 12:29 PM

by north do you me actual north or what we consider north in the room? i have not tried it without the posteuler yet. i will do that

surf3rguy 01-06-2012 03:47 PM

Here is what have
# File generated automatically by WorldViz graphical setup tool 3.1
# Setup option Input --> Manufacturer: Keyboard Type: Mouse LR / PageUpDn
# Setup option Tracker --> Manufacturer: InterSense Type: VRPN7 + InertiaCube2/3
# Setup option Display --> Manufacturer: NVIS HMD Type: Nvisor SX60
# Setup option Avatar --> Manufacturer: Generic Type: No Avatar

# This file must be loaded by the correct version of included with Vizard
import viz

# Source code that defines the composite. This is user editable but changes will be lost if this file is regenerated
import vizact
import vizuniverse as VU
import __main__
import hand

# Create a custom composite that handles tracking, display, and input devices all together
def createCustomComposite(id=0):
# ---- Trackers ----
# Initialize an empty composite object to store all the trackers
# The composite.storeTracker() method is used to combine the individual trackers for the user's body within the composite
composite = VU.VUCompositeTrackersVRPN(hostname='PPT0@128.111. 240.77', magneticzero=0.0, supplementIntersense=3)

# ---- Display ----
viz.setOption ('viz.fullscreen', 1)
import nvis

# ---- Input ----
composite.createLeftHand(hand.MultiInputSensor(pin chButtons=[viz.KEY_PAGE_UP,viz.MOUSEBUTTON_LEFT], fistButtons=[viz.MOUSEBUTTON_MIDDLE]))
composite.createRightHand(hand.MultiInputSensor(pi nchButtons=[viz.KEY_PAGE_DOWN,viz.MOUSEBUTTON_RIGHT], fistButtons=[viz.MOUSEBUTTON_MIDDLE]))

# ---- Avatar ----

# ---- Finalize Composite ----

composite.finishTrackers() # Build up internal links for all the tracking devices
# Attach viewpoint to default location on the user
composite.getRawTracker(composite.HEAD).getLink(). preEuler([-90,0,0]) #postEuler does not work. but this does
composite.getRawTracker(composite.HEAD).getLink(). postTrans([3,0,-3.75])#move the person in the right position
# ---- Extra Adjustments Editable By The User ----

# Note that the examples below will not work with LiveCharacters, only inputs with individual trackers
# composite.getRawTracker(composite.HEAD).getLink(). postEuler([0,0,45]) # Apply 45 degree offset to the head tracker
# composite.getLeftHand().setScale([2,2,2]) # Apply scale to the left hand representation
# composite.getLeftHand().alpha(0.0) # Make the left hand invisible
# composite.getRawTracker(composite.LHAND).getLink() .postTrans([0,-0.5,0]) # Lower the hand tracker 50 cm
# composite.setPosScale([2,1,2]) # Scale XZ position of all trackers by a factor of 2x
# composite.setOriScale([0,0,0]) # Suppress all orientation changes for all trackers

# The following examples are compatible with all kinds of composite objects, including LiveCharacters
# composite.getMovableNode().setPosition([1.0,0.0,0.0]) # Move the user and all trackers +1 unit along the X axis
# composite.defineViewpoint(offset=[0,0,0]) # Replace above defineViewpoint() call, allows custom offset of viewpoint

# ---- Return Back Result ----
return composite

# If this script is run directly, then we should allow it to work for testing purposes (normally loads this file in, and this file is not used standalone)
if __name__ == "__main__":
print 'Manually overriding viztracker to test vizsetupcfg configuration'
import viztracker
viztracker.createCustomComposite = createCustomComposite

Basically I move the subject within the room. and the rotate the head so that is is starting in the correct position. but then when you move foreward you move to the left in the world, backwards moves right in the world etc etc. Then when I reset using alt r, the room does not match the virtual one. basically we are working in a virtual model of the actual room we are in.

surf3rguy 01-06-2012 05:47 PM

I just used the raw data and manipulated the MainView myself. Too much abstraction with the viztracker. Thanks for your suggestions!

All times are GMT -7. The time now is 10:53 PM.

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