Box Weight Example DR

HMI Panel File

Script File

from DRCF import *

box_weight = 0
box_height = 0

set_external_force_reset()


def pick():
    global box_weight, box_height

    pose, _ = get_current_posx()
    pose[2] = 0
    
    task_compliance_ctrl()
    amovel(pose, v=50)
    while get_tool_force()[2] < 10 and get_current_posx()[0][2] > 10:
        wait(0.1)
    stop(DR_QSTOP)
    release_compliance_ctrl()

    box_height = get_current_posx()[0][2]
    set_digital_outputs([1, -2])
    wait(0.5)

    movel(posx(0, 0, -50, 0, 0, 0), ref=DR_TOOL)
    wait(1)
    box_weight = get_workpiece_weight()


def release():
    pose, _ = get_current_posx()
    pose[2] = box_height
    movel(pose, v=50)

    set_digital_outputs([-1, 2])
    wait(0.5)
    movel(posx(0, 0, -150, 0, 0, 0), v=100, ref=DR_TOOL)

Last updated