> 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" %}
