RobotStudio event

Comparing current joint positions to a joint target using "ReadMotor"

Hi,

in order to validate safe move we want to compare the robots current joint values against the joint target its trying to get to. Im currently reading each joint value using ReadMotor but not sure how to convert the radians to the degrees shown in the joint values. I though it would have been a simple conversion process but the number do not tie up.

Code being used;

This gets the radians of each motor.

PROC ReadMechUnit()
        FOR i FROM 1 TO 6 DO
            nMotorAngles{i}:=ReadMotor(\MecUnit:=ROB_1,i);
        ENDFOR
ENDPROC

i convert the robtarget to jointarget here.

jAllMotorAngles:=CalcJointT(pSaveMoveValid1,tool0\WObj:=wobj0);

I now want to compare the values in nMotorAngles with the values in jAllMotorAngles check check if they're the same or not.

Comments

  • lemster68
    lemster68 ✭✭✭
    You don't want to read the motor angles, they don't necessarily equal the joint angles.  Use the function CJointT().
    Lee Justice