# Box Weight Example DR

### HMI Panel File

<figure><img src="/files/x3Fe7z2KnuHhq8s7PgSD" alt=""><figcaption></figcaption></figure>

{% file src="/files/TMHQwPIrHtA4zkAHtjLD" %}

### Script File

```python
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)

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.robpod.cloud/hmi-designer/working-examples/doosan-robotics/box-weight-example-dr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
