當前位置: 首頁>>代碼示例>>Python>>正文


Python baxter_interface.Gripper方法代碼示例

本文整理匯總了Python中baxter_interface.Gripper方法的典型用法代碼示例。如果您正苦於以下問題:Python baxter_interface.Gripper方法的具體用法?Python baxter_interface.Gripper怎麽用?Python baxter_interface.Gripper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在baxter_interface的用法示例。


在下文中一共展示了baxter_interface.Gripper方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self, arm):
        """ Initialize and start actionlib server. """
        self.as_goal = {'left': baxterGoal(), 'right': baxterGoal()}
        self.as_feed = {'left': baxterFeedback(), 'right': baxterFeedback()}
        self.as_res = {'left': baxterResult(), 'right': baxterResult()}
        self.action_server_left = actionlib.SimpleActionServer("baxter_action_server_left", baxterAction,
                                                               self.execute_left, auto_start=False)
        self.action_server_right = actionlib.SimpleActionServer("baxter_action_server_right", baxterAction,
                                                                self.execute_right, auto_start=False)

        self.left_arm = Limb('left')
        self.right_arm = Limb('right')
        self.left_gripper = Gripper('left')
        self.right_gripper = Gripper('right')
        self.left_gripper.calibrate()

        self.arm = arm 
開發者ID:mkrizmancic,項目名稱:qlearn_baxter,代碼行數:19,代碼來源:BaxterArmServer.py

示例2: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self):
        self.gripper = baxter_interface.Gripper('left')
        self.values = []
        self.acc_x = []
        self.acc_y = []
        self.acc_z = []
        self.eff = []
        self.gripperAperture = []
        self.time1 = []
        self.time2 = []
        self.time3 = [] 
開發者ID:correlllab,項目名稱:cu-perception-manipulation-stack,代碼行數:13,代碼來源:getAccEff.py

示例3: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self, limb_name, gripper=None):
        self.limb_name = limb_name
        self.limb = baxter_interface.Limb(limb_name)
        if gripper is None:
            self.gripper = baxter_interface.Gripper(limb_name)
        else:
            self.gripper = gripper(limb_name)

        # Enable actuators (doesn't seem to work?) I need to rosrun
        # robot_enable.py -e
        baxter_interface.RobotEnable().enable()
        # Calibrate gripper
        self.gripper.calibrate() 
開發者ID:correlllab,項目名稱:cu-perception-manipulation-stack,代碼行數:15,代碼來源:demo_graspEventdetect.py

示例4: gripperApertureNode

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def gripperApertureNode():
    gripper = baxter_interface.Gripper('left')
    rospy.init_node('gripperApertureNode')
    pub = rospy.Publisher('/gripperAperture_values', Int32, queue_size=1)
    rate = rospy.Rate(20)
    while not rospy.is_shutdown():
        ap = gripper.position()
        pub.publish(ap)
        rate.sleep() 
開發者ID:correlllab,項目名稱:cu-perception-manipulation-stack,代碼行數:11,代碼來源:gripperApertureNode.py

示例5: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self, limb_name, gripper=None):
		self.limb_name = limb_name
		self.limb = baxter_interface.Limb(limb_name)
		if gripper is None:
			self.gripper = baxter_interface.Gripper(limb_name)
		else:
			self.gripper = gripper(limb_name)
		baxter_interface.RobotEnable().enable() 
開發者ID:correlllab,項目名稱:cu-perception-manipulation-stack,代碼行數:10,代碼來源:gripperalignment.py

示例6: map_keyboardL

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def map_keyboardL(self):
		rs = baxter_interface.RobotEnable(CHECK_VERSION)
		init_state = rs.state().enabled
		limb_0 = baxter_interface.Gripper(self.limb_name, CHECK_VERSION)	   
		#baxter_interface.Limb(limb_name).set_joint_position_speed(0.7)	  
		self.move((0,1,0),0.01) 
開發者ID:correlllab,項目名稱:cu-perception-manipulation-stack,代碼行數:8,代碼來源:gripperalignment.py

示例7: map_keyboard

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def map_keyboard(self):
        # initialize interfaces
        print("Getting robot state... ")
        rs = baxter_intercontrollerface.RobotEnable(CHECK_VERSION)
        init_state = rs.state().enabled
        limb_0 = baxter_interface.Gripper(self.limb_name, CHECK_VERSION)

        done = False
        print("Enabling robot... ")
        rs.enable()
        print("Controlling grippers. Press ? for help, Esc to quit.")
        while not done and not rospy.is_shutdown():
            c = baxter_external_devices.getch()
            if c:
                if c in ['\x1b', '\x03']:
                    done = True
                elif c == 'a':
                    rospy.loginfo("%s is pressed" %c)
                    self.move((0,-1,0),0.05)
                elif c == 'd':
                    rospy.loginfo("%s is pressed" %c)
                    self.move((0,1,0),0.05)
                elif c == 'w':
                    rospy.loginfo("%s is pressed" %c)
                    self.move((-1,0,0),0.05)
                elif c == 's':
                    rospy.loginfo("%s is pressed" %c)
                    self.move((1,0,0),0.05)
                elif c == 'z':
                    rospy.loginfo("%s is pressed" %c)
                    self.move((0,0,-1),0.05)
                elif c == 'x':
                    rospy.loginfo("%s is pressed" %c)
                    self.move((0,0,1),0.05)

                else:
                    print("Not implement it yet...")

        rospy.signal_shutdown("Move.py finished.") 
