Skip to main content
Skip table of contents

measure_welding_tcp

Features

This function measures the welding TCP (Tool Center Point) using the specified measurement mode and stick-out value. For measurement, the robot moves to 9 target positions specified in the fTargetPos array. The measurement results are stored in the LPMEASURE_TCP_RESPONSE structure. This structure includes the TCP position (X, Y, Z, RX, RY, RZ) and measurement status information.

Arguments

Argument Name

Data Type

Default Value

Description

iMode

unsigned char

None

Measurement mode (0: 4-point method, 1: 6-point method)

fStickout

float

None

Stick-out value (mm)

fTargetPos

float[9][NUMBER_OF_JOINT]

None

Target positions (X, Y, Z coordinates for 9 joints)

Return

Return Value

Data Type

Description

result

LPMEASURE_TCP_RESPONSE

Structure representing the TCP measurement results

Example

CODE
// Set TCP measurement mode
unsigned char iMode = 0; // Measurement mode (0: 4-point method, 1: 6-point method)

// Set stick-out value
float fStickout = 50.0; // Stick-out value (mm)

// Set target positions (X, Y, Z coordinates for 9 joints)
float fTargetPos[9][NUMBER_OF_JOINT] = {
  {0.0, 0.0, 0.0}, // Joint 1 position
  {100.0, 0.0, 0.0}, // Joint 2 position
  {100.0, 100.0, 0.0}, // Joint 3 position
  {0.0, 100.0, 0.0}, // Joint 4 position
  // ... remaining joint positions
};

// Declare a structure to store the TCP measurement results
LPMEASURE_TCP_RESPONSE result;

// Call the measure_welding_tcp function
result = Drfl.measure_welding_tcp(iMode, fStickout, fTargetPos);

if (result._iResult == 0) {
  printf("Welding TCP measurement successful\n");
  printf("TCP X: %f, Y: %f, Z: %f, RX: %f, RY: %f, RZ: %f\n", 
          result._fTCPPos[0], result._fTCPPos[1], result._fTCPPos[2], 
          result._fTCPPos[3], result._fTCPPos[4], result._fTCPPos[5]);
} else {
  printf("Welding TCP measurement failed (Error code: %d)\n", result._iResult);
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.