RobotStudio event

TCP in wobjdata to WCS

Hello All,

in short:
How can I calculate the position of a TCP in WCS which is rotated and moved in wobjdata?

in long:
How can I figure out the current x/y/z in world coordinate system of my TCP at any given point in my software?

Thanks so much,
Duesentrieb




Comments

  • Hello Duesentrieb,

    What is the scope here? Are you talking about a RobotStudio addin, RAPID code, or...?

    Regards,
    Johannes
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • I am sorry to be unclear.

    I am talking about RAPID code in RobotStudio.

    Best, Dusko
  • Hello

    Check CPos in the RAPID manual

    VAR pos pos1;
    MoveL *, v500, fine \Inpos := inpos50, tool1;
    pos1 := CPos(\Tool:=tool1 \WObj:=wobj0);


  • Thank you Pavel,

    as I understand CPos or CRobT are calculating the position if the robot is there.

    But how can I calculation this BEFORE the robot moves there? I want to control the track of the robot. The track position is, in my case, dependent where the robtarget will be.

    Thanks!
  • Then you should look at the target.
         
       var num nTargX; 
          nTargX :=  Target_30.trans.x;

    And if you are offsettings you need to add that offset.
    /Pavel

  • Here an example of my code:

    <code>&nbsp;currentWobjdata.uframe.rot:=OrientZYX(i*180,0,0);<br> currentWobjdata.oframe.trans.x:=cLogEnd.tongueLength+cLogEnd.faceDepth-((currentTool.width/2)+chainsawPrecutOffset);
     currentWobjdata.oframe.trans.y:=-((cLogEnd.faceWidth/2)+chainsawPrecutOffset);
     currentWobjdata.oframe.rot:=OrientZYX(180+cLogEnd.sideAngle,0,0);

    currentRobtarget.trans.x:=fromX;
    currentRobtarget.trans.y:=fromY;
    <code> currentRobtarget.extax.eax_a:=<b>here I need to know the WCS-X value of the TCP of the currentRobtarget in currentWobjdata will be</b><br> MoveL currentRobtarget,currentTool.f,fine,currentTooldata\WObj:=currentWobjdata;
    ...
    ...<br> currentWobjdata.uframe.trans.x:=currentWobjdata.uframe.trans.x+i*cLog.length;<br>

    Thank you