Example Program 15: MM_S15_Viz_GetDoList
Program Introduction
Description |
After obtaining the picking path and DO signals, the robot can perform picking by moving to the picking waypoint and setting the DO signals in a loop. This example program is used in depalletizing scenarios, and the tool used by the robot is a multi-section vacuum gripper. |
File path |
You can navigate to the installation directory of Mech-Vision and Mech-Viz and find the file by using the |
Project |
Mech-Vision project and Mech-Viz project (the tool is a depalletizing vacuum gripper) |
Prerequisites |
|
This example program is provided for reference only. Before using the program, please modify the program according to the actual scenario. |
Program Description
This part describes the MM_S15_Viz_GetDoList example program.
Compared with the MM_S2_Viz_Basic example program, this example program contains only the following modification (the code of this modification is bolded). As such, only the feature of handling errors based on the different error codes is described in the following part. For information about the parts of MM_S6_Viz_ErrorHandle that are consistent with those of MM_S2_Viz_Basic, see Example Program 2: MM_S2_Viz_Basic. |
1: !-------------------------------- ;
2: !FUNCTION: trigger Mech-Viz ;
3: !project, then get planned path ;
4: !and gripper control signal using ;
5: !command 210 ;
6: !Mech-Mind, 2023-12-25 ;
7: !-------------------------------- ;
8: ;
9: !set current uframe NO. to 0 ;
10: UFRAME_NUM=0 ;
11: !set current tool NO. to 1 ;
12: UTOOL_NUM=1 ;
13: !move to robot home position ;
14:J P[1] 100% FINE ;
15: !initialize communication ;
16: !parameters(initialization is ;
17: !required only once) ;
18: CALL MM_INIT_SKT('8','127.0.0.1',50000,5) ;
19: !move to image-capturing position ;
20:L P[2] 1000mm/sec FINE ;
21: !trigger Mech-Viz project ;
22: CALL MM_START_VIZ(2,10) ;
23: !get planned path ;
24: CALL MM_GET_PLNDT(0,3,51,52,53) ;
25: !check whether planned path has ;
26: !been got from Mech-Viz ;
27: !successfully ;
28: IF R[53]<>2100,JMP LBL[99] ;
29: !get gripper control signal list ;
30: CALL MM_GET_DL(0,0) ;
31: !save waypoints of the planned ;
32: !path to local variables one ;
33: !by one ;
34: CALL MM_GET_PLJOP(1,3,60,61,62,63,64,70) ;
35: CALL MM_GET_PLJOP(2,3,61,91,92,93,94,100) ;
36: CALL MM_GET_PLJOP(3,3,62,121,122,123,124,130) ;
37: !follow the planned path to pick ;
38: !move to approach waypoint ;
39: !of picking ;
40:J PR[60] 50% FINE ;
41: !move to picking waypoint ;
42:J PR[61] 10% FINE ;
43: !add object grasping logic here ;
44: PAUSE ;
45: !set gripper control signal ;
46: CALL MM_SET_DL(0) ;
47: !move to departure waypoint ;
48: !of picking ;
49:J PR[62] 50% FINE ;
50: !move to intermediate waypoint ;
51: !of placing ;
52:J P[3] 50% CNT100 ;
53: !move to approach waypoint ;
54: !of placing ;
55:L P[4] 1000mm/sec FINE Tool_Offset,PR[2] ;
56: !move to placing waypoint ;
57:L P[4] 300mm/sec FINE ;
58: !add object releasing logic here, ;
59: !such as "DO[1]=OFF" ;
60: PAUSE ;
61: !move to departure waypoint ;
62: !of placing ;
63:L P[4] 1000mm/sec FINE Tool_Offset,PR[2] ;
64: !move back to robot home position ;
65:J P[1] 100% FINE ;
66: END ;
67: ;
68: LBL[99:vision error] ;
69: !add error handling logic here ;
70: !according to different ;
71: !error codes ;
72: !e.g.: status=2038 means no ;
73: !point cloud in ROI ;
74: PAUSE ;
The workflow corresponding to the above example program code is shown in the figure below.
The table below describes the bolded code. You can click the hyperlink to the command name to view its detailed description.
Feature | Code and description | ||
---|---|---|---|
Obtain the planned path |
|
||
Obtain the gripper DO list |
|
||
Store the planned path |
The entire statement “CALL MM_GET_PLJOP(1,3,60,61,62,63,64,70)” indicates that the pose, motion type, tool ID, velocity, custom data, and Vision Move data for the first waypoint are stored in the specified registers.
|
||
Move to the picking waypoint to perform picking |
The above statement indicates that the robot moves to the picking waypoint (PR[61]) and then runs the MM_SET_DL command to set gripper DO signals to perform picking. |