get_user_cart_coord
This function retrieves the pose and reference coordinate system of the specified user coordinate system (iReqId). It returns detailed information such as the coordinate’s origin, orientation, and base reference.
This function is available in M2.5 or higher versions.
Definition
DRFLEx.h within class CDRFLEx, public section
LPUSER_COORDINATE get_user_cart_coord(int iReqId) {
return _get_user_cart_coord(_rbtCtrl, iReqId);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
iReqId |
int |
The ID of the user coordinate system to be retrieved. |
Return
Value |
Description |
|---|---|
Pointer to the structure containing the user coordinate information. |
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
// Define and register a new user coordinate system
float pos[6] = {10.0f, 20.0f, 30.0f, 0.0f, 0.0f, 0.0f};
int coord_id = drfl.set_user_cart_coord(0, pos);
// Retrieve the coordinate system information
LPUSER_COORDINATE coord = drfl.get_user_cart_coord(coord_id);
printf("User Coord ID: %d | Origin: (%.2f, %.2f, %.2f)\n",
coord_id,
coord->_fTargetPos[0], coord->_fTargetPos[1], coord->_fTargetPos[2]);
This example creates a user-defined coordinate system, retrieves its stored pose and reference information using the coordinate ID, and prints the origin position.