remote_control_cozmo.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:cozmo-python-sdk 作者: anki 项目源码 文件源码
def streaming_video(url_root):
    '''Video streaming generator function'''
    try:
        while True:
            if remote_control_cozmo:
                image = get_annotated_image()

                img_io = io.BytesIO()
                image.save(img_io, 'PNG')
                img_io.seek(0)
                yield (b'--frame\r\n'
                    b'Content-Type: image/png\r\n\r\n' + img_io.getvalue() + b'\r\n')
            else:
                asyncio.sleep(.1)
    except cozmo.exceptions.SDKShutdown:
        # Tell the main flask thread to shutdown
        requests.post(url_root + 'shutdown')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号