Go to the documentation of this file.00001
00002
00003
00004
00005 import rospy
00006 import roslib; roslib.load_manifest('rsync_ros')
00007 import actionlib
00008 import rsync_ros.msg
00009 import sys
00010
00011 def rsync_client():
00012
00013
00014
00015 client = actionlib.SimpleActionClient('rsync_ros', rsync_ros.msg.RsyncAction)
00016
00017
00018
00019 client.wait_for_server()
00020
00021
00022 goal = rsync_ros.msg.RsyncGoal(rsync_args=sys.argv[1:-2], source_path=sys.argv[-2], destination_path=sys.argv[-1])
00023
00024
00025 client.send_goal(goal)
00026
00027
00028 client.wait_for_result()
00029
00030
00031 return client.get_result()
00032
00033 if __name__ == '__main__':
00034 try:
00035
00036
00037 rospy.init_node('rsync_client')
00038 result = rsync_client()
00039 print "Successful Transfer: {}".format(result.sync_success)
00040
00041 except rospy.ROSInterruptException:
00042 print "program interrupted before completion"