简体   繁体   English

套接字未连接

[英]Socket is not connected Pepper

I use pythonsdk and naoqi for programming my pepper robot. 我使用pythonsdk和naoqi对我的胡椒机器人进行编程。 i created a session and call the main by it is follows: 我创建了一个会话,并通过它调用主要方法如下:

    try
       session = qi.Session()
       session.connect("tcp://#.#.#.#:9559")

    except RuntimeError:
       print ("Cannot connect to robot ")

    main(session)

each run of my program may take about 2 hourse. 我的程序每次运行可能需要2个小时左右。 Actually it is a toutrial based interaction which is a loop of two phase: robot speech and playing a video clip on pepper's tablet, then a new topic and new video clip and so on. 实际上,这是基于toutrial的交互,分为两个阶段的循环:机器人语音和在Pepper平板电脑上播放视频剪辑,然后是新主题和新视频剪辑,等等。 but after a while i got these errors: 但一段时间后,我得到了这些错误:

RuntimeError: Session not connected.
RuntimeError: Socket is not connected

so what these errors mean? 那么这些错误是什么意思呢? and how can i overcome them? 我该如何克服它们? Thanks in advance 提前致谢

会话未连接

You should make sure your session remains alive, by using it from the scope it was created: 您应该通过在创建会话的范围内使用它来确保会话保持活动状态:

session = qi.Session()
session.connect("tcp://#.#.#.#:9559")
main(session)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM