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 |
|---|---|---|---|
| unsigned char | None | Measurement mode (0: 4-point method, 1: 6-point method) |
| float | None | Stick-out value (mm) |
| float[9][NUMBER_OF_JOINT] | None | Target positions (X, Y, Z coordinates for 9 joints) |
Return
Return Value | Data Type | Description |
|---|---|---|
|
| Structure representing the TCP measurement results |
Example
// 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);
}