Page 1 of 1

Joint Position Change after Running RemApi in matlab

Posted: 29 Jul 2015, 20:31
by umerhuzaifa
Hi,

I have made a structure in the VREP environment having two revolute joints. I connected to VREP from MATLAB using remApi functions. I have to update the joint positions from MATLAB. My MATLAB script successfully does that but as my script ends in MATLAB, the joint ("joint_right") acquires a -180 degree position in VREP and keeps that even if I change that manually from the joint properties dialog. My joint type is inverse kinematic with Hybrid Operation.
Kindly guide me what should I do.
Links to my files are as follows:
VREP file: https://drive.google.com/file/d/0B2w3mm ... sp=sharing
Matlab script: https://drive.google.com/file/d/0B2w3mm ... sp=sharing

Thanks,
Umer

Re: Joint Position Change after Running RemApi in matlab

Posted: 29 Jul 2015, 21:57
by umerhuzaifa
I just performed the same angular position update using a childscript in the VREP scene and it works perfectly. This means the problem is with the remApi connection.

Re: Joint Position Change after Running RemApi in matlab

Posted: 30 Jul 2015, 17:41
by coppelia
Hello,

I am not really sure what you mean. But this is what I see in your Matlab code:

You are setting a joint value from the remote API via a streaming command. This doesn't make sense. You should use:

Code: Select all

vrep.simxSetJointPosition(id,rleg,traj(cnt),vrep.simx_opmode_oneshot)
Streaming values is only to retrieve values from V-REP.
Also, if you end the connection just after you set a value, that value has high chances not to arrive anymore (if you sent it via simx_opmode_oneshot).

Cheers

Re: Joint Position Change after Running RemApi in matlab

Posted: 01 Aug 2015, 04:28
by umerhuzaifa
Thank you. Found my mistake.