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

Abierto
#409 2 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
csharp, unity

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)

Lenguaje dominante
C#
Estrellas
2.6k
Forks
473
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Unity-Technologies/Unity-Robotics-Hub

Todos los issues de Unity-Technologies/Unity-Robotics-Hub

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.