当前位置: 首页>>代码示例>>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;未经允许,请勿转载。