Unity-Technologies/ROS-TCP-Connector

publish messages from background threads

ipa-jsk opened this issue · 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
02c37cb
m_LastMessageReceivedRealtime = ((float)DateTime.Now.Hour + ((float)DateTime.Now.Minute * 0.01f)); (works somehow, but actually this is not the realtime since startup)