public void RegisterRosService(string responseMessageName, int queueSize)
 {
     m_IsRosService = true;
     m_ConnectionInternal.SendRosServiceRegistration(m_Topic, m_RosMessageName);
     m_ServiceResponseTopic = new RosTopicState(m_Topic, responseMessageName, m_Connection, m_ConnectionInternal, MessageSubtopic.Response);
     CreateMessageSender(queueSize);
 }
 public void ImplementService <TRequest, TResponse>(Func <TRequest, TResponse> implementation, int queueSize)
     where TRequest : Message
     where TResponse : Message
 {
     m_ServiceImplementation = (Message msg) =>
     {
         return(implementation((TRequest)msg));
     };
     m_ConnectionInternal.SendUnityServiceRegistration(m_Topic, m_RosMessageName);
     m_ServiceResponseTopic = new RosTopicState(m_Topic, m_RosMessageName, m_Connection, m_ConnectionInternal, MessageSubtopic.Response);
     CreateMessageSender(queueSize);
 }
示例#3
0
 internal RosTopicState(string topic, string rosMessageName, ROSConnection connection, ROSConnection.InternalAPI connectionInternal, bool isService, MessageSubtopic subtopic = MessageSubtopic.Default)
 {
     m_Topic              = topic;
     m_Subtopic           = subtopic;
     m_RosMessageName     = rosMessageName;
     m_Connection         = connection;
     m_ConnectionInternal = connectionInternal;
     if (isService && subtopic == MessageSubtopic.Default)
     {
         m_ServiceResponseTopic = new RosTopicState(topic, rosMessageName, m_Connection, m_ConnectionInternal, isService, MessageSubtopic.Response);
     }
 }