RosConnection.Update() spiking to >180ms execution. This thread-blocking causes bad frame spikes when Playing.

未关闭
#409 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
csharp, unity

调研方向

Reproduce the five-camera setup with Unity 2022.3.10f1, the Unity Visualization package, and the v0.7.0 TCP Connector and endpoint. Start with the Unity Profiler around RosConnection.Update() and compare the reported frame spikes against the TCP image-streaming setup. Done means the source of the blocking delay is identified and the recurring spikes are addressed or documented with evidence.

由索引模型根据 Issue 内容生成。

描述

Describe the bug
I am getting massive stutters when streaming images from ROS. When using the Editor profiler, it's apparent that the RosConnection.Update() invocation is blocking the main thread for >180ms. I am also using

Note: I am using 5, 720x720 images (~45fps per cam)

To Reproduce
Steps to reproduce the behavior:

  1. Start the Unity TCP endpoint specifying 127.0.0.1 as the IP address (via the bash terminal)
  2. Set up 5 visualizers using the Unity Visualization package, each connecting to a different ROSTopic (so each visualizer window is subscribed to a different Image topic)
  3. Open up the Unity Profiler window
  4. Observe the lag spikes!

Console logs / stack traces
No errors thrown.

Expected behavior
I guess I would expect that the Update() invocation shouldn't take so long to compute. 90% of the other frames that render the 5 camera views are smooth. However, when the frame lag spike occurs, it's very noticeable so I'd expect that any delay on the Update() function > 30ms is concerning.

Screenshots
Screenshot of frame showing massive compute time for RosConnection.Update():
LargeDelayInRosConnec

Screenshot of frame showing normal compute time for RosConnection.Update()
NormalSmallDelayInRosConnection

Environment (please complete the following information, where applicable):

  • Unity Version: Unity 2022.3.10f1
  • Unity machine OS + version: Ubuntu 20.04
  • ROS machine OS + version: Ubuntu 20.04, ROS Noetic
  • ROS–Unity communication: localhost via Unity-ROS TCP Endpoint (C++ version)
  • Branch or version: [v0.7.0 for the Unity-ROS TCP Connector for Unity] [v0.7.0 for the Unity-ROS visualization package] [v0.7.0 for Unity-ROS TCP endpoint]

Additional context
These delay spikes occur relatively frequently (>2 times per second)

主要语言
C#
星标
2.6k
派生
473
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Unity-Technologies/Unity-Robotics-Hub 的其他 Issue

查看 Unity-Technologies/Unity-Robotics-Hub 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。