Hi all,
we would like to command KUKA iiwa 14 with joint torques via FRI. Our initial approach is to set the robot to Joint Impedance Control, set joint stiffness and damping to zero and send as joint commanded position the measured joint position. In particular we are trying to send a sinusoidal torque to one joint (like in LBRTorqueSineOverlay example, but without a joint stiffness or damping), but without success. We also tried to set the commanded joint position as the measured plus a small constant as we were told that using this would avoid issues when the movement starts.
In our tests, our java application starts an FRI session like this:
FRIJointOverlay torqueOverlay = new FRIJointOverlay(friSession, ClientCommandMode.TORQUE);
JointImpedanceControlMode ctrMode = new JointImpedanceControlMode(0, 0, 0, 0, 0, 0, 0);
ctrMode.setDamping(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
PositionHold posHold = new PositionHold(ctrMode, -1, null);
_lbr.move(posHold.addMotionOverlay(torqueOverlay));
And we command the following torque and joint commands through FRI C++:
// (Not the complete code)
double epsilon = 0.01; // Tested with epsilon zero or non-zero
for (int i=0; i<LBRState::NUMBER_OF_JOINTS; i++)
{
_jointPosition[i] = robotState().getMeasuredJointPosition()[i] + epsilon;
}
robotCommand().setJointPosition(_jointPosition);
// _torques vector is initialized to zero
// ...
_torques[4] = 1*std::sin(2*M_PI*0.1*(time));
robotCommand().setTorque(_torques);
Display More
Then the robot accelerates quickly (even if the torques does not seem to have high values) and stops with the following errors:
illegal axis delta detected
or
CK_COMPOUND_RETURN_ERROR
(some of the times the joint reached its limit but not always).
The question is: is there any safe and tested way to command joint torques? Has anyone else tried something similar and/or encountered the above errors during commanding joint torques?