Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 import roslib; roslib.load_manifest('hekateros_control')
00033 import rospy
00034 import actionlib
00035
00036 import hekateros_control.msg
00037
00038
00039
00040
00041 class ACCalibrate(object):
00042
00043 def __init__(self):
00044 self.c = actionlib.SimpleActionClient(
00045 'hekateros_control/calibrate_as',
00046 hekateros_control.msg.CalibrateAction)
00047
00048 def exec_calib(self, feedback_handler=None, timeout=1, force_recalib=True):
00049 if self.c.wait_for_server(rospy.Duration(timeout)):
00050 rospy.loginfo("Connected to calibrate action server!")
00051 else:
00052 rospy.logwarn("Unable to connect after {} seconds.".format(timeout))
00053 rospy.logwarn("Is hekateros_control node running???")
00054 return False;
00055
00056 rospy.loginfo("Requesting calibrate action")
00057 goal = hekateros_control.msg.CalibrateGoal()
00058 if force_recalib:
00059 goal.force_recalib = 1
00060 else:
00061 goal.force_recalib = 0
00062 self.c.send_goal(goal, feedback_cb=feedback_handler)
00063 rospy.loginfo("Calibrating - ")
00064 return True
00065
00066 def cancel(self):
00067 self.c.cancel_goal()
00068
00069 def get_action_state(self):
00070 return self.c.get_state()
00071
00072 def get_result(self):
00073 return self.c.get_result()