Skip to main content
Skip table of contents

AppRet_Motion_v2()

It is a function to perform motion moving between the approach pose and the retreat pose that is a certain distance away from the reference pose.

Sample Code: AppRet_Motion_v2()

PY
# Approach/Retract Motion
def AppRet_Motion_v2(app_ret_Dist, ref_Pos, AppRet_Vel, AppRet_Acc, AppRet_Time, AppRet_Radius, ref_Frame, ref_Mod, ref_Ractive, CaloffsetPos, MoveFn):
    # Input data (Example): 
    # app_ret_Dist = [X, Y, Z]
    # ref_Pos = posx(X, Y, Z, A, B, C)
    # AppRet_Vel = 100
    # AppRet_Acc = 100
    # AppRet_Time = 0
    # AppRet_Radius = 0
    # ref_Frame = DR_BASE 
    # ref_Mod = DR_MV_MOD_ABS
    # ref_Ractive = DR_MV_RA_DUPLICATE
    # sync_Mode = "sync"
    # AppRet_Offset = [X, Y, Z]
    # Predefined Value
    app_ret_Frame = DR_TOOL
    mType = "movel"
    ref_Apptype = None
    ref_Sol = None
    sync_Mode = "sync"
    AppRet_Offset = [0, 0, 0]
    pos_temp = CaloffsetPos(ref_Pos, app_ret_Dist, app_ret_Frame, ref_Frame) 
    #tp_log("pos_temp = {0}".format(pos_temp))
    posAppRet = posx(pos_temp[0]+AppRet_Offset[0], pos_temp[1]+AppRet_Offset[1], pos_temp[2]+AppRet_Offset[2], pos_temp[3], pos_temp[4], pos_temp[5])
    #tp_log("posAppRet = {0}".format(posAppRet))
    MoveFn(mType, posAppRet, AppRet_Vel, AppRet_Acc, AppRet_Time, AppRet_Radius, ref_Frame, ref_Mod, ref_Ractive, ref_Apptype, ref_Sol, sync_Mode)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.