diff --git a/src/bagclient.py b/src/bagclient.py new file mode 100755 index 0000000000000000000000000000000000000000..88f1a82510130856823299e0e88ad608cda4180f --- /dev/null +++ b/src/bagclient.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +import rospy +import time + +from lrs_srvs.srv import * + +def start_recording(ns, uuid, topics): + try: + client = rospy.ServiceProxy(ns + "bag_start_recording", BSStartRecording) + resp = client(uuid, topics) + except rospy.ServiceException, e: + print "Service call failed: %s"%e + exit (1) + return resp + +def stop_recording(ns, uuid): + try: + client = rospy.ServiceProxy(ns + "bag_stop_recording", BSStopRecording) + resp = client(uuid) + except rospy.ServiceException, e: + print "Service call failed: %s"%e + exit (1) + return resp + + +if __name__ == '__main__': + rospy.init_node('bagclient', anonymous=True) + + ns = rospy.get_namespace () + rospy.loginfo ("NAMESPACE: %s", ns) + + uuid = "qwertyyu" + topics = ["/tf", "/uav0/pose"] + + start_recording(ns, uuid, topics) + time.sleep(10) + stop_recording(ns, uuid) + +