## Move arm with remote api

Typically: "How do I... ", "How can I... " questions
Posts: 1
Joined: 03 May 2013, 14:49

### Move arm with remote api

Hi ,
i'm doing a project in which i move a 3 dof arm to reach a point in the space, the shoulder part is in a static position. I use the remote api with c++, but i have some doubts about these. In the initial part i need to set the joint values (all revolute joints), i do it with simxSetJointPosition and in the position parameter i set the angle of rotation

Code: Select all

simxSetJointPosition(baseJoint, 30, simx_opmode_oneshot);
The problem is that the joint doesn't reach the position in either torque/force mode or inverce kinematics mode (joints property). What's the correct mode?
Another thing is the movement in the arm, i want to do this using the simxRMLPosition but i don't understand what to put in the parameters.
I use this but i don't know the others parameters

Code: Select all

int dofs = 3;
double timeStep = 0.05;
int flags = -1;
//to set the currentPosVelAccel
float targetPos[3];
float targetVel[3];
double currentPosVelAccel[9];
simxGetObjectPosition(target,-1,targetPos,simx_opmode_streaming);
simxGetObjectFloatParameter(target,3000,&targetVel[0],simx_opmode_oneshot_wait);
simxGetObjectFloatParameter(target,3001,&targetVel[1],simx_opmode_oneshot_wait);
simxGetObjectFloatParameter(target,3002,&targetVel[2],simx_opmode_oneshot_wait);
currentPosVelAccel[0] = targetPos[0];
currentPosVelAccel[1] = targetPos[1];
currentPosVelAccel[2] = targetPos[2];
currentPosVelAccel[3] = targetVel[0];
currentPosVelAccel[4] = targetVel[1];
currentPosVelAccel[5] = targetVel[2];
currentPosVelAccel[6] = 0;
currentPosVelAccel[7] = 0;
currentPosVelAccel[8] = 0;
double maxVelAccelJerk[] = {0.4,0.4,0.4,1.8,0.3,0.3,0.3,0.9,0.2,0.2,0.2,0.8};   //Values taken from RML demo
simxRMLPosition(dofs, timeStep, flags ,currentPosVelAccel,maxVelAccelJerk,const simxChar* selection,const simxDouble* targetPosVel,simxInt* rmlState,simxDouble* newPosVelAccel,simx_opmode_oneshot_wait);
What values i need to put in selection and rmlState?What is the difference about currentPosVelAccel and targetPosVel ?
In the user manual you say
arrange values as {pos1,pos2,..,posN,vel1,vel2,..,velN}
how many positions i need to write in my example?

Thanks

coppelia
Posts: 7594
Joined: 14 Dec 2012, 00:25