Problem with set the orientation and postion using MATLAB API

Report crashes, strange behaviour, or apparent bugs
Post Reply
carolina_rutilima
Posts: 6
Joined: 23 Jul 2018, 10:50

Problem with set the orientation and postion using MATLAB API

Post by carolina_rutilima »

%Set initial orientation and position
for idx1=1:num_kilobots

if idx1 == 1

vrep.simxSetObjectPosition(clientID,kilohandles(num_kilobots),-1,[-0.5,0.17,0],vrep.simx_opmode_oneshot);
%vrep.simxSetObjectOrientation(clientID,kilohandles(num_kilobots),-1, [0 0 90],vrep.simx_opmode_oneshot);
pause(5)

[returnCode,position1] = vrep.simxGetObjectPosition(clientID,kilohandles(num_kilobots),-1,vrep.simx_opmode_buffer);
[returnCode,orientation1] = vrep.simxGetObjectOrientation(clientID,kilohandles(num_kilobots),-1,vrep.simx_opmode_buffer);
disp(position1)
disp(orientation1)

end
end
START = 1;
while (START == 1)
%Turn on the joints
vrep.simxSetJointTargetVelocity(clientID,left_Motor,2,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity(clientID,right_Motor,2,vrep.simx_opmode_blocking);

START=0;
end


I would like to know to make the program run perfectly because when I set the position and orientation to the robot and after it tries to move, but it's not possible, actually, it moves, but not the correct way.

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

Re: Problem with set the orientation and postion using MATLAB API

Post by coppelia »

hello,

not sure what you mean when you say
it tries to move, but it's not possible
...
Have also a look here.

Cheers

Post Reply