def MoveToDeg(target_deg):
    target = int(((((target_deg - min_deg) / (max_deg - min_deg)) * (max_val - min_val)) + min_val))
    dev.SetTarget(target)
    pos = float(dev.GetPos())
    disable_tf_publisher[0] = True
    while (pos != target):
        deg = ((((pos - min_val) / (max_val - min_val)) * (max_deg - min_deg)) + min_deg)
        tf_broadcaster.sendTransform((0, 0, 0), tf.transformations.quaternion_from_euler(0, (((- deg) / 180.0) * math.pi), 0), (rospy.Time.now() + rospy.Duration(time_adj)), rotating_frame, fixed_frame)
        latest_deg[0] = deg
        rospy.loginfo('Degree: %f, Value: %f', deg, pos)
        pos = float(dev.GetPos())
    disable_tf_publisher[0] = False
def MoveToDeg(target_deg):
    target = int(((((target_deg - min_deg) / (max_deg - min_deg)) * (max_val - min_val)) + min_val))
    dev.SetTarget(target)
    pos = float(dev.GetPos())
    disable_tf_publisher[0] = True
    while (pos != target):
        deg = ((((pos - min_val) / (max_val - min_val)) * (max_deg - min_deg)) + min_deg)
        tf_broadcaster.sendTransform((0, 0, 0), tf.transformations.quaternion_from_euler(0, (((- deg) / 180.0) * math.pi), 0), (rospy.Time.now() + rospy.Duration(time_adj)), rotating_frame, fixed_frame)
        latest_deg[0] = deg
        rospy.loginfo('Degree: %f, Value: %f', deg, pos)
        pos = float(dev.GetPos())
    disable_tf_publisher[0] = False