how achieve the constant pose kuka end effector after grasp

Report crashes, strange behaviour, or apparent bugs
Post Reply
waheed
Posts: 2
Joined: 09 Jul 2014, 05:52

how achieve the constant pose kuka end effector after grasp

Post by waheed »

hi,
i am working on kuka lWR robotic arm. i am controlling kuka robotic arm with remote Api matlab. my problem is how to achieve the constant pose of end effector after grasping the cup etc. here is my some matlab code, i use robotic tool box to calculate inverse kinematic and send to kuka vrep model, joint1 to joint7 is vrep handle

L1 = Link( 'a',0, 'alpha', 90,'d',0);
L2 = Link( 'a',0, 'alpha', -90,'d',0);
L3 = Link( 'a',0, 'alpha', -90,'d',0.4);
L4 = Link( 'a',0, 'alpha', 90,'d',0);
L5 = Link( 'a',0, 'alpha', 90,'d',0.4);
L6 = Link( 'a',0, 'alpha', -90,'d',0);
L7 = Link('a',0, 'alpha', 0,'d',0);


bot = SerialLink([L1 L2 L3 L4 L5 L6 L7], 'name', 'LBR4');


T1=bot.fkine([0 0 0 0 0 0 0])
T2=bot.fkine([0 -pi/2 0 0 0 0 0])
T3=bot.fkine([0 -pi/2 0 0 0 0 0])
T4=bot.fkine([pi/3 pi/4 0 0 pi/6 0 0])
t = [0:0.2:6]';
Traj1 = ctraj(T1, T2, length(t))
Traj2 = ctraj(T3, T4, length(t))
q1=bot.ikine(Traj1,'pinv')
function button_VrepJointPosition(source, eventdata,vrep,clientID,joint1,joint2,joint3,joint4,joint5,joint6,joint7,q1,camhandle,frameNumber, pathName,rgbSensor)
for i=1:31
vrep.simxSetJointTargetPosition(clientID,joint1,q1(i:i,1),vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(clientID,joint2,q1(i:i,2),vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(clientID,joint3,q1(i:i,3),vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(clientID,joint4,q1(i:i,4),vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(clientID,joint5,q1(i:i,5),vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(clientID,joint6,q1(i:i,6),vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(clientID,joint7,q1(i:i,7),vrep.simx_opmode_oneshot)
end
end

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: how achieve the constant pose kuka end effector after gr

Post by coppelia »

Hello,

what do you mean with constant pose? Do you mean a fixed (i.e. non-moving) configuration?

Most demo models that come with V-REP have a demo behaviour, i.e. they will perform some simple movement. That movement is realized with child scripts most of the time. If you wish to control the robot exclusively from your own controller (be it another child script, ROS or a remote API client), make sure to previously remove the child script that was initially in charge of the movement. You can do this in the script dialog. If you don't do it, they you might have two distinct controllers trying to control the robot.

Cheers

waheed
Posts: 2
Joined: 09 Jul 2014, 05:52

Re: how achieve the constant pose kuka end effector after gr

Post by waheed »

hy,
Thanks for reply and sorry for huge gap reply on this post.
yes, I mean non-moving configuration. yes child script i have already change. remote Api working well.
i see the tutorial of 7dof Inverse kinematic, robot move from tip to target through inverse kinematics module.
But in my case, i do not use the IK module. i use semxsetjointTargetPosition function to set joint position for every joint.
how i can acheive the same functionalty of Ik trough Remote Api.
Any suggestion

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: how achieve the constant pose kuka end effector after gr

Post by coppelia »

If your robot is IK enabled, then you can simply modify the position/orientation of the robot's target dummy object: IK will automatically do its calculation.
For instance, take the demo model models/robots/non-mobile/7 DoF manipulator.ttm. From your remote API client you can retrieve the handle of object redundantRob_target, and then simply change its position/orientation: the arm will follow.

Cheers

Post Reply