【问题标题】:Get Pepper robot tells the time and dateGet Pepper 机器人告诉时间和日期
【发布时间】:2019-10-08 14:06:13
【问题描述】:

我想创建一个简单的程序,目的是让 Pepper 告诉我现在的时间或日期,当它识别出我的演讲时,在我的情况下是“日期”或“时间”。我可以知道我应该如何在我的 TTS python 脚本中编码吗?

下面是我的 TTS python 盒子上的代码:

class MyClass(GeneratedClass):
def __init__(self):
    GeneratedClass.__init__(self)

def onLoad(self):
    #put initialization code here
    from naoqi import ALProxy


    self.tts = ALProxy("ALTextToSpeech")

    pass

def onUnload(self):
    #put clean-up code here
    pass

def onInput_onStart(self):
    #self.onStopped() #activate the output of the box
    self.tts.say("Today is **#here i want to get input from GET DATE box#** ")
    self.onStopped()
    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

Print screen of my Choregraphe program

感谢大家的帮助。我是初学者。

【问题讨论】:

    标签: text-to-speech pepper choregraphe


    【解决方案1】:

    Pepper 就像任何用 python 编程的 (linux) 计算机系统一样。至于所有这些系统,您应该使用日期和时间库。

    看看那里的参考资料:https://docs.python.org/fr/2.7/library/datetime.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多