Sample Program 2: Get the Path Planned by Mech-Viz
Program Introduction
Function description |
The robot triggers the Mech-Viz project to run, obtains the path-planning result, and then performs picking. |
Required project |
Mech-Vision project and Mech-Viz 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-Viz project to run |
mm_start_viz: command for triggering the Mech-Viz project to run. Its parameters are shown below.
Therefore, this command means that the robot triggers the vision system to run the Mech-Viz project. Then Mech-Viz plans the robot picking path based on the vision result output by Mech-Vision. |
||
Obtain the planned path and move to each path point |
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 the Mech-Viz project.
|
||
Transfer the planned path |
When status code
|
||
Close communication |
The robot uses mm_close_socket to disconnect the TCP communication connection with the vision system. |