Exemple #1
0
    def __init__(self,
                 starting_poss=None,
                 push_thresh=10,
                 mode='one_arm',
                 arm_mode='first'):
        """
        Initialises parameters and moves the arm to a neutral
        position.
        """
        self.push_thresh = push_thresh
        self._right_neutral_pos = starting_poss[0]
        self._left_neutral_pos = starting_poss[1]
        self._mode = mode
        self._arm_mode = arm_mode

        rospy.loginfo("Creating interface and calibrating gripper")
        self._right_limb = Limb('right')
        self._left_limb = Limb('left')
        self._right_gripper = Gripper('right', CHECK_VERSION)
        self._right_gripper.calibrate()
        self._left_gripper = Gripper('left', CHECK_VERSION)
        self._left_gripper.calibrate()
        self._is_right_fist_closed = False
        self._is_left_fist_closed = False

        rospy.loginfo("Moving to neutral position")
        self.move_to_neutral()
        rospy.loginfo("Initialising PoseGenerator")
        self._pg = PoseGenerator(self._mode, self._arm_mode)
        self._sub_right_gesture = rospy.Subscriber(
            "/low_myo/gesture", UInt8, self._right_gesture_callback)
        self._sub_left_gesture = rospy.Subscriber("/top_myo/gesture", UInt8,
                                                  self._left_gesture_callback)
        self._last_data = None
        self._pg.calibrate()
 def __init__(self,
              limb,
              starting_pos=None,
              push_thresh=100,
              mode='positions',
              rgbd=False):
     self.limb_name = limb
     self._limb = baxter_interface.Limb(self.limb_name)
     self._neutral_pos = starting_pos
     self._mode = mode
     rospy.loginfo("Moving to neutral position")
     self.move_to_neutral()
     rospy.loginfo("Initialising PoseGenerator")
     self._pg = PoseGenerator(limb, self._mode, self._limb.endpoint_pose())