Hi, I am a new KUKA IIWA user and I need some help.
My first project was supposed to be something really simple so I did this code and it worked perfectly:
public void run() {
getLogger().info("ESM State 1: Operator Safety");
robot.setESMState("1");
getLogger().info("Move to start position");
robot.move(ptp(getApplicationData().getFrame("/P2")).setJointVelocityRel(0.2));
getLogger().info("ESM State 2: Manual Guiding Mode");
robot.setESMState("2");
ioflange.setLEDBlue(true);
motion = handGuiding()
.setJointLimitsMax(+1.745, +1.745, +1.745, +1.745, +1.745, +1.745, +1.745)
.setJointLimitsMin(-1.745, -1.745, -1.745, -1.745, -1.745, -1.745, -1.745)
.setJointLimitsEnabled(false,true,false,true,false,true,false)
.setJointLimitViolationFreezesAll(true)
.setPermanentPullOnViolationAtStart(true);
robot.move(motion);
getLogger().info("ESM State 1: Operator Safety");
robot.setESMState("1");
ioflange.setLEDBlue(false);
getLogger().info("Move to home position");
robot.move(ptpHome().setJointVelocityRel(0.2));
}
Display More
Now, as it was as soon as I let go the enabling switch the handguiding mode ends and the ESM 1 is activated. My goal now is to keep on handguiding while I don't hit "OK" on the SmartPAD window pop up. So I did this piece of code:
public void run() {
getLogger().info("ESM State 1: Operator Safety");
robot.setESMState("1");
getLogger().info("Move to start position");
robot.move(ptp(getApplicationData().getFrame("/P2")).setJointVelocityRel(0.2));
getLogger().info("ESM State 2: Manual Guiding Mode");
robot.setESMState("2");
ioflange.setLEDBlue(true);
HandGuidingMotion hgmotion = new HandGuidingMotion();
IMotionContainer hgContainer = robot.moveAsync(hgmotion);
getApplicationUI().displayModalDialog(ApplicationDialogType.INFORMATION, "Press ok to finish the application.", "OK");
hgContainer.cancel();
getLogger().info("ESM State 1: Operator Safety");
robot.setESMState("1");
ioflange.setLEDBlue(false);
getLogger().info("Move to home position");
robot.move(ptpHome().setJointVelocityRel(0.2));
}
Display More
When I test it, it happens the same thing. When I let go the enabling switch I can't resume the application on hand guiding mode. I thought the IMotionContainer was supposed to solve it.
Can someone help me figure this out please? What am I doing wrong? And how do I keep on resuming hand guiding mode until I hit the "Ok" button?Do I need to use an Impedance mode?
Thank you so much!