#1
|
|||
|
|||
The problem of tracker using via VRPN
Greetings to everyone!
We develop a small application in WorldViz. The viewport rotation must be implemented through 3DOF trackers in this application. Using embedded WorldViz driver for InterSense tracker, app works well. InterSense is used as follows: Code:
viz.go( viz.TRACKER ) tracker = viz.add( 'intersense.dls' ) vizact.onupdate( 0, UpdateView ) def UpdateView(): yaw, pitch, roll = tracker.getEuler() viz.MainView.setEuler( GetOrderedAndInvertedViewAngles( yaw, pitch, roll ), viz.BODY_ORI ) # Return ordered and inverted view angles depends on current settings def GetOrderedAndInvertedViewAngles( yaw, pitch, roll ): # order: if view_angles_order_1.get() == viz.DOWN: y = yaw p = pitch r = roll elif view_angles_order_2.get() == viz.DOWN: y = pitch p = yaw r = roll elif view_angles_order_3.get() == viz.DOWN: y = pitch p = roll r = yaw elif view_angles_order_4.get() == viz.DOWN: y = yaw p = roll r = pitch elif view_angles_order_5.get() == viz.DOWN: y = roll p = pitch r = yaw elif view_angles_order_6.get() == viz.DOWN: y = roll p = yaw r = pitch # invert: if view_angles_invert_yaw.get() == viz.DOWN: y = -y if view_angles_invert_pitch.get() == viz.DOWN: p = -p if view_angles_invert_roll.get() == viz.DOWN: r = -r return [y, p, r] Code:
viz.go() vrpn = viz.add( 'vrpn7.dle' ) tracker = vrpn.addTracker( 'Head@localhost' ) def UpdateView(): yaw, pitch, roll = tracker.getEuler() viz.MainView.setEuler( GetOrderedAndInvertedViewAngles( yaw, pitch, roll ), viz.BODY_ORI ) # Return ordered and inverted view angles depends on current settings def GetOrderedAndInvertedViewAngles( yaw, pitch, roll ): # order: if view_angles_order_1.get() == viz.DOWN: y = yaw p = pitch r = roll elif view_angles_order_2.get() == viz.DOWN: y = pitch p = yaw r = roll elif view_angles_order_3.get() == viz.DOWN: y = pitch p = roll r = yaw elif view_angles_order_4.get() == viz.DOWN: y = yaw p = roll r = pitch elif view_angles_order_5.get() == viz.DOWN: y = roll p = pitch r = yaw elif view_angles_order_6.get() == viz.DOWN: y = roll p = yaw r = pitch # invert: if view_angles_invert_yaw.get() == viz.DOWN: y = -y if view_angles_invert_pitch.get() == viz.DOWN: p = -p if view_angles_invert_roll.get() == viz.DOWN: r = -r return [y, p, r] |
#2
|
|||
|
|||
I believe the problem is that the VRPN server is sending the InterSense data in a different coordinate frame than Vizard's coordinate frame. You can use the swapQuat command on the VRPN tracker object to modify its coordinate system. I'm not sure what exact values you will need to correct the VRPN data, but here is how Vizard's built-in InterSense plugin swaps the quaternion data:
Code:
tracker.swapQuat([-3,4,-2,1]) |
#3
|
|||
|
|||
Thanks, this solution worked correctly at least for miniAHRS tracker via VRPN. I used exactly the same swap values for tracker.swapQuat(). We`ll test this solution for other trackers some time later.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VRPN info | sdiverdi | Precision Position Tracker (PPT) | 5 | 01-16-2011 01:00 PM |
Problem with tracker after reboot | eugcc | Precision Position Tracker (PPT) | 4 | 08-04-2009 12:26 AM |
Does the vrpn7.dle tracker plug-in clear the udp buffer? | michaelrepucci | Vizard | 2 | 09-19-2008 11:22 AM |
swapPos and swapQuat with VRPN | michaelrepucci | Vizard | 1 | 07-29-2008 12:27 PM |
problem with female animations | vmonkey | Vizard | 1 | 10-07-2005 11:36 AM |