This is with ref to:
|
if (m_ServiceImplementationAsync != null) |
|
{ |
|
response = await m_ServiceImplementationAsync(requestMessage); |
|
} |
|
else |
|
{ |
|
response = m_ServiceImplementation(requestMessage); |
|
} |
While creating a script for ROS 2 services in Unity, i realized that Unity uses same thread for ROS 2 service callback and for the Update function. But I wish to run service callbacks on a different thread and Update on main thread.
I am able to manually do it by changing RosState file and it is working fine.
I would like to know if it is fine to do it this way or not. If there are any issues related to threads for ROS 2 service callbacks, what they can be.
Also, are you considering updating the code for the same?
This is with ref to:
ROS-TCP-Connector/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/RosTopicState.cs
Lines 124 to 131 in c27f00c
While creating a script for ROS 2 services in Unity, i realized that Unity uses same thread for ROS 2 service callback and for the Update function. But I wish to run service callbacks on a different thread and Update on main thread.
I am able to manually do it by changing RosState file and it is working fine.
I would like to know if it is fine to do it this way or not. If there are any issues related to threads for ROS 2 service callbacks, what they can be.
Also, are you considering updating the code for the same?