Commands¶
Command 101: Start Mech-Vision Project¶
This command starts the running of the Mech-Vision project, which executes image capturing, and performs vision recognition.
If the project works in the eye-in-hand mode, the robot pose for image capturing needs to be transmitted by this command into the project.
This command is for scenarios using only Mech-Vision.
Input Parameters¶
Parameters |
Description |
Vision_Proj_Num |
Mech-Vision project number |
Req_Pose_Num |
Expected number of vision points |
Robot_Pose_Type |
Robot pose type |
Robot_Pose |
Robot pose |
Start_Vision |
Trigger signal |
Mech-Vision project number
The integer ID number of the Mech-Vision project in Mech-Center, i.e., the number shown on the left of the project path in
in Mech-Center. The number can be adjusted by dragging the projects.
Expected number of vision points
The number of vision points (i.e., vision poses and their corresponding point clouds, labels, indices, etc.) to expect Mech-Vision to output.
0
Get all the vision points from the Mech-Vision project’s recognition results.
integers > 0
Get the specified number of vision points.
If the total number of vision points is smaller than the parameter value, all the available vision points will be returned.
If the total number of vision points is greater than or equal to the parameter value, vision points in the quantity of the parameter value will be returned.
Hint
The command to get the vision points is command 102. Under default settings, a maximum of 20 visual points can be obtained by executing command 102 once. If more than 20 poses need to be obtained, please repeat executing command 102.
Robot pose type
This parameter indicates the type of the image-capturing pose of the real robot to input to Mech-Vision.
0
: No robot pose needs to be transmitted by this command. If the project works in the eye-to-hand mode, then image capturing has nothing to do with the robot’s pose, so no robot image-capturing pose is needed by Mech-Vision.
1
: The robot pose transmitted by this command is in JPs.
2
: The robot pose transmitted by this command is a flange pose.
Robot pose
This parameter is the robot pose needed when the project works in the eye-in-hand mode.
The robot pose is either in JPs or flange pose, according to the setting of the parameter “robot pose type”.
Data type: DINT Array[0–5], which is an array of six DINT numbers.
Note
The floating-point numbers of JPs and flange poses need to be multiplied by 10000 first, converted into 32-bit signed integers, and then set to the Robot_Pose array.
Trigger signal
This signal triggers the running of the Mech-Vision project. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 1102 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
When there is a rising edge on the tag Camera_User.Start_Vis, it triggers the operation of Mech-Vision Project 1, expecting that Mech-Vision Project 1 returns the vision result, and PLC sends the JPs data to Mech-Center when the Mech-Vision project is triggered.
Command 102: Get Vision Target(s)¶
This command gets the vision targets, i.e., robot TCPs to reach the object poses contained in the vision points, after executing command 101.
Mech-Center automatically transforms the object poses in the vision points to their corresponding robot TCPs. The process is as follows:
Rotate the poses around their Y axes by 180 degrees.
Determine whether the definition of the reference frame used by the robot model involves robot base height, and add a vertical offset accordingly.
Note
By default, command 102 can only fetch at most 20 targets at a time. So, command 102 may need to be repeatedly executed until all the targets required are obtained.
Input Parameters¶
Parameters |
Description |
Vision_Proj_Num |
Mech-Vision project number |
Get_VisData |
Command trigger signal |
Data_Ready |
Data readable signal |
Send_Pose_Num |
Number of targets |
Start_Empty |
Data clearing trigger signal |
Mech-Vision project number
The integer ID number of the Mech-Vision project in Mech-Center, i.e., the number shown on the left of the project path in
in Mech-Center. The number can be adjusted by dragging the projects.
Command trigger signal
This signal triggers this command. The rising edge does the trigger.
Data readable signal
This signal is used to indicate that the pose data is readable, and it is specially used when receiving multiple sets of robot pose data.
Number of targets
The number of targets returned from the Mech-Vision project by executing this command this time.
Data clearing trigger signal
This signal is used to trigger clearing of acquired TCP and label data. The high segment does the trigger.
Output Parameters¶
Parameters |
Description |
Target_Pose |
All TCPs obtained this time |
Target_Label |
All labels obtained this time |
All TCPs obtained this time
The information contained in a single TCP includes space coordinates (XYZ) and orientation in Euler angles (ABC).
All labels obtained this time
The integer labels assigned to the object poses. If in the Mech-Vision project, the labels are strings, they need to be mapped to integers before outputting from the Mech-Vision project using Step Label Mapping. If there are no labels in the Mech-Vision project, the labels default to 0s.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 1100 will be returned. Otherwise, the corresponding error code will be returned.
FromCamera.SEND_POSE_TYPE: robot pose type
This module’s value defaults to 2, meaning the robot poses are in the form of TCPs, not JPs.
Example¶
In this example, when the label Camera_User.Get_VisData has a rising edge, the vision result of Mech-Vision project 1 will be obtained.
When the label Camera_User.Start_Empty is set to high, the obtained data of Camera_User.Target Pose and Camera_User.Target Label will be cleared.
Command 103: Switch Mech-Vision Recipe¶
This command switches the parameter recipe used by the Mech-Vision project.
In Mech-Vision, you can change the settings of a group of parameters by switching the parameter recipe.
Parameters involved in recipe switching usually include point cloud matching model, image matching template, ROI, confidence threshold, etc.
This command needs to be used before executing command 101 which starts the Mech-Vision project.
Input Parameters¶
Parameters |
Description |
+———————————– |
|
Vision_Proj_Num |
Mech-Vision project number |
Vision_Recipe_Num |
Recipe number |
Switch_Recipe |
Trigger signal |
Mech-Vision project number
The integer ID number of the Mech-Vision project in Mech-Center, i.e., the number shown on the left of the project path in
in Mech-Center. The number can be adjusted by dragging the projects.
Recipe number
The ID number of the parameter recipe to switch to, i.e., the number on the left of the parameter recipe name in
in Mech-Vision.Recipe number range: 1—99.
Trigger signal
This signal is used to switch the recipe of the Mech-Vision project. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 1107 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Switch_Recipe has a rising edge, the recipe of Mech-Vision project 1 will be switched to recipe 2.
Command 201: Start Mech-Viz Project¶
This command is for scenarios using both Mech-Vision and Mech-Viz.
This command starts the running of the Mech-Viz project, calls the corresponding Mech-Vision project, and lets the Mech-Viz project plan the robot path based on the vision points from Mech-Vision.
For the Mech-Viz project that needs starting, the option Autoload needs to be checked in Mech-Viz’s interface.
Please see Example Mech-Viz Projects for Standard Interface for the description of example Mech-Viz projects.
Input Parameters¶
Parameters |
Description |
Robot_Pose_Type |
Pose type |
Robot_Pose |
Robot pose |
Start_Viz |
Trigger signal |
Pose type
0
The current pose of the robot is not needed by Mech-Viz and no pose will be sent.
If the project works in the eye-to-hand mode, no robot image-capturing pose will be needed by the project.
In Mech-Viz, the simulated robot will move from the initial pose JPs = [0, 0, 0, 0, 0, 0] to the first target in the planned path.
1
The robot pose will be sent to Mech-Viz and the pose sent is in the form of JPs.
In Mech-Viz, the simulated robot will move from the input initial pose (i.e., the pose sent by this command) to the first target in the planned path.
TCP is not supported at present.
Note
If in the scene, there are barriers that stand in the way from the initial pose JPs = [0, 0, 0, 0, 0, 0] to the first target in the planned path, the pose type must be set to 1.
Robot pose
The current JPs of the real robot (if pose type is set to 1).
Note
Before setting as the value of the pose module, the numerical values of the pose need to be multiplied by 10000, to transform floating point numbers into integers.
Trigger signal
This signal triggers the Mech-Viz project to run. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 2103 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Start_Viz has a rising edge, the Mech-Viz project will be triggered to run, and the current joint positions of the robot will be sent to Mech-Center.
Command 202: Stop Mech-Viz Project¶
This command stops the running of the Mech-Viz project. This command is needed only when the Mech-Viz project fall into an infinite loop or cannot be stopped normally.
Input Parameters¶
Parameters |
Description |
Stop_Viz |
Trigger signalss |
Trigger signal
This signal stops the Mech-Viz project from running. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 2104 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Stop_Viz has a rising edge, the Mech-Viz project will be stopped.
Command 203: Select Mech-Viz Branch¶
This command specifies which branch the project should run along. For this command, the branching is implemented by a branch_by_msg Task, and this command selects the branch by specifying an exit port of the Task.
Before executing this command, the Mech-Viz project needs to be started by executing command 201.
When the Mech-Viz project runs to the branch_by_msg Task, it will wait for command 203 to specify which exit port of the Task, i.e., the branch, the project should run along.
Input Parameters¶
Parameters |
Description |
Branch_Name |
Branching Task ID |
Branch_Exit_Port |
Exit port number |
Set_Branch |
Trigger signal |
Branching Task ID
This parameter is for specifying which branch_by_msg Task the branch selection should apply to.
The Task ID can be read in the Task’s parameters.
Exit port number
This parameter is for specifying which exit port of the specified Task, i.e., the branch, the project should run along. The value should be an integer ([1, N]).
Note
An exit port number is the 1-based index of the specified exit port on the Task. For example, if the specified exit port is the second exit port of the Task from left to right, the exit port number is 2.
Note
Branch_Name, Branch_Exit_Port and Index_Name and Index_Counter in the function MM_Set_Index correspond to the same VIZ_TASK_NAME and VIZ_TASK_VALUE labels of ToCamera respectively. If the values to be set are different, they cannot take effect at the same time.
Trigger signal
This signal is used to trigger the branch setting. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 2105 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Set_Branch has a rising edge, it will specify that the Mech-Viz project takes exit 1 when executing on the branching task with task ID 1.
Command 204: Set Move Index¶
This command is for setting the index parameter of a Task that involves sequential or separate motions or operations.
Tasks with index parameters include move_list, move_grid, custom_pallet_pattern, smart_pallet_pattern, etc.
Before executing this command, command 201 needs to be executed to start the Mech-Viz project.
Input Parameters¶
Parameters |
Description |
Index_Name |
Task ID |
Index_Counter |
Index value |
Set_Index |
Trigger signal |
Task ID
This parameter specifies which Task the index setting should apply to.
The Task ID can be read in the Task’s parameters.
Index value
The index value that should be set the next time this Task is executed.
When this command is sent, the current index value in Mech-Viz will become the parameter value minus 1.
When the Mech-Viz project runs to the task specified by this command, the current index value in Mech-Viz will be increased by 1 to become the parameter’s value.
Trigger signal
This signal is used to trigger the setting of the index value, The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 2106 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Set_Index has a rising edge, the current index value of task 5 in the Mech-Viz project will be set to 4-1 = 3.
When the project runs to this step, the index value becomes 4.
Command 205: Get Planned Path¶
This command gets the robot motion path planned by Mech-Viz after command 201 is executed to start the Mech-Viz project.
Input Parameters¶
Parameters |
Description |
Req_Pose_Type |
Target type |
Get_VizData |
Trigger signal |
Data_Ready |
Data readable indicator signal |
Send_Pose_Num |
Number of targets sent |
Start_Empty |
Data clearing trigger signal |
Target type
This parameter specifies the type of poses in the path targets to return from Mech-Viz.
1
: The targets returned should be in JPs.
2
: The targets returned should be in TCP.
Trigger signal
This signal is used to trigger the acquisition action of the Mech-Viz project’s planned path. The rising edge does the trigger.
Data readable indicator signal
This signal is used to indicate that the pose data is readable, and it is specially used when receiving multiple sets of robot pose data.
Number of targets sent
This parameter indicates the number of path targets ([pose, label, velocity]) sent by executing this command this time.
Default range: 0–20.
Note
By default, command 205 can only send at most 20 targets at a time. So, command 205 may need to be repeatedly executed until all the targets required are sent.
Data clearing trigger signal
Trigger to clear the acquired data of Target_Pose, Target_Label and Target_Speed. The high segment does the trigger.
Output Parameters¶
Parameters |
Description |
Target_Pose |
Poses in targets sent this time |
Target_Label |
Labels in targets sent this time |
Target_Speed |
Velocities in targets sent this time |
Poses in targets sent this time
A pose includes Cartesian coordinates (XYZ) and Euler angles (ABC), or JPs, according to the pose type set by command 205.
Labels in targets sent this time
Label is the integer label assigned to the pose. If in the Mech-Vision project, the labels are strings, they need to be mapped to integers before outputting from the Mech-Vision project using Step Label Mapping. If there are no labels in the Mech-Vision project, the label defaults to 0.
Velocities in targets sent this time
A velocity value is the non-zero velocity parameter percentage value for the move-type Task set in Mech-Viz.
Attention
Please refer to Communication Control Flowchart for detailed instructions of sending and receiving poses using signals Data_ready, Data_Acknowledge, Command_Complete.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 2100 will be returned. Otherwise, the corresponding error code will be returned.
Note
When executing this command, if Mech-Viz has not yet had the planned robot motion path (the project is still running), Mech-Center will wait. The default wait time is 10 seconds. If a timeout occurs, a timeout error code will be returned.
FromCamera.VISUAL_POINT_INDEX: position of “visual_move”
The position of the visual_move Task, i.e., the move to the vision pose (usually the pose for picking the object) in the entire robot motion path.
For example, if the path is composed of Tasks move_1, move_2, visual_move, move_3 sequentially, the position of visual_move is 3.
If in the path there is no visual_move Task, the returned value will be 0.
Example¶
In this example, when the label Camera_User.Get_VizData has a rising edge, the robot movement path returned by Mech-Viz will be fetched, and the data type of the targets is TCP.
Command 206: Get DO List¶
- This command gets the planned DO signal list when there are multiple grippers, such as suction cup sections, to control.
For using this command:
In the parameters of the “set_do_list” Task:
Check “StandardInterface” under “Receiver”
Check “Get DO List from VisualMove”
Select a “visual_move” Task that needs the DO signal list at the bottom of the parameter panel
Before calling this command, command 205 needs to be executed to obtain the planned motion path by Mech-Viz.
Please deploy the Mech-Viz project based on the template project at /Mech-Center/tool/viz_project/suction_zone, and set the suction cup configuration file in the Mech-Viz project.
Input Parameters¶
Parameters |
Description |
Get_DoList |
Trigger signals |
Trigger signal
This signal is used to trigger the action of getting the list of DO signals. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there are no errors, status code 2102 will be returned. Otherwise, the corresponding error code will be returned.
FromCamera.DO_LIST: DO signal list
There are 64 DO signal values, in integers, located at the tail of the data returned.
Range of valid DO values: [0, 999].
Placeholder value: -1.
Example¶
In this example, when the label Camera_User.Get_DoList has a rising edge, the DO list planned by Mech-Viz will be saved into the DO array.
Command 501: Input Object Dimensions to Mech-Vision¶
This command is for dynamically inputting object dimensions into the Mech-Vision project.
Please confirm the actual object dimensions before running the Mech-Vision project.
The Mech-Vision project should have the Read Object Dimensions Step, and the Step’s parameter Read Object Dimensions from Parameters should be set to True
.
Input Parameters¶
Parameters |
Description |
Vision_Proj_Num |
Mech-Vision project number |
External_Input_Box_Dimension |
Object dimensions |
Set_Box_Dimension |
Trigger signal |
Mech-Vision project number
The integer ID number of the Mech-Vision project in Mech-Center, i.e., the number shown on the left of the project path in
in Mech-Center. The number can be adjusted by dragging the projects.
Object dimensions
The object dimensions (length, width, and height) to input to the Mech-Vision project.
Those values will be read by the Read Object Dimensions Step.
Unit: mm
Note
The actual object dimensions need to be multiplied by 10000 before being passed to External_Input_Box_Dimension.
Note
Here External_Input_Box_Dimension and the function MM_Set_Pose External_Input_Pose correspond to the same EXT_INPUT_DATA label of ToCamera. If the values to be set are different, they cannot take effect at the same time.
Trigger signal
This signal is used to trigger the action of passing the object dimensions to Mech-Vision. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 1108 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Set_Box_Dimension has a rising edge, the object dimensions in Step Read Object Dimensions in the Mech-Vision project will be set to the value of External_Input_Box_Dimension[0–2].
Command 502: Input TCP to Mech-Viz¶
This command is for dynamically inputting robot TCP into the Mech-Viz project.
The Task that receives the robot TCP is outer_move.
Please deploy the Mech-Viz project based on the template project at /Mech-Center/tool/viz_project/outer_move, and put the outer_move Task to a proper position in the workflow.
This command needs to be executed before executing command 201.
Input Parameters¶
Parameters |
Description |
External_Input_Pose |
Robot TCP |
Set_Input_Pose |
Trigger signal |
Robot TCP
The TCP data used to set the target for the Task outer_move.
Note
Please multiply the original TCP data (unit: mm) by 10,000 before setting the parameter.
Trigger signal
This signal is used to trigger the action of setting the TCP. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
If there is no error, status code 2107 will be returned. Otherwise, the corresponding error code will be returned.
Example¶
In this example, when the label Camera_User.Set_Pose has a rising edge, the pose data in the pose label External_Input_Pose[0–5] will be sent to the outer_move task of Mech-Viz.
Command 901: Get Software Status¶
This command is designed for checking the software running status of Mech-Vision, Mech-Viz, and Mech-Center. At present, this command only supports checking whether Mech-Vision is ready for running the project.
Input Parameters¶
Parameters |
Description |
Get_Status |
Trigger signal |
Trigger signal
This signal is used to trigger the action of obtaining the software status. The rising edge does the trigger.
Data Returned by Global Label FromCamera¶
FromCamera.STATUS_CODE: status code
Software status. 1101 means the Mech-Vision project is ready to run. Other codes mean the project is not ready.
Example¶
In this example, when the tag Camera_User.Get_Status has a rising edge, the status code obtained by checking the system status will be saved to the label FromCamera.STATUS_CODE.