You are on page 1of 1

package application;

import javax.inject.Inject;
import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
import static com.kuka.roboticsAPI.motionModel.BasicMotions.*;
import com.kuka.roboticsAPI.deviceModel.LBR;
import com.kuka.roboticsAPI.motionModel.HandGuidingMotion;

/**
* Implementation of a robot application.
* <p>
* The application provides a {@link RoboticsAPITask#initialize()} and a
* {@link RoboticsAPITask#run()} method, which will be called successively in
* the application lifecycle. The application will terminate automatically after
* the {@link RoboticsAPITask#run()} method has finished or after stopping the
* task. The {@link RoboticsAPITask#dispose()} method will be called, even if an
* exception is thrown during initialization or run.
* <p>
* <b>It is imperative to call <code>super.dispose()</code> when overriding the
* {@link RoboticsAPITask#dispose()} method.</b>
*
* @see UseRoboticsAPIContext
* @see #initialize()
* @see #run()
* @see #dispose()
*/
public class Handguiding extends RoboticsAPIApplication {
@Inject
private LBR lBR_iiwa_7_R800_1;
private HandGuidingMotion motion;

@Override
public void initialize() {
// initialize your application here
motion = new HandGuidingMotion();
motion.setAxisLimitsMax(Math.toRadians(160), Math.toRadians(40),
Math.toRadians(30), Math.toRadians(-5), Math.toRadians(65), Math.toRadians(90),
Math.toRadians(55))
.setAxisLimitsMin(Math.toRadians(-160), Math.toRadians(-10),
Math.toRadians(-30), Math.toRadians(-110), Math.toRadians(-95),Math.toRadians(-90),
Math.toRadians(-55))
.setAxisLimitsEnabled(true, true, true, true, true,true, true)
.setAxisLimitViolationFreezesAll(false)
.setPermanentPullOnViolationAtStart(true);
}

@Override
public void run() {
// your application execution starts here
lBR_iiwa_7_R800_1.setESMState("2");
lBR_iiwa_7_R800_1.setESMState("1");
lBR_iiwa_7_R800_1.move(motion);

}
}

You might also like