3 import static com.kuka.roboticsAPI.motionModel.BasicMotions.positionHold;
4 import static com.kuka.roboticsAPI.motionModel.BasicMotions.ptp;
13 import java.nio.ByteBuffer;
14 import java.util.concurrent.TimeUnit;
15 import java.util.concurrent.TimeoutException;
17 import org.zeromq.ZMQ;
19 import com.google.flatbuffers.Table;
20 import com.kuka.connectivity.fastRobotInterface.FRIConfiguration;
21 import com.kuka.connectivity.fastRobotInterface.FRIJointOverlay;
22 import com.kuka.connectivity.fastRobotInterface.FRISession;
23 import com.kuka.connectivity.motionModel.smartServo.ISmartServoRuntime;
24 import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
25 import com.kuka.roboticsAPI.controllerModel.Controller;
26 import com.kuka.roboticsAPI.controllerModel.recovery.IRecovery;
27 import com.kuka.roboticsAPI.deviceModel.JointPosition;
28 import com.kuka.roboticsAPI.deviceModel.LBR;
29 import com.kuka.roboticsAPI.geometricModel.CartDOF;
30 import com.kuka.roboticsAPI.geometricModel.LoadData;
31 import com.kuka.roboticsAPI.geometricModel.PhysicalObject;
32 import com.kuka.roboticsAPI.geometricModel.Tool;
33 import com.kuka.roboticsAPI.motionModel.HandGuidingMotion;
34 import com.kuka.roboticsAPI.motionModel.IMotionContainer;
35 import com.kuka.roboticsAPI.motionModel.MotionBatch;
36 import com.kuka.roboticsAPI.motionModel.controlModeModel.AbstractMotionControlMode;
37 import com.kuka.roboticsAPI.motionModel.controlModeModel.CartesianImpedanceControlMode;
38 import com.kuka.roboticsAPI.motionModel.controlModeModel.JointImpedanceControlMode;
39 import com.kuka.roboticsAPI.motionModel.controlModeModel.PositionControlMode;
48 private Controller _lbrController;
51 private ISmartServoRuntime theSmartServoRuntime = null;
52 private AbstractMotionControlMode _activeMotionControlMode;
54 private IRecovery _pausedApplicationRecovery = null;
55 private PhysicalObject _toolAttachedToLBR;
62 private Tool _flangeAttachment;
69 _lbrController = (Controller) getContext().getControllers().toArray()[0];
70 _lbr = (LBR) _lbrController.getDevices().toArray()[0];
75 _pausedApplicationRecovery = getRecovery();
77 LoadData _loadData =
new LoadData();
82 _toolAttachedToLBR =
new Tool(
"Tool", _loadData);
83 _toolAttachedToLBR.attachTo(_lbr.getFlange());
94 getLogger().info(
"States initialized...");
95 JointPosition destination =
new JointPosition(
96 _lbr.getJointCount());
99 IMotionContainer currentMotion = null;
101 boolean stop =
false;
102 boolean newConfig =
false;
108 getLogger().warn(
"Enabling Teach Mode (grav comp)");
110 JointImpedanceControlMode controlMode2 =
new JointImpedanceControlMode(7);
111 controlMode2.setStiffnessForAllJoints(0.1);
112 controlMode2.setDampingForAllJoints(0.7);
113 _lbr.moveAsync(positionHold(controlMode2, -1, TimeUnit.SECONDS));
115 HandGuidingMotion handGuidingMotion =
new HandGuidingMotion();
116 for (
int i = 0; i < 10; i++) {
118 _lbr.move(handGuidingMotion);
119 }
catch(Exception e) {
133 public static void main(
final String[] args)
136 app.runApplication();
static void main(final String[] args)
double getEndEffectorWeight()