Skip to content

Vision Process

Set Vision Parameters

0x4101 VISION_PARAMETER_SET

json
{
  "cameraType": "customize",
  "robot": 1,
  "vision": {
    "protocol": {
      "addDataInitialPara": "GD001",
      "addDataNum": 5,
      "angleUnit": 0,
      "endMark": "$",
      "failFlag": "NG",
      "frameHeader": "@",
      "hasTCS": true,
      "hasUCS": false,
      "separator": ",",
      "singleTarget": false,
      "successFlag": "OK",
      "timeOut": 30,
      "type": 1
    },
    "socket": {
      "IP": "192.168.1.120",
      "camera_data_type": 0,
      "portNum": 1,
      "portOne": 5050,
      "portTwo": 0,
      "server": true
    },
    "trigger": {
      "IOPort": 0,
      "duration": 1000,
      "intervals": 35,
      "triggerMode": 2,
      "triggerOnce": true,
      "triggerStr": "TRG"
    },
    "userCoordNum": 2
  },
  "visionNum": 0
}

Parameter Description:

Parameter CategoryParameter NameTypeDescription
cameraType-stringCamera type, default "customize"
robot-intRobot number
vision.protocoladdDataInitialParastringAdditional data initial variable
vision.protocoladdDataNumintAdditional data count
vision.protocolangleUnitint0: Degree; 1: Radian
vision.protocolendMarkstringEnd mark
vision.protocolfailFlagstringFailure send flag
vision.protocolframeHeaderstringFrame header
vision.protocolhasTCSboolReceive coordinate system: Tool
vision.protocolhasUCSboolReceive coordinate system: User
vision.protocolseparatorstringSeparator
vision.protocolsingleTargetboolSingle target enable
vision.protocolsuccessFlagstringSuccess send flag
vision.protocoltimeOutintTimeout
vision.protocoltypeint0: 2D, 1: 2D+Height, 2: 3D
vision.socketIPstringCamera IP
vision.socketcamera_data_typeint0: Robot coordinate, 1: Pixel coordinate
vision.socketportNumintNumber of ports
vision.socketportOneintPort 1
vision.socketportTwointPort 2
vision.socketserverbooltrue: Server, false: Client
vision.triggerIOPortintTrigger method: Bound IO port
vision.triggerdurationintDuration
vision.triggerintervalsintTrigger period
vision.triggertriggerModeint1: IO, 2: Ethernet
vision.triggertriggerOncebooltrue: Single, false: Multiple
vision.triggertriggerStrstringTrigger string
visionuserCoordNumintHand-eye calibration user coordinate system
-visionNumintProcess number, starting from 0

Query Vision Parameters

0x4102 VISION_PARAMETER_INQUIRE

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number, starting from 0

Return Vision Parameter Query Result

0x4103 VISION_PARAMETER_RESPOND

json
{
  "cameraList": {
    "currentName": "customize",
    "listNum": 0
  },
  "protocol": {
    "addDataInitialPara": "GD002",
    "addDataNum": 4,
    "angleUnit": 1,
    "endMark": "*",
    "failFlag": "N",
    "frameHeader": "#",
    "hasTCS": true,
    "hasUCS": true,
    "separator": ".",
    "singleTarget": true,
    "successFlag": "OK",
    "timeOut": 31,
    "type": 2
  },
  "socket": {
    "IP": "192.168.1.14",
    "camera_data_type": 1,
    "portNum": 2,
    "portOne": 5052,
    "portTwo": 5051,
    "server": false
  },
  "trigger": {
    "IOPort": 2,
    "duration": 100,
    "intervals": 35,
    "triggerMode": 2,
    "triggerOnce": false,
    "triggerStr": "TG"
  },
  "userCoordNum": 100
}

Return Parameter Description:

Parameter CategoryParameter NameTypeDescription
cameraListcurrentNamestringCurrent camera name
cameraListlistNumintDefault value configuration
protocol(Same as set)-Protocol parameters, see above
socket(Same as set)-Socket parameters, see above
trigger(Same as set)-Trigger parameters, see above
-userCoordNumintUser coordinate system number

Vision Position Parameter Setting

0x4104 VISION_POS_PARAMETER_SET

json
{
  "position": {
    "angleDirection": 1,
    "cameraPoint": [0.0, 0.0, 100.0, 0.0, 0.0, 0.0],
    "datumPoint": [0.0, 0.0, 0.0, 3.140, 0.0, 0.0, 0.0],
    "excursion": {
      "Xexcursion": 1.0,
      "Yexcursion": 2.0,
      "Zexcursion": 3.0,
      "angle": 4.0
    },
    "recvPointsType": 0,
    "scale": 1.0
  },
  "robot": 1,
  "visionNum": 0
}

