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
from pymycobot import ultraArm,utils
if __name__=="__main__":
arm=ultraArm(utils.get_port_list()[0])
arm.go_zero()
Gripper test
from pymycobot import ultraArm,utils
import time
if __name__=="__main__":
arm=ultraArm(utils.get_port_list()[0])
arm.set_gripper_state(50,100)
Servo test
from pymycobot import ultraArm,utils
import time
if __name__=="__main__":
arm=ultraArm(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
from pymycobot import ultraArm,utils
import time
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=ultraArm(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)