<<<<<<< HEAD
Robot suction pump to carry wooden blocks
1 Functional description
The robot will use the suction pump to carry wooden blocks from point A to point B
2 Hardware connection
Insert one side of the Lego connection key into the suction pump
Then insert the other side of the Lego connection key into the quick-change servo, and then insert the gripper wire into the interface on either side of the servo
Then connect it to the gripper socket of the robot arm base
Connect one end of the suction pump wire to the suction pump box
Connect the other end of the suction pump wire to the suction pump interface of the robot arm
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
**Pump test**
=======
**吸泵测试**
>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
```python
from pymycobot import ultraArmP340,utils
import time
if __name__=="__main__":
<<<<<<< HEAD
arm=ultraArmP340(utils.get_port_list()[0])
=======
arm=ultraArmP340(utils.get_port_list()[0])
>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
arm.set_gpio_state(0)
time.sleep(2)
arm.set_gpio_state(1)
time.sleep(1)
<<<<<<< HEAD
Servo 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)
## 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 connection, 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脚本时,报串口被占用的错误
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_gpio_state(0)#Turn off the suction pump 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_gpio_state(0) #Turn on the suction pump 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_gpio_state(1)#Turn off the suction pump
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_gpio_state(0)#吸泵先关闭
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_gpio_state(0) #打开吸泵
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_gpio_state(1)#关闭吸泵
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