View Single Post
  #9  
Old 10-27-2009, 11:25 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The Intersense driver does not preserve the reset settings across multiple runs, so you need to call the resetHeading command every time your script runs.

You can optionally hard code the offset value for the Intersense so you don't have to call the resetHeading command each time. Since the heading is based on the internal compass, the offset will need to be computed for each physical location the script is executed from.

To use this technique, connect to the Intersense without resetting it and place it in the desired zeroed heading position. Make sure the Intersense is stationary and there is no interference. Now grab the yaw value from the stationary Intersense tracker and use the following code to apply the heading offset:
Code:
# Connect to Intersense tracker
isense = viz.add('intersense.dle')
tracker = isense.addTracker()

ZERO_YAW = ... #Save the yaw value here

# Link tracker to main viewpoint
trackerLink = viz.link(tracker,viz.MainView)

# Apply yaw offset to link to reach desired zero heading
trackerLink.postEuler([-ZERO_YAW,0,0],target=viz.LINK_ORI_OP)
Reply With Quote