Sample Program 3: Get the Path Planned by Mech-Vision
Program Introduction
Function description |
The robot triggers the Mech-Vision project to run, obtains the planned path, and then performs picking. |
Required project |
Mech-Vision project |
Prerequisites |
|
| This sample program is only an example. Modify it according to the actual situation. Do not use it directly. |
Program Explanation
The following is a sample program for reference only.
The following table explains the logic of the preceding program. Click the hyperlink of a command to view its detailed description.
| Workflow | Code and description | ||
|---|---|---|---|
Initialize communication parameters |
mm_init_socket: command for initializing communication. Its parameters are shown below.
Therefore, this command means that the robot uses
|
||
Move to the image-capturing point |
|
||
Establish communication |
The robot uses mm_open_socket to establish a TCP communication connection with the vision system. |
||
Trigger the Mech-Vision project to run |
mm_start_vision: command for triggering the Mech-Vision project to run. Its parameters are shown below.
Therefore, this command means that the robot triggers the vision system to run Mech-Vision project 1 and expects the project to return all path points. |
||
Obtain the planned path |
mm_get_data: command for obtaining data. Its parameters are shown below.
Therefore, this command means that the robot obtains the planned path returned by Mech-Vision project 1.
|
||
Transfer the planned path and move to each path point |
When status code
|
||
Close communication |
The robot uses mm_close_socket to disconnect the TCP communication connection with the vision system. |