.. _get_current_tool_flange_posx: get_current_tool_flange_posx ------------------------------------------ This is a function for checking information on the tool flange pose of the robot in the robot controller. At this time, the posture is based on `eTargetRef`. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section (line 723) .. code-block:: cpp LPROBOT_POSE get_current_tool_flange_posx() { return _get_current_tool_flange_posx(_rbtCtrl); }; **Parameter** .. list-table:: :widths: 20 20 20 40 :header-rows: 1 * - **Parameter Name** - **Data Type** - **Default Value** - **Description** * - eTargetRef - :ref:`COORDINATE_SYSTEM ` - COORDINATE_SYSTEM_BASE - Target coordinate reference frame. **Return** .. list-table:: :widths: 25 75 :header-rows: 1 * - **Value** - **Description** * - :ref:`ROBOT_POSE ` - Refer to the Definition of Structure **Example** .. code-block:: cpp // Retrieve current flange pose relative to the base coordinate system LPROBOT_POSE lpCurrentFlange = drfl.get_current_tool_flange_posx(COORDINATE_SYSTEM_BASE); // Retrieve desired pose relative to the tool coordinate system LPROBOT_POSE lpDesiredFlange = drfl.get_desired_posx(COORDINATE_SYSTEM_TOOL); if (lpCurrentFlange && lpDesiredFlange) { printf("Current Flange Pose (Base Frame):\n"); printf(" X: %.1f, Y: %.1f, Z: %.1f\n", lpCurrentFlange->_fX, lpCurrentFlange->_fY, lpCurrentFlange->_fZ); printf(" Rx: %.1f, Ry: %.1f, Rz: %.1f\n", lpCurrentFlange->_fRx, lpCurrentFlange->_fRy, lpCurrentFlange->_fRz); printf("\nDesired Flange Pose (Tool Frame):\n"); printf(" X: %.1f, Y: %.1f, Z: %.1f\n", lpDesiredFlange->_fX, lpDesiredFlange->_fY, lpDesiredFlange->_fZ); printf(" Rx: %.1f, Ry: %.1f, Rz: %.1f\n", lpDesiredFlange->_fRx, lpDesiredFlange->_fRy, lpDesiredFlange->_fRz); // Simple positional deviation check (Euclidean distance) float deltaX = lpDesiredFlange->_fX - lpCurrentFlange->_fX; float deltaY = lpDesiredFlange->_fY - lpCurrentFlange->_fY; float deltaZ = lpDesiredFlange->_fZ - lpCurrentFlange->_fZ; float distanceError = std::sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ); printf("\nTranslation Error (mm): %.2f\n", distanceError); } else { printf("Failed to retrieve flange pose data.\n"); } In this example, the **current flange pose** is obtained in the **base coordinate frame**, while the **desired TCP pose** is retrieved relative to the **tool coordinate frame**. Both poses include **Cartesian position (X, Y, Z)** and **orientation (Rx, Ry, Rz)**. The example calculates the **translational deviation** between the two poses, which can be used to assess **trajectory accuracy**, **tool calibration**, or **alignment performance**.