#!/usr/bin/env python2.7 import rospy import tf2_ros import geometry_msgs.msg from easy_handeye.handeye_calibration import HandeyeCalibration rospy.init_node('handeye_calibration_publisher') while rospy.get_time() == 0.0: pass inverse = rospy.get_param('inverse') calib = HandeyeCalibration.from_file(rospy.get_namespace()) if calib.parameters.eye_on_hand: overriding_robot_effector_frame = rospy.get_param('robot_effector_frame') if overriding_robot_effector_frame != "": calib.transformation.header.frame_id = overriding_robot_effector_frame else: overriding_robot_base_frame = rospy.get_param('robot_base_frame') if overriding_robot_base_frame != "": calib.transformation.header.frame_id = overriding_robot_base_frame overriding_tracking_base_frame = rospy.get_param('tracking_base_frame') if overriding_tracking_base_frame != "": calib.transformation.child_frame_id = overriding_tracking_base_frame rospy.loginfo('loading calibration parameters into namespace {}'.format( rospy.get_namespace())) HandeyeCalibration.store_to_parameter_server(calib)
#!/usr/bin/env python2 import rospy from tf import TransformBroadcaster, TransformerROS, transformations as tfs from geometry_msgs.msg import Transform from easy_handeye.handeye_calibration import HandeyeCalibration rospy.init_node('handeye_calibration_publisher') while rospy.get_time() == 0.0: pass inverse = rospy.get_param('inverse') calib = HandeyeCalibration() calib.from_file() if calib.eye_on_hand: overriding_robot_effector_frame = rospy.get_param('robot_effector_frame') if overriding_robot_effector_frame != "": calib.transformation.header.frame_id = overriding_robot_effector_frame else: overriding_robot_base_frame = rospy.get_param('robot_base_frame') if overriding_robot_base_frame != "": calib.transformation.header.frame_id = overriding_robot_base_frame overriding_tracking_base_frame = rospy.get_param('tracking_base_frame') if overriding_tracking_base_frame != "": calib.transformation.child_frame_id = overriding_tracking_base_frame rospy.loginfo('loading calibration parameters into namespace {}'.format( rospy.get_namespace())) calib.to_parameters()