WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-18-2012, 11:24 AM
Kaminski Kaminski is offline
Member
 
Join Date: Nov 2010
Posts: 36
Reset Pitch?

Is there an easy way to reset the pitch to 0? I do not completely trust that my tracker is coplanar with my hmd lenses, and would like to be able to define what the user feels is "level".

I have tried using preEuler but I have to apply it a few times and it doesn't always seem right. The link.reset() doesn't have a flag to transform specific Euler values, does it?
Reply With Quote
  #2  
Old 01-18-2012, 11:40 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You should be able to use a single preEuler operator to reset the pitch to zero. The following sample code demonstrates how to reset the pitch during runtime. It will take the current raw euler values from the tracker and apply the inverse pitch to a preEuler operator.
Code:
import viz
import vizact
viz.go()

viz.add('maze.osgb')

tracker = viz.add('testtrack_ori.dls')
view_link = viz.link(tracker,viz.MainView)
pitch_reset = view_link.preEuler([0,0,0],target=viz.LINK_ORI_OP)

def ResetPitch():
	yaw,pitch,roll = tracker.getEuler()
	pitch_reset.setEuler([0,-pitch,0])

vizact.onkeydown('r',ResetPitch)
Reply With Quote
  #3  
Old 02-02-2012, 07:59 AM
Kaminski Kaminski is offline
Member
 
Join Date: Nov 2010
Posts: 36
Thanks for the help, that works well.

Now I am trying to do a reset of the pitch, yaw, AND roll with a custom value for the pitch and "zeroing" for the yaw and roll. I would like to have the yaw and roll reset first and then set the pitch. I really can't grasp the correct order for these transformations; this article is the best I could find: http://docs.worldviz.com/vizard/Link_operators.htm

If I try to reset the yaw and roll first with a preEuler using the opposite values from the tracker, I get weird issues where I am moving or rotating the wrong directions. Any help on the best order/functions to implement this? I'm using the IS-900 for both position and euler.
Reply With Quote
  #4  
Old 02-02-2012, 11:15 AM
Kaminski Kaminski is offline
Member
 
Join Date: Nov 2010
Posts: 36
It works if I use postEuler instead of preEuler and use separate operator objects for each rotation. I also needed to use the flag target=viz.LINK_FULL_OP for at least yaw, and set the priority numbers in ascending order for yaw, roll, pitch.
Reply With Quote
  #5  
Old 02-02-2012, 12:59 PM
Kaminski Kaminski is offline
Member
 
Join Date: Nov 2010
Posts: 36
Actually preEuler on the pitch, but postEuler for yaw and roll. Everything else the same.
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
Coordinate system flips when pitch crosses 90deg? bernie Vizard 6 04-15-2010 05:31 PM
reset intersense not working billjarrold Vizard 9 03-31-2010 09:53 PM
The problem of tracker using via VRPN _kj_ Vizard 2 08-13-2009 12:03 AM
question about yaw, pitch, roll TunTun Vizard 2 05-23-2007 12:46 PM
Pitch Question nickyee Vizard 1 07-14-2004 10:07 AM


All times are GMT -7. The time now is 04:00 PM.


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