Hello. So, I want to do joint velocity control for Kuka LBR IIWA 14. More precisely, I want to set the joint velocity value for each joint independently, without explicitly specifying any target joint position.
So far, what I was able to do is to simulate this behavior by getting the current joint position q, computing qnext = q + qdot*dt (in which qdot is the joint velocity vector) and then use
SmartServo's setDestination(qnext, qdot) function. It "works", but with a very poor performance and with a very jerky movement, even for low speeds and smooth velocity inputs. I am pretty sure there is a better way. Can someone help me? I also provided an excerpt of my code:
Code
JointPosition q = motion.getRuntime().getCurrentJointDestination();
double previousTime = currentTime;
currentTime = System.nanoTime()/ 1000000000.0;
double dt = currentTime-previousTime;
JointPosition qnext = Utils.mat2jp(Utils.jp2mat(q).add(qdot.mul(dt))); //This just computes qnext = q+qdot*dt
motion.getRuntime().activateVelocityPlanning(true);
motion.setSpeedTimeoutAfterGoalReach(0.1);
if(iiwaComm.isReadyToMove())
{
motion.getRuntime().setDestination(qnext, Utils.mat2jp(qdot));
}
Display More
Thanks.