.. _get_current_tool_flange_posx: get_current_tool_flange_posx ------------------------------------------ This function returns the tool flange pose of the robot. The pose is always expressed in the BASE coordinate system. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp LPROBOT_POSE get_current_tool_flange_posx() { return _get_current_tool_flange_posx(_rbtCtrl); }; **Parameter** |br| None **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(); if (lpCurrentFlange) { printf("Current Flange Pose (Base Frame):\n"); printf(" X: %.1f, Y: %.1f, Z: %.1f\n", lpCurrentFlange->_fPosition[0], lpCurrentFlange->_fPosition[1], lpCurrentFlange->_fPosition[2]); printf(" Rx: %.1f, Ry: %.1f, Rz: %.1f\n", lpCurrentFlange->_fPosition[3], lpCurrentFlange->_fPosition[4], lpCurrentFlange->_fPosition[5]); } else { printf("Failed to retrieve flange pose data.\n"); } In this example, the **current flange pose** is obtained in the **base coordinate frame**. The pose includes **Cartesian position (X, Y, Z)** and **orientation (Rx, Ry, Rz)** of the tool flange, independent of the TCP set on the robot.