WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Problem reading VRPN info from ZSpace (https://forum.worldviz.com/showthread.php?t=4398)

davev 10-24-2012 12:26 PM

Problem reading VRPN info from ZSpace
 
1 Attachment(s)
I am attempting to read tracker data from a ZSpace system in Vizard. I am able to connect to the VRPN server using the vrpn_print_devices program provided with VRPN. When I connect using the same tracker and server name from Vizard I always get [0.0, 0.0, 0.0] for the tracker position.

Attached is a screenshot showing the output from vrpn_print_devices on the left and my vizard code and output on the right.

It looks like the tracker does provide more data than just the position and quaternion. Could this be a problem when using the tracker from Vizard?

farshizzo 10-24-2012 12:32 PM

Your while loop is blocking the main update loop, so the tracker will never update. You should never use time.sleep in the main thread. Instead, register a function to be called every 0.25 seconds and print the tracker values within that function:
Code:

import vizact
def PrintValues():
    print glasses.getPosition()
    print glasses.getQuat()

vizact.ontimer(0.25,PrintValues)


davev 10-24-2012 12:45 PM

Thanks! That did the trick.


All times are GMT -7. The time now is 02:21 AM.

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