WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Problem viztracker values (https://forum.worldviz.com/showthread.php?t=5069)

befl0 06-17-2014 06:01 AM

Problem viztracker values
 
Hi,

I used a tracker with a vrpn. Sometimes when I do a tracker.getData() and I put it in 8 values, a mistake appears because there are " too many values to unpack" but sometimes it's working perfectly. I realy don't understand why and where I can fixed the problem. I think it's a problem of connection but I am not sure. If you can help me how to find the solution.

Thanks,

Jeff 06-19-2014 05:52 AM

Can you post the code you're using to access the VRPN tracker and save the data to the 8 values? Also, can you post the Vizard output and error messages?

befl0 07-14-2014 08:08 AM

The code to access to the vrpn tracker is :

Code:

def bigAndSmall():
        while True:
                yield viztask.waitTime(0.0001)
                x, z, y, h, p, r, ang_der, ang_izq = tracker.getData()

And the error is : File "viztracker.py", line 56, in bigAndSmall
x, z, y, h, p, r, ang_der, ang_izq = tracker.getData()
ValueError: too many values to unpack
check_vrpn_cookie(): VRPN Note: minor version number doesn't match: (prefer 'vrpn: ver. 07.31', got 'vrpn: ver. 07.30 0'). This is not normally a problem.

Thanks,

Jeff 07-14-2014 10:51 AM

That error means there are more than 8 values being returned. You could save the values to a list and then extract the first 8.

Code:

data = tracker.getData()
x = data[0]


befl0 07-15-2014 01:33 AM

Hello,

Thanks for this answer, of course this is the solution.

It's working perfectly

Bérengère


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

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