Universal Robot UR-10 - Treating each component of a p[] variable (a pose) as individual variables to get, edit. Objective: have user move robot but let it keep a fixed orientation after released.

  • I've recently been tasked with making a UR-10 weld some parts. For the time being, we will start by having it weld a simple bead in a horizontal position.

    We want the user to orient the tool (a MIG torch) and place it at the end point, have the program store that position in a variable with get_actual_tcp_pose(), then repeat the same with the starting point, turn the torch on through a digital output, and use MoveP to do the weldment.


    I would like the orientation to change to a constant value (for example, the tcp pointing directly downwards for brevity's sake), so i would need to change the values of the variables individually or at least treat position and orientation separately (all this in the tool space of course). Haven't found anything in the scriptmanual. Can you help me out? thanks!

  • #Init variable#

    Global Pos_1=p[0,0,0,0,0,0]

    Global Pos_2=p[0,0,0,0,0,0]

    Global Pos_new_1=p[0,0,0,0,0,0]

    Global Pos_new_2=p[0,0,0,0,0,0]


    Global X_pos=0

    Global Y_pos=0

    Global Z_pos=0

    Global Rx_pos=1,5708 ############ To have the same around the axis Y

    Global Ry_pos=0

    Global Rz_pos=0

    ################################


    Pos_1=get_actual_tcp_pos()

    X_pos=Pos_1[0]

    Y_pos=Pos_1[1]

    Z_pos=Pos_1[2]

    Ry_pos=Pos_1[4]

    Rz_pos=Pos_1[5]

    Pos_new_1=p[X_pos,Y_pos,Z_pos,Rx_pos,Ry_pos,Rz_pos]


    Pos_2=get_actual_tcp_pos()

    X_pos=Pos_2[0]

    Y_pos=Pos_2[1]

    Z_pos=Pos_2[2]

    Ry_pos=Pos_2[4]

    Rz_pos=Pos_2[5]

    Pos_new_2=p[X_pos,Y_pos,Z_pos,Rx_pos,Ry_pos,Rz_pos]


    set_tcp(p[0.0,0.0,0,0.0,0.0,0.0]) ##################### Your TCP

    movel(var_1 , a=1.2, v=0.25)

    movel(var_2 , a=1.2, v=0.25)


    ####################################################################


    Is that what you wanted to do?

Advertising from our partners