有关动作的实验,主要通过基于时间轴的调节各个电机的动作实现各种Pose,其中关键的是在每个关键框架(时间节点)先保存好关键的动作,不然容易出错
高级实验:
def onInput_onStart(self):
#self.onStopped() #activate the output of the box
motionProxy = ALProxy("ALMotion")
names = ['HeadYaw', 'HeadPitch']
times = [[0.5], [0.5]]
motionProxy.angleInterpolation(names, [0.0, 0.0], times, True)
for i in range(3):
motionProxy.angleInterpolation(names, [0.0, 1.0], times, True)
motionProxy.angleInterpolation(names, [0.0,-1.0], times, True)
motionProxy.angleInterpolation(names, [0.0, 0.0], times, True)
self.onStopped()
其中,names为关节电机的名称(作为一个列表参数)