ROS-TCP-Connector icon indicating copy to clipboard operation
ROS-TCP-Connector copied to clipboard

publish messages from background threads

Open kriegljan opened this issue 3 years ago • 0 comments

The usage of Time.realtimeSinceStartup in RosTopicState.cs allows publishing only from the main thread. Unity throws an error when trying to access Time.realtimeSinceStartup from other threads.

m_LastMessageReceivedRealtime = Time.realtimeSinceStartup;

Possible workarounds could be https://github.com/Unity-Technologies/ROS-TCP-Connector/commit/02c37cb53b4d370cd7dd28e7fe1671563145c0ff m_LastMessageReceivedRealtime = ((float)DateTime.Now.Hour + ((float)DateTime.Now.Minute * 0.01f)); (works somehow, but actually this is not the realtime since startup)

kriegljan avatar Aug 24 '22 07:08 kriegljan