11-17-2023, 02:00 AM
Pretty much the title. For a 6DoF robot, this prevents any external axes from being set using the C API.
Current code for reference:
I tried just changing it in robodk_api_c.c and it seems to have worked:
It worked in the one test I did, but I have no way of knowing this isn't overwriting beyond the allocated memory when RoboDK receives it, so it would be good to get confirmation from you that this is well-supported before I commit it.
Additionally, if `struct Joints_t` supports up to `RDK_SIZE_JOINTS_MAX`, then `Item_SetJoints` should also support up to `RDK_SIZE_JOINTS_MAX` joints. If that is not the case, it should be loudly documented. Issues like this can cost users hours of pointless debugging...
Current code for reference:
Code:
void Item_SetJoints(const struct Item_t* inst, struct Joints_t jnts) {
double angles[6];
angles[0] = jnts._Values[0];
angles[1] = jnts._Values[1];
angles[2] = jnts._Values[2];
angles[3] = jnts._Values[3];
angles[4] = jnts._Values[4];
angles[5] = jnts._Values[5];
_RoboDK_check_connection(inst->_RDK);
_RoboDK_send_Line(inst->_RDK, "S_Thetas");
_RoboDK_send_Array(inst->_RDK, angles, jnts._nDOFs);
_RoboDK_send_Item(inst->_RDK, inst);
_RoboDK_check_status(inst->_RDK);
}
I tried just changing it in robodk_api_c.c and it seems to have worked:
Code:
void Item_SetJoints(const struct Item_t* inst, struct Joints_t jnts) {
double angles[7];
angles[0] = jnts._Values[0];
angles[1] = jnts._Values[1];
angles[2] = jnts._Values[2];
angles[3] = jnts._Values[3];
angles[4] = jnts._Values[4];
angles[5] = jnts._Values[5];
angles[6] = jnts._Values[6];
_RoboDK_check_connection(inst->_RDK);
_RoboDK_send_Line(inst->_RDK, "S_Thetas");
_RoboDK_send_Array(inst->_RDK, angles, jnts._nDOFs);
_RoboDK_send_Item(inst->_RDK, inst);
_RoboDK_check_status(inst->_RDK);
}
It worked in the one test I did, but I have no way of knowing this isn't overwriting beyond the allocated memory when RoboDK receives it, so it would be good to get confirmation from you that this is well-supported before I commit it.
Additionally, if `struct Joints_t` supports up to `RDK_SIZE_JOINTS_MAX`, then `Item_SetJoints` should also support up to `RDK_SIZE_JOINTS_MAX` joints. If that is not the case, it should be loudly documented. Issues like this can cost users hours of pointless debugging...