Parameter Description:

Parameter CategoryParameter NameTypeDescription
positionangleDirectionintAngle direction, 1 or -1
positioncameraPointarrayFirst value X, second value Y, third value height, fourth value angle.
If parameter type is 2D or 2D+H, stores a 4-element array [x,y,H,angle].
If 3D, stores a 6-element array [x,y,z,a,b,c].
positiondatumPointarrayDatum point x,y,z,a,b,c
position.excursionXexcursionfloatX direction offset
position.excursionYexcursionfloatY direction offset
position.excursionZexcursionfloatZ direction offset
position.excursionanglefloatAngle offset
positionrecvPointsTypeintReceived position type: 0: Point, 1: Trajectory
positionscalefloatScale factor
-robotintRobot number
-visionNumintProcess number, starting from 0

Vision Position Parameter Query

0x4105 VISION_POS_PARAMETER_INQUIRE

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number, starting from 0

Return 0x4105 Query Result

0x4106 VISION_POS_PARAMETER_RESPOND

Same as: 0x4104


Query Vision Debug Point List

0x4107 VISION_DEBUGGING_POS_INQUIRE

json
{
  "robot": 1,
  "visionNum": 1,
  "conveyorNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number, starting from 0
conveyorNumintConveyor process number, starting from 1

Return Vision Debug Point List

0x4108 VISION_DEBUGGING_POS_RESPOND

json
{
  "robot": 1,
  "visionNum": 1,
  "originPos": [
    {"X": 0.0, "Y": 0.0, "Z": 0.0, "angle": 0.0},
    {"X": 0.0, "Y": 0.0, "Z": 0.0, "angle": 0.0},
    {"X": 0.0, "Y": 0.0, "Z": 0.0, "angle": 0.0}
  ],
  "currentPos": [
    {"X": 0.0, "Y": 0.0, "Z": 0.0, "angle": 0.0},
    {"X": 0.0, "Y": 0.0, "Z": 0.0, "angle": 0.0},
    {"X": 0.0, "Y": 0.0, "Z": 0.0, "angle": 0.0}
  ]
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number, starting from 0
originPosarrayOriginal position list
currentPosarrayCurrent position list

Clear Vision Debug Point List

0x4109 VISION_DEBUGGING_POS_CLEAR

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number, starting from 0

Take Photo

0x410A VISION_DEBUGGING_TAKE_PICTURE

Power must be enabled before taking a photo

json
{
  "robot": 1,
  "visionNum": 0
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number

Calculate Offset

0x410B VISION_DEBUGGING_CALCULATE

Returns 0x4108

json
{
  "robot": 1,
  "visionNum": 0,
  "conveyorNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
conveyorNumintConveyor process number

Move to This Point

0x410C VISION_DEBUGGING_POS_MOVE

json
{
  "robot": 1,
  "visionNum": 1,
  "type": 1,
  "posNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
typeint0: Trial photo point, 1: Position adjustment point, 2: Grab posture datum point
posNumintPoint number, 1-20

Calibrate Grab Posture

0x4110 VISION_GESTURE_CALIBRATION_SET

After calibration, use 0x4104 to write again

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number

Return Calibration Result

0x4111 VISION_GESTURE_CALIBRATION_RESPOND

json
{
  "datumPoint": [0, 0, 0, 0, 0, 0],
  "datumPointDeg": [0, 0, 0, 0, 0, 0]
}
Parameter NameTypeDescription
datumPointarrayDatum point in radians
datumPointDegarrayDatum point in degrees

Clear Grab Posture Calibration

0x4116 VISION_GESTURE_CALIBRATION_CLEAR

After clearing, use 0x4104 to write again

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number

Trial Photo

0x4112 VISION_TRY_TAKE_PICTURE

json
{
  "visionNum": 1,
  "robot": 1
}
Parameter NameTypeDescription
visionNumintProcess number
robotintRobot number

Return Photo Result

0x4113 VISION_TAKE_PICTURE_RESPOND

json
{
  "cameraData": "",
  "cameraPoint": [0, 0, 0, 0, 0, 0]
}
Parameter NameTypeDescription
cameraDatastringCamera data
cameraPointarrayCamera point. 6 values for 3D camera, otherwise 4

Vision IP Parameter Query

0x4114 VISION_IPPARAM_INQUIRE

json
{
  "visionNum": 1,
  "robot": 1,
  "server": true
}
Parameter NameTypeDescription
visionNumintProcess number
robotintRobot number
serverbooltrue: Server, false: Client

Return 0x4114 Query Result

0x4115 VISION_IPPARAM_RESPOND

json
{
  "visionNum": 1,
  "robot": 1,
  "server": true,
  "IP": "192.168.1.120"
}
Parameter NameTypeDescription
visionNumintProcess number
robotintRobot number
serverbooltrue: Server, false: Client
IPstringIP address

Vision Calibration Parameter Setting

0x4117 VISION_CALIBRATION_PARAM_SET

json
{
  "robot": 1,
  "visionNum": 1,
  "calibration": {
    "point_num": 9,
    "calibrated": false,
    "point": [
      {
        "pixel_pos": [1, 2, 3, 4, 5, 6, 7],
        "robot_pos": [1, 2, 3, 4, 5, 6, 7]
      },
      {
        "pixel_pos": [1, 2, 3, 4, 5, 6, 7],
        "robot_pos": [1, 2, 3, 4, 5, 6, 7]
      }
    ]
  }
}

Parameter Description:

Parameter CategoryParameter NameTypeDescription
-robotintRobot number
-visionNumintProcess number
calibrationpoint_numintNumber of calibration points
calibrationcalibratedboolWhether calibrated
calibration.pointpixel_posarrayPixel coordinates
calibration.pointrobot_posarrayRobot coordinates

Vision Calibration Parameter Query

0x4118 VISION_CALIBRATION_PARAM_INQUIRE

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number

Return 0x4118 Query Result

0x4119 VISION_CALIBRATION_PARAM_RESPOND

json
{
  "calibration": {
    "calibrated": false,
    "point": [
      {
        "pixel_pos": [0, 0, 0, 0, 0, 0, 0],
        "pixel_pos_deg": [0, 0, 0, 0, 0, 0, 0],
        "robot_pos": [0, 0, 0, 0, 0, 0, 0],
        "robot_pos_deg": [0, 0, 0, 0, 0, 0, 0]
      }
    ],
    "point_num": 6
  },
  "robot": 1,
  "visionNum": 0
}

Return Parameter Description:

Parameter CategoryParameter NameTypeDescription
calibrationcalibratedboolWhether calibrated
calibrationpoint_numintNumber of calibration points
calibration.pointpixel_posarrayPixel coordinates in radians
calibration.pointpixel_pos_degarrayPixel coordinates in degrees
calibration.pointrobot_posarrayRobot coordinates in radians
calibration.pointrobot_pos_degarrayRobot coordinates in degrees
-robotintRobot number
-visionNumintProcess number

Mark This Point for Calibration

0x411A VISION_CALIBRATION_MARK_POINT

json
{
  "robot": 1,
  "visionNum": 1,
  "point_num": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
point_numintCalibration point number

Return Response Data for Marking Calibration Point

0x411B VISION_CALIBRATION_MARK_RESPOND

json
{
  "robot": 1,
  "visionNum": 0,
  "point_num": 1,
  "pixel_pos": [1, 2, 3, 4, 5, 6, 7],
  "robot_pos": [1, 2, 3, 4, 5, 6, 7],
  "pixel_pos_deg": [1, 2, 3, 40, 50, 60, 7],
  "robot_pos_deg": [1, 2, 3, 40, 50, 60, 7]
}
Parameter NameTypeDescription
robotintRobot number
visionNumintVision process number
point_numintCalibration point number
pixel_posarrayPixel coordinates
robot_posarrayRobot coordinates
pixel_pos_degarrayPixel coordinates in degrees
robot_pos_degarrayRobot coordinates in degrees

Move to This Point

0x411C VISION_CALIBRATION_MOVE_TO_POINT

json
{
  "robot": 1,
  "visionNum": 1,
  "point_num": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
point_numintCalibration point number

Clear This Point Data

0x411D VISION_CALIBRATION_REMOVE_POINT

json
{
  "robot": 1,
  "visionNum": 1,
  "point_num": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
point_numintCalibration point number

Auto Calibration Run and Calculate

0x411E VISION_CALIBRATION_AUTO_RUN_AND_CALCULATION

json
{
  "robot": 1,
  "visionNum": 1,
  "caculate_type": 0
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
caculate_typeint0: Eye-in-hand

Auto Calibration: Return Pixel Coordinates

0x4120 VISION_CALIBRATION_CAMERA_DATA_RESPOND

json
{
  "robot": 1,
  "visionNum": 1,
  "point_num": 1,
  "pixel_pos": [1, 2, 3, 4, 5, 6, 7],
  "pixel_pos_deg": [1, 2, 3, 40, 50, 60, 7]
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
point_numintPoint number
pixel_posarrayPixel coordinates
pixel_pos_degarrayPixel coordinates in degrees

Calibration Calculation Result

0x4121 VISION_CALIBRATION_CALC_RESPOND

json
{
  "robot": 1,
  "visionNum": 1,
  "result": false
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number
resultbooltrue: Success, false: Error

Cancel Auto Calibration

0x4122 VISION_CALIBRATION_CANCEL_CALCULATION

json
{
  "robot": 1,
  "visionNum": 1
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number

Set Vision Range

0x3F04 VISION_RANGE_SET

json
{
  "robot": 1,
  "visionNum": 0,
  "visionRange": {
    "maxX": "0",
    "maxY": "1.1",
    "maxZ": "222",
    "minX": "0.003",
    "minY": "0",
    "minZ": "0"
  }
}

Parameter Description:

Parameter NameTypeDescription
robotintRobot number, 1~4
visionNumintProcess number, 0~8
visionRange.maxXstringX maximum, empty string "" if not set
visionRange.maxYstringY maximum
visionRange.maxZstringZ maximum
visionRange.minXstringX minimum
visionRange.minYstringY minimum
visionRange.minZstringZ minimum

Query Vision Range

0x3F05 VISION_RANGE_INQUIRE

json
{
  "robot": 1,
  "visionNum": 0
}
Parameter NameTypeDescription
robotintRobot number
visionNumintProcess number

Return Vision Range Query Result

0x3F06 VISION_RANGE_RESPOND

json
{
  "maxX": "",
  "maxY": "1.1",
  "maxZ": "222",
  "minX": "0.003",
  "minY": "0",
  "minZ": "0"
}
Parameter NameTypeDescription
maxXstringX maximum, empty string "" if not set
maxYstringY maximum
maxZstringZ maximum
minXstringX minimum
minYstringY minimum
minZstringZ minimum

Position Calibration Protocol

0x4128 VISION_RANGE_CALIBRATION_POS_INQUIRE

json
{
  "robotid": 1,
  "craftid": 0
}
Parameter NameTypeDescription
robotidintRobot number, 1~4
craftidintProcess number, 0~99

Response to 0x4128

0x4129 VISION_RANGE_CALIBRATION_POS_RESPOND

json
{
  "robotid": 1,
  "craftid": 0,
  "pos": [0, 0, 0, 0, 0, 0, 0]
}
Parameter NameTypeDescription
robotidintRobot number
craftidintProcess number
posarrayCurrent position

#########################Below: Not available in 2207 version#############################

Save Calibration Result

Save the tool hand result of the 2nd type of auto calibration

0x4123 VISION_CALIBRATION_SAVE_RESULT

json
{
  "robot": 1,
  "tool_num": 1,
  "tool_hand": [0, 0, 0, 0, 0, 0]
}
Parameter NameTypeDescription
robotintRobot number
tool_numintTool number
tool_handarrayTool hand data

Hand-Eye Calibration: Calculate Transformation Matrix from Socket Data

0x4124 VISION_CALIBRATION_CALCULATE_BY_SOCKET_DATA

json
{
  "robot": 1,
  "vision_num": 1,
  "calculation_type": 0,
  "base_robot_pos": [0, 0, 0, 0, 0, 0],
  "mark_pos": [
    {
      "robot_pos": [0, 0, 0, 0, 0, 0],
      "camera_pos": [0, 0, 0, 0, 0, 0]
    }
  ]
}

Parameter Description:

Parameter CategoryParameter NameTypeDescription
-robotintRobot number
-vision_numintProcess number, starting from 0
-calculation_typeint0: Eye-in-hand fixed posture hand-eye calibration
1: Eye-in-hand variable posture hand-eye calibration
2: Eye-to-hand hand-eye calibration
-base_robot_posarrayCartesian coordinates
mark_posrobot_posarrayCartesian coordinates
mark_poscamera_posarrayCamera coordinates

Vision Calibration Result Response

0x4125 VISION_CALIBRATION_CALCULATE_BY_SOCKET_DATA_RESPOND

json
{
  "robot": 1,
  "vision_num": 1,
  "result": true,
  "matrix": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}
Parameter NameTypeDescription
robotintRobot number
vision_numintProcess number, starting from 0
resultbooltrue: Success, false: Error
matrixarrayTransformation matrix