get_current_posj
This is a function for checking information on the current joint angle by axis of the robot in the robot controller.
Definition
DRFLEx.h within class CDRFLEx, public section (line 715)
LPROBOT_POSE get_current_posj() {
return _get_current_posj(_rbtCtrl);
};
Parameter
None
Return
Value |
Description |
|---|---|
Refer to the Definition of Structure |
Example
// Retrieve the current joint positions (in radians)
LPROBOT_POSE lpPose = drfl.get_current_posj();
if (lpPose != nullptr) {
printf("Current Joint Angles (rad):\n");
for (int i = 0; i < NUMBER_OF_JOINT; ++i) {
printf(" Joint %d: %.1f\n", (i + 1), lpPose->_fPos[i]);
}
} else {
printf("Failed to retrieve joint positions.\n");
}
This example retrieves the current joint angles of all robot axes from the controller and prints them to the console. Each element in the returned ROBOT_POSE structure represents the current position of a joint in radians (or degrees, depending on the system configuration). This function is commonly used in motion monitoring, calibration routines, or when synchronizing the robot’s state with external systems.