Avatar mimicking after
Hi all,
I'm trying to make an avatar mimic the head movements of a participant with a delay of 4 seconds. In the code below, I'm writing the euler information of the viz.MainView to a file (1.log) and after 4 seconds, I'm trying to read from the beginning of that same file (thus creating a delay of 4 seconds). But after 4 seconds, I get an error message (IOError: [Errno 0] Error) and I think that's because I'm reading from the same file I'm writing to. I understand this could be problematic, but I don't know an other approach for my problem. Any help is greatly appreciated! Regards, Frank Code:
import viz |
Would it work for you to save the data in a list and read it from there?
|
Works like a charm, thanks Jeff! My solution consists of using three lists (one for yaw, pitch, and roll) which I append the current yaw, pitch, and roll to and start reading from the beginning after waiting 4 seconds. My only 'concern' now is that each list is growing with 10 floats/second, so they will get pretty big after a few minutes (my experiment will last around 10 to 15 minutes of mimicking I guess). Of course I could delete the information from the list after it has been read, but will the size of the lists pose any problem at all?
|
For anyone with the same problem, here's my solution I eventually used:
Code:
import viz |
All times are GMT -7. The time now is 09:16 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC