# Pico4Ultra遥按r键后WebSocket断连及aiohttp AssertionError

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-05-12-xr-teleoperate-241
> 频道：pitfalls | 更新日期：2026-05-12 | 标签：auto, github-issue, xr_teleoperate
> 核心摘要：VR设备按键触发控制界面后秒断，日志报AssertionError；建议更换vuer依赖版本并确保WiFi6+稳定网络。

# Pico4Ultra遥按r键后WebSocket断连及aiohttp AssertionError

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[The VR device often disconnects.](https://github.com/unitreerobotics/xr_teleoperate/issues/241)（GitHub unitreerobotics/xr_teleoperate #241）

**状态**：有绕过办法

## 问题

在xr_teleoperate中按下“r”键唤起VR控制界面后，连接数秒内自动断开。服务端日志显示WebSocket connected后迅速disconnected，并抛出aiohttp.web_protocol AssertionError: assert isinstance(result, StreamResponse)，提示uplink ID不在websocket pool中。

## 环境

机器人和服务端有线连接路由器（网段123），VR设备为Pico4 Ultra通过Wi-Fi接入同一网络；服务端Python 3.10环境运行aiohttp与vuer依赖。

## 解决办法

1. 尝试更换 `vuer` 依赖库的不同版本，排查因版本兼容性导致的 `StreamResponse` 断言失败。
2. 优化网络环境，确保使用 WiFi 6 及以上标准路由器，并保持无线连接速率稳定，避免因丢包或延迟导致 WebSocket 会话被服务端移除。

讨论原作者：@ting-zheng 等，版权归原作者所有。
:::

## 原始参考来源 (Sources)

- [GitHub unitreerobotics/xr_teleoperate #241：The VR device often disconnects.](https://github.com/unitreerobotics/xr_teleoperate/issues/241)