Adapter Generator Guide

This section introduces the steps for using Adapter Gnerator to generate an Adapter program rapidly.

Introduction of the Adapter Generator

Adapter Generator is a built-in component of Mech-Center. It applies to scenarios where vision results are provided by Mech-Vision only and a TCP/IP Socket is used for the communication.

With the Adapter Generator, you can:

  • Generate an Adapter program rapidly and create an Adapter project.

  • Learn to program Adapter to meet complex actual requirements.

Select Tool ‣ Adapter Generator to open the Adapter Generator and follow the instructions to set up.

../../../../_images/adapter_generator01.png

Attention

The Adapter Generator is only available in the Administrator mode.

Generate an Adapter Program

Hint

You can hover over the options to view the tooltips.

Network Config—Server or Client

Please set the parameters Adapter name, Adapter’s role, and Stream Format in this step, and then click Next.

../../../../_images/adapter_generator02.png

Parameters:

  • Adapter name: specifies the name of the Adapter program.

  • Adapter’s role: specifies the Adapter as a server or client. If the Adapter functions as a client and there is a port restriction on the server, please check Bind Port.

    Hint

    In order to achieve successful communication, please make sure the host address is configured correctly in Deployment Settings. Please refer to Deployment for detailed instructions.

  • Stream Format: specifies the format for data transmission. ASCII string and HEX are supported. If HEX is selected, you will need to choose between Big endian and Little endian.

Mech-Viz/Mech-Vision Config—Poses and JPs

Hint

  • Before this step, please prepare an executable Mech-Vision project and a Mech-Viz project used for collision detection. Please enable Autoload in the toolbar of Mech-Viz, and right-click the project name in the Projects List in Mech-Vision and select Autoload Project. Then make sure the Mech-Vision project and Mech-Viz project are loaded in Mech-Center.

  • Mech-Center provides an example project used for collision detection, which is stored in tool\viz_project\check_collisionin in the installation directory of Mech-Center.

Attention

As the workflow of check_collision example project, the Task visual_look triggers the camera to capture images. Non-move-type Tasks must be included in the workflow. Please do not modify the names of Tasks, or else an error may occur.

Please configure parameters related to Mech-Vision and Mech-Viz projects, and then click on Next.

../../../../_images/adapter_generator03.png

Parameters related to Mech-Vision

  • Mech-Vision project name: select the Mech-Vision project that communicates with Adapter in the drop-down list.

  • Num of poses: select the number of poses to be sent to the peer device.

  • Pose type: select whether to use quaternions or Euler angles to represent the poses.

  • Pose units: the unit used for the poses; usually in millimeter and degree.

  • Camera Installation: chooses the camera installation methods, including ETH and EIH.

  • Reference frame of poses: the robot base reference frame is usually used as the reference frame of poses. For scenarios using EIH, when the pose of robot flange cannot be provided, only the tool reference frame can be used.

  • Decimal precision: the precision of the pose data. The maximum number of decimal places is 10.

Parameters related to Mech-Viz

  • Use Mech-Viz for collision detection: select this option to detect collisions on the vision points. Pick points from unsuccessful planning will be filtered, and collision-free pick points will be kept.

  • Mech-Viz Config: this option is only available when Use Mech-Viz for collision detection is selected. Click the Mech-Viz Config button to open the Mech-Viz Config For Generator window. After configuring relevant parameters, click Save.

    ../../../../_images/adapter_generator04.png
  • Need to distinguish Picking and Placing Poses: the picking pose refers to all poses before the visual_move Task (including the pose of visual_move Task), and the place pose refers to poses after the visual_move Task.

  • Need to send Pick and Place poses Number: if there are many targets, the number of poses can be sent as well.

  • Need to send motion type of every pose(moveJ or moveL): the motion type of the move-type Tasks, including moveJ and moveL.

  • Update Code: the code for moveJ is 1, and the code for moveL is 2 by default. You can also customize the code. After modification, click Update Code to apply the settings.

  • Jps or Pose: the format of the poses; Jps is selected by default. If Pose is selected, please go to Others panel in Mech-Viz and select Send TCP.

  • Unit of Jps/Unit of Pose: when Jps is selected, degree is usually used as the unit. When Pose is selected, and the pose is represented by quaternions, millimeter is usually used as the unit; when the pose is represented by Euler angles, millimeter and degree are usually used as the unit.

  • Robot Name: click Get Robot Name to autoload the name of the robot. The simulated robot in Mech-Viz should be based on a real robot. Adapter will simulate the service of the real robot. Please make sure the robot name here is the same as the one in Mech-Viz.

  • Home Jps(Unit: Radian): set the home position of the robot in Mech-Viz. The unit is radian. Please use commas to connect the numbers. You can add a move Task in the workflow and set its JPs as the home position, and then copy the JPs.

