RobotecAI / ros2-for-unity

High-performance ROS2 solution for Unity3D
Apache License 2.0
449 stars 58 forks source link

ROS2UnityComponent - decide on constraint #12

Open adamdbrw opened 3 years ago

adamdbrw commented 3 years ago

Either test multiple components and confirm they work or enforce singleton

kielczykowski-rai commented 3 years ago

I tested using multiple ROS2 Unity Components in different configurations over Unity project (for example adding components to single or multiple GameObjects). Everything is working fine inside Unity and ros2 environment. I believe enforcing this component to become singleton will be much more time consuming, than letting every Unity GameObject have it's own ROS2 Unity Component (if it doesn't bring any performance drawback).

adamdbrw commented 3 years ago

From design principle it is meant as one-of, since it centralizes initialization and destruction, holds all the nodes etc. Multiples only work because we made ros2cs resilient to double-init and so on.

l13517069919 commented 1 year ago

I encountered a similar problem by using unity2021 2022-09-26 17-18-09 的屏幕截图