For information on the latest version, please have a look at 1.33.5.
set_ref_coord (Manual Mode)
This section explains how to use set_ref_coord during Manual (Teach) operations. This function sets the reference coordinate system of the controller.
To jog in or read positions in BASE, TOOL or a USER frame, pass that frame to the function itself: jog and the motion functions take eMoveReference, and get_current_posx takes eCoodType.
Typical usage
Set the controller reference coordinate system to BASE, TOOL or a USER frame.
Select a USER-defined coordinate frame before performing teaching or calibration.
Validate coordinate alignment during multi-frame teaching workflows.
Note
Jog and motion functions use their own
eMoveReferenceargument;set_ref_coorddoes not change it.
Example: Switch to TOOL frame for precise end-effector teaching
// Preconditions:
// - Connection established (open_connection)
// - Manual (Teach) mode active
// 1) Set the controller reference coordinate system to TOOL
if (drfl.set_ref_coord(COORDINATE_SYSTEM_TOOL))
printf("[Frame] Reference coordinate set to TOOL frame.\n");
else
printf("[Frame] Failed to set reference coordinate.\n");
// 2) Display current TCP position in TOOL frame
LPROBOT_TASK_POSE pPose = drfl.get_current_posx(COORDINATE_SYSTEM_TOOL);
printf("[TOOL Frame Position]\n");
printf("X: %.1f Y: %.1f Z: %.1f\n", pPose->_fTargetPos[0], pPose->_fTargetPos[1], pPose->_fTargetPos[2]);
// 3) Switch back to BASE frame when done
drfl.set_ref_coord(COORDINATE_SYSTEM_BASE);
printf("[Frame] Reference coordinate reverted to BASE frame.\n");
Tips
Use this function in combination with get_current_posx to verify pose consistency.
In complex calibration, switching between frames helps validate tool and user frame accuracy.