get_robot_link_info
This function queries the controller for the robot’s link (DH) parameters and fills the provided ROBOT_LINK_INFO structure. Typical fields contain per-joint Denavit–Hartenberg parameters (e.g., a, d, α, θ), link lengths, and auxiliary metadata used for kinematic computations.
Definition
DRFLEx.h within class CDRFLEx, public section
bool get_robot_link_info(ROBOT_LINK_INFO& out, int timeout_ms = 300) {
return _get_robot_link_info(_rbtCtrl, &out, timeout_ms);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
out |
Output structure that will be populated with the robot’s link/DH parameters. |
||
timeout_ms |
int |
300 |
Timeout for the query in milliseconds. |
Return
Value |
Type |
Description |
|---|---|---|
0 |
int |
Error — failed to retrieve link information (timeout or communication error). |
1 |
int |
Success — out structure was filled with the current link parameters. |
Example
// Connect, select robot system, etc... (omitted)
ROBOT_LINK_INFO link{};
if (drfl.get_robot_link_info(link, 500)) {
// Example: iterate joints and print DH-like parameters if provided by your firmware
for (int j = 0; j < NUMBER_OF_JOINT; ++j) {
printf("[J%d] a=%.6f, d=%.6f, alpha=%.6f, theta=%.6f\n",
j+1,
link.a[j],
link.d[j],
link.alpha[j],
link.theta[j]);
}
} else {
fprintf(stderr, "get_robot_link_info() failed (timeout or comm error)\n");
}
This example requests the controller’s DH/link parameters and prints them joint-by-joint. Field names shown (_fA, _fD, _fAlpha, _fTheta) reflect common DH notation.