Hi There!
I am working on commissioning an LBR iiwa to work collaboratively with humans.
Collision detection via the HRC option is already active @ Max external torque: 20Nm.
One part of the process is as follows:
1. Robot is moving normally, operator taps the robot and the robot stops.
2. The robot has stopped and holds its position under impedance control mode.
3. The user 'taps' the robot again and it continues on its planned path.
I have done this via wrapping motions in MotionContainers:
condition = createCollisionCondition();
IMotionContainer motion;
do { // motion started
motion = festoTool.move(ptp(myFrame).breakWhen(condition));
if (motion.hasFired(condition)){
resumeAfterCollision();
}
} while (motion.getFiredBreakConditionInfo() != null); // motion finished
The Collision condition:
private ICondition createCollisionCondition() {
double sensCLS = 5.0;
double actTJ1 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J1);
double actTJ2 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J2);
double actTJ3 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J3);
double actTJ4 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J4);
double actTJ5 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J5);
double actTJ6 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J6);
double actTJ7 = myLBR.getExternalTorque().getSingleTorqueValue(JointEnum.J7);
JointTorqueCondition jt1 = new JointTorqueCondition(JointEnum.J1, -sensCLS + actTJ1, sensCLS + actTJ1);
JointTorqueCondition jt2 = new JointTorqueCondition(JointEnum.J2, -sensCLS + actTJ2, sensCLS + actTJ2);
JointTorqueCondition jt3 = new JointTorqueCondition(JointEnum.J3, -sensCLS + actTJ3, sensCLS + actTJ3);
JointTorqueCondition jt4 = new JointTorqueCondition(JointEnum.J4, -sensCLS + actTJ4, sensCLS + actTJ4);
JointTorqueCondition jt5 = new JointTorqueCondition(JointEnum.J5, -sensCLS + actTJ5, sensCLS + actTJ5);
JointTorqueCondition jt6 = new JointTorqueCondition(JointEnum.J6, -sensCLS + actTJ6, sensCLS + actTJ6);
JointTorqueCondition jt7 = new JointTorqueCondition(JointEnum.J7, -sensCLS + actTJ7, sensCLS + actTJ7);
ICondition collisionCond = jt1.or(jt2, jt3, jt4, jt5, jt6, jt7);
return collisionCond;
}
Display More
private void resumeAfterCollision() {
JointTorqueCondition resumeCondition = new JointTorqueCondition(JointEnum.J1, -10, 10);
CartesianImpedanceControlMode soft = new CartesianImpedanceControlMode();
soft.parametrize(CartDOF.ALL).setDamping(.7);
soft.parametrize(CartDOF.ROT).setStiffness(100);
soft.parametrize(CartDOF.TRANSL).setStiffness(600);
ThreadUtil.milliSleep(1000);
myLBR.move(positionHold(soft, -1, TimeUnit.SECONDS).breakWhen(resumeCondition));
}
Display More
My problem is that this will only work for Single motions.
I would like to be able to do this using Approximations motions or batch motions, however after the collision it always will return the beginning of the first motion in the block.
Any ideas would be greatly appreciated!
cheers!!