For information on the latest version, please have a look at 1.33.5.
get_current_posx
This function calculates the posture and solution space of the current task coordinate system. The posture is based on eTargetRef.
Definition
DRFLEx.h within class CDRFLEx, public section
LPROBOT_TASK_POSE get_current_posx(COORDINATE_SYSTEM eCoodType = COORDINATE_SYSTEM_BASE) {
return _get_current_posx(_rbtCtrl, eCoodType);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
eCoodType |
COORDINATE_SYSTEM_BASE |
Target coordinate reference frame. |
Return
Value |
Description |
|---|---|
Refer to the Definition of Structure |
Note
This call waits for the controller to answer.
The returned pointer refers to storage in the CDRFLEx object that other DRFL calls and every reconnect reuse; copy the structure before making another DRFL call. The 3-argument ikin returns its result in storage shared by all CDRFLEx objects in the process instead; see ikin. Except for get_user_home, the pointer is never NULL; do not use a NULL check to detect failure.
Example
LPROBOT_TASK_POSE result = drfl.get_current_posx();
float* pos = new float[NUM_TASK];
int sol = result->_iTargetSol;
memcpy(pos, result->_fTargetPos, sizeof(float) * NUM_TASK);
This example retrieves the robot’s current task-space position and orientation with respect to the base coordinate system (COORDINATE_SYSTEM_BASE). The returned ROBOT_TASK_POSE structure includes both position vectors and the current solution index, allowing users to analyze or store the robot’s spatial state at runtime.