I use to have this function to get the joint values in the old api
Right now i am trying to change to the new zmq api but i dont know how to do this part (res ~= obj.vrep.simx_return_ok && res ~= obj.vrep.simx_return_novalue_flag)
I used it to see if everything went well.
Can someone tell me how to do this ?
Complete function:
Code: Select all
function [error,armJoints] = get_joints(obj)
error = 0;
for i = 1:obj.number_of_joints
%Read from joints
[res,armJoints(i)]=obj.vrep.simxGetJointPosition(obj.clientID, obj.jointHandle{i},obj.vrep.simx_opmode_buffer);
if (res ~= obj.vrep.simx_return_ok && res ~= obj.vrep.simx_return_novalue_flag)
disp('ERROR: Failed read Joint value!');
error = 1;
return;
end
end
end