@@ -80,9 +80,9 @@ def send_ros_service_response(self, srv_id, destination, response):
80
80
if self .queue is not None :
81
81
command = SysCommand_Service ()
82
82
command .srv_id = srv_id
83
- serialized_bytes = ClientThread .serialize_command ("__response" , command )
84
- self . queue . put ( serialized_bytes )
85
- self .send_unity_message ( destination , response )
83
+ serialized_header = ClientThread .serialize_command ("__response" , command )
84
+ serialized_message = ClientThread . serialize_message ( destination , response )
85
+ self .queue . put ( b"" . join ([ serialized_header , serialized_message ]) )
86
86
87
87
def send_unity_message (self , topic , message ):
88
88
if self .queue is not None :
@@ -101,9 +101,9 @@ def send_unity_service_request(self, topic, service_class, request):
101
101
102
102
command = SysCommand_Service ()
103
103
command .srv_id = srv_id
104
- serialized_bytes = ClientThread .serialize_command ("__request" , command )
105
- self . queue . put ( serialized_bytes )
106
- self .send_unity_message ( topic , request )
104
+ serialized_header = ClientThread .serialize_command ("__request" , command )
105
+ serialized_message = ClientThread . serialize_message ( topic , request )
106
+ self .queue . put ( b"" . join ([ serialized_header , serialized_message ]) )
107
107
108
108
# rospy starts a new thread for each service request,
109
109
# so it won't break anything if we sleep now while waiting for the response
0 commit comments