コード例 #1
0
 public void CallService(string service, string args)
 {
     if (_ws != null)
     {
         string s = ROSBridgeMsg.CallService(service, args);
         Debug.Log("Sending " + s);
         _ws.Send(s);
     }
 }
コード例 #2
0
 public void CallService(string service)              // added FBF 20/09/2017 include Callservice without parameters
 {
     if (_ws != null)
     {
         string s = ROSBridgeMsg.CallService(service);
         Debug.Log("Sending " + s);
         _ws.Send(s);
     }
 }
コード例 #3
0
 public void CallService(string service, string args)
 {
     if (WebSocket != null && !IsDisconnecting)
     {
         string s = ROSBridgeMsg.CallService(service, args);
         //Debug.Log("Sending " + s);
         WebSocket.Send(s);
     }
 }
コード例 #4
0
 /// <summary>
 /// Perform a service call with a callback for the response.
 /// </summary>
 /// <param name="handler">The callback function to invoke when the response of the service call arrives.</param>
 /// <param name="service_name">The name of the service to be called.</param>
 /// <param name="id">The ID by which this call is distinguished both to the server and by this class.</param>
 /// <param name="args">The formatted argument string, as specified by the ROSBridge protocol.</param>
 /// <see cref="https://github.com/RobotWebTools/rosbridge_suite/blob/groovy-devel/ROSBRIDGE_PROTOCOL.md"/>
 public void CallService(JSONServiceResponseHandler handler, string service_name, string id, string args = "[]")
 {
     if (_ws != null)
     {
         _pendingServiceResponses[id] = handler;
         string s = ROSBridgeMsg.CallService(service_name, id, args);
         Debug.Log("Sending " + s);
         _ws.Send(s);
     }
 }
コード例 #5
0
        public void CallService(string service, string args)
        {
#if UNITY_EDITOR
            if (_ws != null)
            {
                string s = ROSBridgeMsg.CallService(service, args);
                Debug.Log("Sending " + s);
                _ws.Send(s);
            }
#endif
#if !UNITY_EDITOR
            if (messageWebSocket != null)
            {
                string s = ROSBridgeMsg.CallService(service, args);
                dataWriter.WriteString(s);
                dataWriter.StoreAsync();
            }
#endif
        }