Stream Receive Config—Fields to Receive

Please set the format of the field, including photo command, multiple projects (instruction code), dynamically switch templates (template instruction code), as well as the total number of fields, field types, field separators and sub-field separators. After the configuration, click on Next.

../../../../_images/adapter_generator06.png

Functions:

  • Total Num of Fields: related to the number of parameters that need to be set, and the value range is 1~10. There must be a camera command in the field.

  • Photo Command: the photo command sent from external devices to Mech-Mind software system, which triggers the camera to capture images. When the stream format is ASCII string, it is recommended to use English letters to represent the command. For example, use letter p as the command and the field position is 1 by default. When the communication format is hexadecimal (HEX), an integer in hexadecimal format is required, such as 0xff or ff.

  • Field Separator and Sub-Field Separator: only need to be set when the communication format is ASCII string. If there are more than two fields, you need to fill in the field separator; if there are additional separators in the additional information, the sub-field separator is also necessary, and you can specify the start and end range of the sub-field.

  • Field Type and Description: It needs to be set when the communication format is hexadecimal (HEX). The available types are CHAR, SHORT, INT, FLOAT, and DOUBLE. You can describe the function in the Description.

  • Multi Vision: This setting is optional. When there are multiple Vision projects in a project, different Vision projects need to be called according to external commands, and the command codes are configurable.

    Attention

    The command code and the field position of each project should be unique.

Robot Config—Eye in Hand

Hint

This step is only available when Camera Installation is set to Eye In Hand in the previous Mech-Viz/Mech-Vision Config—Poses and JPs step.

Please set the robot pose when capturing images in this step and then click Next.

../../../../_images/adapter_generator09.png

Parameters:

  • Need robot send Jps/Flange Pose to Adapter when taking photo: if the object pose in the robot base reference frame needs to be sent to the peer device, JPs or flange pose when the robot captures images are needed. After checked this option, you can select between JPs and flange pose.

  • Unit of Jps: unit of joint positions; radian and degree are supported.

  • Unit of Flange Pose: unit of the flange pose. When Quaternion is selected, millimeter and meter are available units; when the pose is represented by Euler angles, millimeter and degree are uavailable units.

  • Jps/Flange Pose Position From: It is the position of the start and end fields of the pose in the total field.

Attention

The index position starts counting from 1, and the index position 1 is the camera instruction!

  • Robot Name: The name used to identify the robot service, which needs to be consistent with the robot name in Mech-Viz.

  • Dof of Robot: the degree of freedom of the robot. Only 4-axis and 6-axis robots are supported currently. Please select the corresponding robot degree of freedom according to the actual project.

Stream Send Config—Fields to Send

Please set the format of the poses to be sent in this step, and then click on Next.

../../../../_images/adapter_generator10.png

Parameters:

  • Field Separator and Sub-Field Separator: only need to be set when the communication format is ASCII. If there are more than two fields, you need to fill in the field separator; if there are additional separators in the additional information, the sub-field separator is also necessary, and you can specify the start and end range of the sub-field.

  • Status Code: Set the sending status, each status corresponds to a unique status code.

  • Need Check Cloud: After checking, the point clouds will be checked, if the point clouds does not exist, the corresponding status code will be output.

  • Need Send Object Label: Sending object labels means to send to the peer device according to the label recognized by Vision, each label is connected to the Pose; when the peer device is inconvenient to parse the label string, you can also specify the code of the corresponding label, which needs to load the label file of all label strings. It should be noted that the label file format must be in JSON array format.

  • Need Send Num of Pose: Sends the number of Pose of this time.

  • Need Fixed Body: When the vision is not recognized, send a message to the peer device (the message after the error code).

  • Need Fixed Tail: After checking it, a fixed tail mark will be added after the data.

Attention

When the communication format is hexadecimal (HEX), it is necessary to set the status code, the number of poses, and the numeric type of poses.

After configuring all the above settings, click Finish or Save project as to save the Adapter project.

Please refer to Deployment for instructions on how to deploy the Adapter project.

For more information about programming and development on Adapter, please refer to Adapter Programming Guide and Adapter Programming Examples.