RobotStudio event

Variable num from pose

Hello!
After Search_1D I have offset values in
LOCAL PERS pose a:=[[x,y,z],[1,0,0,0]];.

LOCAL PERS pose b:=[[x,y,z],[1,0,0,0]];.

How I can extract values X from poses for variables num A, B?
A:=......???
B:=......???
It’s needed for use in command ArcC RelTool(p45,A,0,0),RelTool(p90,B,0,0)......
Or may be I have mistake and you have more simple or more good variant.

Comments

  • A:=pose_a.trans.x;
    B:=pose_b.trans.x;

  • So, I tried this, but it doesn’t work. 
  • Mehelgi said:
    Hello!
    After Search_1D I have offset values in
    LOCAL PERS pose a:=[[x,y,z],[1,0,0,0]];.

    LOCAL PERS pose b:=[[x,y,z],[1,0,0,0]];.

    How I can extract values X from poses for variables num A, B?
    A:=......???
    B:=......???
    It’s needed for use in command ArcC RelTool(p45,A,0,0),RelTool(p90,B,0,0)......
    Or may be I have mistake and you have more simple or more good variant.
    It might be because of your declaration. No spaces between declarations naming's. Controller doesn't like it.
    Also remove the "." after the declarations.

    Should be:
    LOCAL PERS pose_a:=[[0,0,0],[1,0,0,0]];
    LOCAL PERS pose_b:=[[0,0,0],[1,0,0,0]];
  • Values after Search_1D:
    LOCAL PERS pose pePAT_OK_0:=[[-0.128607,-1.93481,-0.960388],[1,0,0,0]];

    Declaration p_0_x:
    LOCAL VAR num p_0_x:=0;

    After Search_1D:
    p_0_x:=pePAT_OK_0.trans.x;
     

    ArcLStart RelTool(p0,p_0_x,p_0_y,p_0_z),v200,seam1,weld9\Weave:=weave7,fine,tWeldGunCMT45\WObj:=wobjSTN2;
  • What errors do you get?

  • The value doesn't change and the trajectory doesn't change too.
  • Try to change it to a pers and do it after the search and before the rob movement.
  • The first post has a valid declaration of the pose, it is merely A and B, pose indicates data type.  You do not have to break it down to the atomic level with x, y and z to assign the values, see below:
    VAR pos myPos:=[0,0,0];
    myPos:=A.trans;
    MoveL RelTool(myPick,myPos.x,myPos.y,myPos.z), speed, tool, blah, blah;
    To use those values in the RelTool, however, you must break it down as seen above.
    Lee Justice
  • So, I cut declaration part (p_0_x:=pePAT_OK_0.trans.x;) from search_routine and moved it into welding_routine before Arc commands. And now everything worked. 
    Thank you very much for your help!