0
嗨,我是新的Python和这是一个很多人都有的错误,但我不能帮助任何其他线程。代码是直接从这个tutorial。 它信息:[ERROR] behavior.box:FMBox :: createPythonModule:0 _Behavior__lastUploadedChoregrapheBehaviorbehavior_1291762048__root__headnod_1:用户类评估失败,错误: ( '预期的缩进块',( '',19,11,“motionProxy.angleInterpolation (名称,[0.0,1.0],时间真)\ n“))预计一个缩进块蟒蛇choregraphe
预先感谢您
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
def onLoad(self):
#put initialization code here
pass
def onUnload(self):
pass
def onInput_onStart(self):
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()
def onInput_onStop(self):
self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
self.onStopped() #activate the output of the box
缩进你的'for'循环。切割和粘贴通常会拧入压痕。 – cdarke