<<<<<<< HEAD

Robot gripper carrying wooden block example

1 Functional description

The robot will use the gripper to carry the wooden block from point A to point B

2 Hardware connection

Insert one side of the Lego connector into the gripper

Then insert the other side of the Lego connector into the quick-change servo

Both sides of the Lego connector are plugged in tightly

Connect the gripper wire to any interface of the quick-change servo

Connect the quick-change servo wire to the other side interface of the quick-change servo, and then connect it to the gripper socket of the robot arm base

Install the quick-change servo to the end of the robot arm

3 Module test

After the hardware is connected, the robot arm needs to be reset

机器人夹爪搬运木块案例

1 功能说明

机器人会使用夹爪将木块从A点搬运到B点

2 硬件连接

将乐高连接键的一侧插入夹爪中

然后乐高连接键的另一侧插入快换舵机中

乐高连接键的两侧都插紧

将夹爪的线接到快换舵机的任意一个接口上

将快换舵机线接入到快换舵机的另一侧接口上,然后接入到机械臂底座的夹爪插口上

将快换舵机安装到机械臂末端上

3 模块测试

硬件连接好后,需要对机械臂执行回零

482c782c42e70f0b2e44445345f6461e795f9189 ```python from pymycobot import ultraArmP340,utils

if name=="main": arm=ultraArmP340(utils.get_port_list()[0]) arm.go_zero()

<<<<<<< HEAD
**Gripper test**
=======

**夹爪测试**

>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
```python
from pymycobot import ultraArmP340,utils
import time

if __name__=="__main__":
<<<<<<< HEAD
    arm=ultraArmP340(utils.get_port_list()[0])
    arm.set_gripper_state(50,100)

Servo test

arm=ultraArmP340(utils.get_port_list()[0])    
arm.set_gripper_state(50,100)

**舵机测试**

>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
```python
from pymycobot import ultraArmP340,utils
import time

if __name__=="__main__":
<<<<<<< HEAD
    arm=ultraArmP340(utils.get_port_list()[0])
    arm.set_gripper_state(50,100)

4 Software Usage

Use the fast moving function of myblockly to teach the grabbing point and placement point of the wooden block, and record the position information. After teaching, you need to disconnect the serial port, otherwise the serial port will be reported when running the python script. The error is that the serial port is occupied.

5 Composite Application

======= arm=ultraArmP340(utils.get_port_list()[0])
arm.set_gripper_state(50,100)


## 4 软件使用

利用myblockly的快速移动功能,对木块的抓取点和放置点进行示教,并且记录下位置信息,示教完后,需要断开串口的连接,否则会在运行python脚本时,报串口被占用的错误

![](./img/blockly.png)

## 5 复合应用

>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
```python
from pymycobot import ultraArmP340,utils
import time

<<<<<<< HEAD
grab_point=[217.26, 68.87, 8.0, 27.0]#Grab point coordinates
place_point=[217.26, -114.13, 10.0, 27.0]#Placement point coordinates

if __name__=="__main__":
    arm=ultraArmP340(utils.get_port_list()[0])
    arm.set_gripper_state(100,100)#Open the gripper first
    arm.set_angles([0,0,0,0],100)#Return to the zero point of the joint
    time.sleep(2)
    arm.set_coords([grab_point[0],grab_point[1],grab_point[2]+50,grab_point[3]],100)#Move to 50mm above the grab point
    time.sleep(2)
    arm.set_coords([grab_point[0],grab_point[1],grab_point[2],grab_point[3]],100)#Move to the grab point
    time.sleep(2)
    arm.set_gripper_state(0,100) #Clamp the gripper
    time.sleep(2)
    arm.set_coords([grab_point[0],grab_point[1],grab_point[2]+50,grab_point[3]],100)#Move to 50mm above the grab point
    time.sleep(2)

    arm.set_coords([place_point[0],place_point[1],place_point[2]+50,place_point[3]],100)#Move to 50mm above the placement point
    time.sleep(2)
    arm.set_coords([place_point[0],place_point[1],place_point[2],place_point[3]],100)#Move to the placement point
    time.sleep(2)
    arm.set_gripper_state(100,100)#Gripper open
    time.sleep(2)
    arm.set_coords([place_point[0],place_point[1],place_point[2]+50,place_point[3]],100)#Move to 50mm above the placement point
    time.sleep(2)

6 Effect display

======= grab_point=[217.26, 68.87, 8.0, 27.0]#抓取点坐标 place_point=[217.26, -114.13, 10.0, 27.0]#放置点坐标

if name=="main": arm=ultraArmP340(utils.get_port_list()[0]) arm.set_gripper_state(100,100)#夹爪先张开
arm.set_angles([0,0,0,0],100)#回到关节零点 time.sleep(2) arm.set_coords([grab_point[0],grab_point[1],grab_point[2]+50,grab_point[3]],100)#运动到抓取点上方50mm time.sleep(2) arm.set_coords([grab_point[0],grab_point[1],grab_point[2],grab_point[3]],100)#运动到抓取点 time.sleep(2) arm.set_gripper_state(0,100) #夹爪夹紧 time.sleep(2) arm.set_coords([grab_point[0],grab_point[1],grab_point[2]+50,grab_point[3]],100)#运动到抓取点上方50mm time.sleep(2)

arm.set_coords([place_point[0],place_point[1],place_point[2]+50,place_point[3]],100)#运动到放置点上方50mm
time.sleep(2)
arm.set_coords([place_point[0],place_point[1],place_point[2],place_point[3]],100)#运动到放置点
time.sleep(2)
arm.set_gripper_state(100,100)#夹爪张开 
time.sleep(2) 
arm.set_coords([place_point[0],place_point[1],place_point[2]+50,place_point[3]],100)#运动到放置点上方50mm
time.sleep(2)

```

6 效果展示

482c782c42e70f0b2e44445345f6461e795f9189

results matching ""

    No results matching ""