WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-07-2008, 12:51 PM
timbo timbo is offline
Member
 
Join Date: Jun 2008
Posts: 16
Wink two continuous sockets

I am doing a reaching task experiment with vizard using 1 socket for hand data and a separate socket for target data. I use viz.director() in a while loop to call the hand position and the same for the target position (in different functions). This seems to work well except when ever the target data is called the hand data stops then starts up again. Is there any way I can run both sockets without having one interupt the other?


def handmove():
global S, X, Y, Z
try:
data, addr = S.recvfrom(30)
component = data.split(',')

X = float(component[0])
Y = float(component[1])
Z = float(component[2])
except:
pass

def targmove():
global T, A, B, C
for n in (1,2):
if n < 2:
data, addr = T.recvfrom(30)
status = data
else:
data, addr = T.recvfrom(30)
comp = data.split(',')
A = float(comp[0])
B = float(comp[1])
C = float(comp[2])

ball2.translate(A, B, C)

###################################
MAIN LOOP
###################################

def hand():
global loopy, X, Y, Z
while loopy:
handmove()
ball1.translate(X,Y,Z)

viz.director(hand)

def targ():
global loopy
while loopy:
targmove()

viz.director(targ)
Reply With Quote
 

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


All times are GMT -7. The time now is 10:34 AM.


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