CHAI3DCHAI3D

normal data record

More
07 Feb 2017 15:10 #1

i am sending cartesian position (px,py,pz) to two falcon (teleoperation principal) it is main part of the code.
///////////////////
// default role assignment
master = 1;
slave = 0;
// center both devices
drdMoveToPos (0.0, 0.0, 0.0, false, master);
drdMoveToPos (0.0, 0.0, 0.0, true, slave);
while (drdIsMoving (master) || drdIsMoving (slave)) drdWaitForTick (master);

drdEnableFilter (true,master);

drdEnableFilter (true,slave);



t0 = drdGetTime();

if (done > -1) done = 0;
while (!done) {

// generate random point within workspace

dt = drdGetTime()-t0;
alpha = radial_vel * dt;
beta = M_PI/2.0 + (vertical_vel * dt);
px = x0+radius*cos(alpha)*cos(beta);
py = y0+radius*sin(alpha)*cos(beta);
pz = z0+radius*sin(beta);

drdTrackPos(px,py,pz,master);
drdTrackPos(px,py,pz,slave) ;
if (beta > 5.0*M_PI/2.0) done = -1;

drdGetPos(&px,&py,&pz,master);
drdGetPos(&psx,&psy,&psz,slave);

dhdGetForce(&fmx,&fmy,&fmz,master);
dhdGetForce(&fsx,&fsy,&fsz,master);
///////////////////////////////////////////////////
my question is i use drdGetPos to write positions values in text file witch is fine as an output but when i check for forces with dhdGetForce i got also numbers in the text file i wonder why i have also forces as an output?

Please Log in or Create an account to join the conversation.

More
08 Feb 2017 21:23 #2

Maybe the following code:

dhdGetForce(&fsx,&fsy,&fsz,master);

should be written as:

dhdGetForce(&fsx,&fsy,&fsz,slave);

Please Log in or Create an account to join the conversation.

More
09 Feb 2017 17:01 #3

i think you didnt understand what i mean.in the code i send only positions to master and i track them in the slave side ,when i record the data during simulation i get positions values,which is normal but i get force values too i wonder why?

Please Log in or Create an account to join the conversation.

More
10 Feb 2017 00:06 #4

The force returned by dhdGetForce() is the force that is actually applied by the device at the time you call the function. Another way to look at it is that It represents the force applied by the robotic regulation loop to constrain the Falcon end-effectors to the position you requested by calling drdTrackPos().

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum