service_client.py
Go to the documentation of this file.
1 import json
2 import rospy
3 
4 from skyway.srv import *
5 from gstreamer_launcher.srv import *
6 
7 
8 def skyway_control(json_str):
9  rospy.wait_for_service("skyway_control")
10  try:
11  controller = rospy.ServiceProxy("skyway_control", SkyWayControl)
12  response = controller(json_str)
13  rospy.logdebug(response)
14  return json.loads(response.response)
15  except rospy.ServiceException as e:
16  rospy.logerr(f"Service call failed: {e}")
17 
18 
19 def skyway_event(peer_id, token):
20  rospy.wait_for_service("skyway_events")
21  try:
22  recv_event = rospy.ServiceProxy("skyway_events", SkyWayEvents)
23  event = recv_event()
24  rospy.logdebug(event)
25  return json.loads(event.response)
26  except rospy.ServiceException as e:
27  rospy.logerr(f"Service call failed: {e}")
28 
29 
30 def gst_launch(message_type, command, pid):
31  rospy.wait_for_service("gst_launch")
32  try:
33  controller = rospy.ServiceProxy("gst_launch", GStreamerLauncher)
34  result = controller(message_type, command, pid)
35  return (result.result, result.pid)
36  except rospy.ServiceException as e:
37  rospy.logerr(f"Service call failed: {e}")
srv
srv
utils.service_client.gst_launch
def gst_launch(message_type, command, pid)
Definition: service_client.py:30
utils.service_client.skyway_event
def skyway_event(peer_id, token)
Definition: service_client.py:19
utils.service_client.skyway_control
def skyway_control(json_str)
Definition: service_client.py:8


skyway
Author(s): Toshiya Nakakura
autogenerated on Thu Oct 26 2023 02:42:21