ursi
02-08-2010, 05:00 PM
Hi
Three animation paths should be scheduled one after another.
The path speed should be 100 steps/sec
pathFW.speed(100) # default: 1/sec?
I thought the waiting time should be devided by 100 as well>
yield viztask.waitTime(len(BW_Pos)/100)
My schedule looks like that, but in the animation there is a jump at the end of the first animation path... I guess, there is a timing problem and the system starts with the second path (pathStopp) before the 1st path (pathFW) is finished.
def onkeydown(key):
PATH()
if key == 't':
###+++++++++++++++++++++++++++
### SCHEDULE the room movement, sound and the output voltage
def ScheduleOutputs():
song.play()
d.eAnalogOut(3.0, 0.0) #(AO0, AO1)
pathFW.play()
yield viztask.waitTime(((len(FW_Pos))/100))
d.eAnalogOut(1.0, 0.0)
pathStopp.play()
yield viztask.waitTime(((len(Stopp_Pos))/100))
d.eAnalogOut(3.0, 0.0)
pathBW.play()
yield viztask.waitTime(((len(BW_Pos))/100))
d.eAnalogOut(1.0, 0.0)
song.stop()
viztask.schedule(ScheduleOutputs())
###+++++++++++++++++++++++++++
viz.callback(viz.KEYDOWN_EVENT,onkeydown)
So, how can I manage that timing problem?
Three animation paths should be scheduled one after another.
The path speed should be 100 steps/sec
pathFW.speed(100) # default: 1/sec?
I thought the waiting time should be devided by 100 as well>
yield viztask.waitTime(len(BW_Pos)/100)
My schedule looks like that, but in the animation there is a jump at the end of the first animation path... I guess, there is a timing problem and the system starts with the second path (pathStopp) before the 1st path (pathFW) is finished.
def onkeydown(key):
PATH()
if key == 't':
###+++++++++++++++++++++++++++
### SCHEDULE the room movement, sound and the output voltage
def ScheduleOutputs():
song.play()
d.eAnalogOut(3.0, 0.0) #(AO0, AO1)
pathFW.play()
yield viztask.waitTime(((len(FW_Pos))/100))
d.eAnalogOut(1.0, 0.0)
pathStopp.play()
yield viztask.waitTime(((len(Stopp_Pos))/100))
d.eAnalogOut(3.0, 0.0)
pathBW.play()
yield viztask.waitTime(((len(BW_Pos))/100))
d.eAnalogOut(1.0, 0.0)
song.stop()
viztask.schedule(ScheduleOutputs())
###+++++++++++++++++++++++++++
viz.callback(viz.KEYDOWN_EVENT,onkeydown)
So, how can I manage that timing problem?