開發者ID:correlllab,項目名稱:cu-perception-manipulation-stack,代碼行數:41,代碼來源:demo_graspsuccessExp.py

示例8: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self, arm):

        # initialise arm communication channel
        if arm == "right":
            self.pub = rospy.Publisher('arm_rendezvous_right', String, queue_size=5)
            self.sub = rospy.Subscriber('arm_rendezvous_left', String, self.store_sub)
            self.RZsub = rospy.Subscriber('rendezvous_point', String, self.store_RZsub) #Right listens for RZ point
        elif arm == "left":
            self.pub = rospy.Publisher('arm_rendezvous_left', String, queue_size=5)
            self.sub = rospy.Subscriber('arm_rendezvous_right', String, self.store_sub)
            self.RZpub = rospy.Publisher('rendezvous_point', String, queue_size=5) #Left sends the RZ point
        else:
            print "ERROR - initialisation - no valid arm selected"
            return
        print "Rendezvous Channel Initialised"
        self.state = 0 #Initial State
        self.sub_data = 0 #Initial State
        self.RZ = ""
        # initialise ros node
        self.rate = rospy.Rate(5) #5hz when continuously sending

        # gripper ("left" or "right")
        self.gripper = baxter_interface.Gripper(arm)

        # arm ("left" or "right")
        self.limb           = arm
        self.limb_interface = baxter_interface.Limb(self.limb) 
開發者ID:AndrewChenUoA,項目名稱:baxter_socket_server,代碼行數:29,代碼來源:baxter_arm_control.py

示例9: calibrateGripper

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def calibrateGripper(self):
        # gripper ("left" or "right")
        self.gripper = baxter_interface.Gripper(self.limb)
        self.gripper.calibrate()

    #Send a state number to the other node 
開發者ID:AndrewChenUoA,項目名稱:baxter_socket_server,代碼行數:8,代碼來源:baxter_arm_control.py

示例10: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self):
		"""
		BaxterManipulator control from torch - Initialisation
		"""
		# Publishers
		self._pub_rate = rospy.Publisher('robot/joint_state_publish_rate', UInt16, queue_size=10)
		self.image_pub = rospy.Publisher("baxter_view",Image,queue_size=4)
		self._obj_state = rospy.ServiceProxy("/gazebo/set_model_state",SetModelState)
		
		# Link with baxter interface
		self._left_arm  = baxter_interface.limb.Limb("left")
		self._right_arm = baxter_interface.limb.Limb("right")
		self._left_joint_names = self._left_arm.joint_names()
		self.grip_left = baxter_interface.Gripper('left', CHECK_VERSION)

		print("Getting robot state... ")
		self._rs = baxter_interface.RobotEnable(CHECK_VERSION)
		self._init_state = self._rs.state().enabled
		print("Enabling robot... ")
		self._rs.enable()
		
		# Control parameters
		self._rate  = 500.0  # Hz
		self._pub_rate.publish(self._rate)
		self.bridge = CvBridge()
		self._left_arm.set_joint_position_speed(0.3)
		self._object_type = 0 
開發者ID:powertj,項目名稱:baxter_dqn,代碼行數:29,代碼來源:baxter_robot_class.py

示例11: main

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def main():
    rospy.init_node('execute')
    rs = baxter_interface.RobotEnable(CHECK_VERSION)
    rs.enable()

    arm = baxter_interface.Limb('left')
    gripper = baxter_interface.Gripper('left')

    gripper.calibrate()

    def open_grippers(msg):
        if msg.state == DigitalIOState.PRESSED:
            gripper.open()

    rospy.Subscriber('/robot/digital_io/left_upper_button/state', DigitalIOState, open_grippers)

    # target position
    target_x = 0.7
    target_y = 0.3
    initial_z = 0.1
    target_z = -0.17
    target_theta = np.pi / 4

    planar_grasp(arm, gripper, target_x, target_y, initial_z, target_z, target_theta)
    rospy.spin()
    print 'executed trajectory'

    return 0 
開發者ID:falcondai,項目名稱:robot-grasp,代碼行數:30,代碼來源:ik_execute.py

示例12: __init__

# 需要導入模塊: import baxter_interface [as 別名]
# 或者: from baxter_interface import Gripper [as 別名]
def __init__(self):
        # Physical interfaces
        self.limb = baxter_interface.limb.Limb(arm)
        self.gripper = baxter_interface.Gripper(arm)
        self.head = baxter_interface.Head()

        # Virtual attributes
        self.angle_corrected = False
        self.finished = 3
        self.moving = False
        self.tol = pixel_tolerance
        self.prev_err = 0
        self.finder = vis_tools.thing_finder(cv2.imread(thing_path,
                                                        cv2.IMREAD_GRAYSCALE))

        # Gripper center coordinates
        self.gx = center_x
        self.gy = center_y

        # Get range to surface in meters
        self.dist = float(baxter_interface.analog_io.AnalogIO(
            arm + '_hand_range').state() / 1000.0)

        # Set arm speed
        self.limb.set_joint_position_speed(speed)

        # Calibrate gripper
        if not self.gripper.calibrated():
            self.gripper.calibrate()

        # Prepare for image processing
        self.bridge = CvBridge()
        self.image_sub = rospy.Subscriber(
            '/cameras/' + arm + '_hand_camera/image', Image, self.callback,
            queue_size=1) 
開發者ID:destrygomorphous,項目名稱:baxter,代碼行數:37,代碼來源:fetch_cp.py


注:本文中的baxter_interface.Gripper方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。