interpolate joint motion via python

Hi~
I am trying to animate the process of a movement in joint space via python according to the
COURSE › [PYTHON ROBOTICS – PROGRAMMING A ROBOT WITH PYTHON] > Joints and Degrees of Freedom

My codes goes as following:

from vcScript import *

comp = getComponent();
robotController = comp.findBehaviour(“Controller”)

def getInternalJointsInRobot(rc):
return list(filter(lambda x : x.ExternalController == None, rc.Joints))

# To interpolate each joint from 0 to 90 **
idx = 0 **
for idx in range(0,90):
** for joint in getInternalJointsInRobot(robotController):

** joint.CurrentValue = idx

** delay(1000000) **
** getApplication().render()**
** print idx**

However, the delay process does not work and the configuration of robot looks like to jump from 0 to 90 directly.

I wonder is it possible to animate the motion of joints with self control (set the joint angle at the desired time) and how to realize that?

Thank you

Hy,

you have to do this in the OnRun-Method!

Regards
Feature