So I'm trying to execute programs based on what direction a user pushes the robot.
I've used the code from this topic as a reference and made a test/proof of concept:
https://www.robot-forum.com/robotforum/cob…igh-inaccuracy/
LBR robot = lbr_iiwa;
robot.move(ptp(Math.toRadians(0),Math.toRadians(0),Math.toRadians(0),Math.toRadians(-90),Math.toRadians(0),Math.toRadians(0),Math.toRadians(0)).setJointVelocityRel(0.5));
ForceSensorData KraftData;
double Kraft_X;
double Kraft_Y;
double Kraft_Z;
boolean trigger = true;
while(trigger){
robot.move(ptp(Math.toRadians(0),Math.toRadians(0),Math.toRadians(0),Math.toRadians(-90),Math.toRadians(0),Math.toRadians(0),Math.toRadians(0)).setJointVelocityRel(0.5));
KraftData = robot.getExternalForceTorque(robot.getFlange());
Kraft_X = KraftData.getForce().getX();
Kraft_Y = KraftData.getForce().getY();
Kraft_Z = KraftData.getForce().getZ();
getLogger().info("Kraft_X: "+Kraft_X);
getLogger().info("Kraft_X: "+Kraft_X);
getLogger().info("Kraft_X: "+Kraft_X);
if (Kraft_X>10){
//execute another program here
trigger=false;
}
robot.move(ptp(Math.toRadians(0),Math.toRadians(0),Math.toRadians(0),Math.toRadians(-89.99999),Math.toRadians(0),Math.toRadians(0),Math.toRadians(0)).setJointVelocityRel(0.5));
}
Display More
so far it seems to work fine, I've added a slight movement cause the robot will lock up if it idles, and without the movement, it creates a huge delay between a push and detection for some reason.
I now have a few questions:
1. how do i execute another application from within this application?
2. is this loop of minute movements harmful to the robot? (ie: wears out the joint really fast?)
3. is there another method to sense external force? with the except of of X, Y and Z seems to fluctuate unpredictably when pushed (doesn't seem too reliable) [my payload is extremely light, only a few hundred grams]
4. is the a way to output to my computer instead of on the console?
5. there's a small delay between a push and detection, is it because of slow processing speed? or am i doing something wrong?
any input is much appreciated