> For the complete documentation index, see [llms.txt](https://docs.robpod.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.robpod.cloud/hmi-designer/working-examples/doosan-robotics/singularity-example-dr.md).

# Singularity Example DR

### HMI Panel File

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

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

### Script File

```python
from DRCF import *

label_status = "OUTSIDE SINGULAR REGION"
checkbox_status = [True, False, False]
checkbox_auto_avoid = True
checkbox_var_vel = False
checkbox_path_first = False


def update_hmi():
    global checkbox_status, checkbox_var_vel, checkbox_path_first, checkbox_auto_avoid, label_status

    # update checkbox
    if checkbox_auto_avoid and not checkbox_status[0]:
        checkbox_var_vel = False
        checkbox_path_first = False
        set_singularity_handling(DR_AVOID)
        checkbox_status = [checkbox_auto_avoid, checkbox_var_vel, checkbox_path_first]

    elif checkbox_var_vel and not checkbox_status[1]:
        checkbox_auto_avoid = False
        checkbox_path_first = False
        set_singularity_handling(DR_VAR_VEL)
        checkbox_status = [checkbox_auto_avoid, checkbox_var_vel, checkbox_path_first]

    elif checkbox_path_first and not checkbox_status[2]:
        checkbox_auto_avoid = False
        checkbox_var_vel = False
        set_singularity_handling(DR_TASK_STOP)
        checkbox_status = [checkbox_auto_avoid, checkbox_var_vel, checkbox_path_first]

    elif not checkbox_auto_avoid and not checkbox_var_vel and not checkbox_path_first:
        checkbox_auto_avoid = True
        checkbox_var_vel = False
        checkbox_path_first = False
        set_singularity_handling(DR_AVOID)
        checkbox_status = [checkbox_auto_avoid, checkbox_var_vel, checkbox_path_first]

    # update label
    j5 = abs(get_current_posj()[4])
    if j5 > 15:
        label_status = "OUTSIDE SINGULAR REGION"
    elif j5 > 10:
        label_status = "NEAR SINGULAR REGION"
    else:
        label_status = "INSIDE SINGULAR REGION"


thread_run(update_hmi, loop=True)
movej(posj(0.0, 36.8, 123.6, -0.0, -70.4, 0.0))


def test():
    movej(posj(0.0, 36.8, 123.6, -0.0, -70.4, 0.0))
    movel(posx(680.0, 34.5, 1142.5, -0.0, 90.0, -0.0))
    movel(posx(679.9, 34.5, 122.3, -0.0, 90.0, -0.0))

```

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
