自主生活可以从Choregraphe的UI内以及按胸部按钮两次对机器人进行控制,然而,这可怎么从Choregraphe项目做了什么?浏览箱库中的工具列表后,目前还不清楚该工具可以用于此目的。
当自主的生活是,机器人,为了显得活着,使得小的运动,其头部,手臂和腿。我正在开发的行为是微妙的,难以从自治区生命运动区分开来,所以我试图让机器人原地踏步我的行为运行之前。
该ALAutonomousLife API提供的方法setState
在Choregraph你可以把这个内容的蟒蛇框:
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
self.al = ALProxy("ALAutonomousLife")
def onLoad(self):
#put initialization code here
pass
def onUnload(self):
#put clean-up code here
pass
def onInput_onStart(self):
self.al.setState("disabled")
#self.onStopped() #activate the output of the box
pass
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
然后激活此复选框以禁用AutonomousLife。
您也可以在这样的蟒蛇控制台对其进行测试:
import naoqi
from naoqi import ALProxy
al = ALProxy("ALAutonomousLife", "pepper.local", 9559)
al.setState("diabled")
这将作为按胸部按钮两次同样的效果。
要只禁用微妙的自主运动看看Autonomous Abilities
一种方法setEnabled
通过提供