Robpod Studio Docs
  • Get Started
    • Introduction
    • Download
    • Installation
      • Install Platform
      • Install Plugin
    • First Steps
      • Choose Studio Flavor
      • Welcome Screen
      • Create a Project
      • Create a Script
      • User Interface
      • New UI
      • Robpod Studio Assistant
    • License
      • Buy a License
      • Install a License
    • Safety
  • ROBOT
    • Robot Toolbar
      • Connect the Robot
      • Control the Robot
      • Get Positions
      • Move To
      • Run a Script
    • Robot Tool Window
      • Status
      • Teach Pendant Viewer
      • Variables
      • Digital I/O
      • Analog I/O
      • Debug
    • Robot Variables
    • Robot Logs
  • Advanced Scripting
    • Live Auto Completion
    • Templete Completion
    • Param Info
    • Code Inspections
    • Quick Doc
    • Python Scripting
    • Editor Settings
  • Synchronization
    • Upload On Robot
    • Download From Robot
    • Synchronize Project
    • Clean Robot Files
    • Synchronization Settings
  • Simulation
    • Connect a Simulator
    • Simulate a Script
    • Off-Line Programming
    • Simulator Viewer
    • Simulation Commands
    • Simulation Settings
    • Simulation Examples
      • Palletizing
  • HMI Designer
    • Introduction
    • User Interface
    • Installation
    • Design Steps
      • Create new HMI Panel
      • Add HMI Components
      • Edit HMI Components
      • Preview HMI Panel
      • Synchronize HMI Panel
      • Run HMI Program
    • HMI Components
    • HMI Charts
    • Display Conditions
    • HMI Commands
    • HMI Icon Generator
    • Desktop HMI Viewer
    • HMI and UR Polyscope
    • HMI and Doosan Robotics
    • HMI Tutorials
      • Beginner Tutorial
      • UR Polyscope Tutorial
      • Doosan Robotics Task Editor Tutorial
      • Doosan Robotics DRL Tutorial
    • Working Examples
      • Universal Robots
        • Pick and Place Example
        • Polishing Example
        • Machine Tending Example
        • Simple Pallet Example
        • Welding Example
        • Skrewdriving Example
        • Chart Monitoring Example
        • Production Mix Example
        • Pallet App Example
        • Camera QA Example
        • Assembly Example
      • Doosan Robotics
        • Pick and Place Example DR
  • Other
    • Updates
    • License FAQ
    • Customer Portal
  • LEGAL
    • License Agreement
    • Privacy Policy
    • Third Party Licenses
  • Appendix
    • Supported Robots
    • Robot Specific Functions
      • Universal Robots
        • URSim
    • Supported Simulators
    • Network Configuration
    • Security Settings
Powered by GitBook
On this page
  • HMI Panel File
  • Robot Program File
  • Polyscope Setup
  1. HMI Designer
  2. Working Examples
  3. Universal Robots

Pallet App Example

PreviousProduction Mix ExampleNextCamera QA Example

Last updated 9 months ago

With this palletizing example users can:

  • Choose pallet layout (number of layers, rows and columns)

  • Define box size

  • Choose Left or Right pallet

  • Setup starting condition (empty pallet, start from last box, start from specific box)

HMI Panel File

Robot Program File

# PALLET APP - variables

LEFT_PALLET = "LEFT PALLET"
RIGHT_PALLET = "RIGHT PALLET"
pallet_feature = LEFT_PALLET_FEATURE

# start from setup
FIRST_BOX = "FIRST BOX"
CURRENT_BOX = "CURRENT BOX"
BOX_AT = "BOX AT"
start_from = FIRST_BOX

start_row = 0
start_column = 0
start_layer = 0

# PALLET APP - functions
def get_pick_pose():
    x = box_length * 0.0005
    y = box_width * 0.0005
    z = box_height * 0.001
    return pose_trans(PICK_FEATURE, p[x, y, z, 0, 3.1415, 0])
end

def get_place_pose():
    x = box_length * 0.0005 + current_column * box_length * 0.001
    y = box_width * 0.0005 + current_row * box_width * 0.001
    z = box_height * 0.001 + current_layer * box_height * 0.001
    return pose_trans(pallet_feature, p[x, y, z, 0, 3.1415, 0])
end

def get_approach_pose(pose, offset=[0, 0, 0]):
    return pose_add(pose, p[offset[0], offset[1], offset[2], 0, 0, 0])
end

# PALLET APP - tool functions
# implement these functions with logic to operate your gripper
def grasp():

end

def release():

end


# PALLET APP - main function
def start_task():
    # start from condition
    if start_from == FIRST_BOX:
        current_row = 0
        current_column = 0
        current_layer = 0
    elif start_from == BOX_AT:
        current_row = start_row - 1
        current_column = start_column - 1
        current_layer = start_layer - 1
    else:
        current_row = current_row
        current_column = current_column
        current_layer = current_layer
    end

    # selected pallet condition
    if selected_pallet == LEFT_PALLET:
        pallet_feature = LEFT_PALLET_FEATURE
    else:
        pallet_feature = RIGHT_PALLET_FEATURE
    end

    # iteration over layers, columns and rows
    while current_layer < layers:
        while current_column < columns:
            while current_row < rows:
                # pick action
                pick_pose = get_pick_pose()
                approach_pose = get_approach_pose(pick_pose, offset=[0, 0, 0.1])
                current_pose = get_actual_tcp_pose()

                if approach_pose[2] < current_pose[2] + 0.05:
                    approach_pose[2] = current_pose[2] + 0.05
                end

                movej(approach_pose)
                movel(pick_pose)

                grasp()

                place_pose = get_place_pose()
                place_approach_pose = get_approach_pose(place_pose, offset=[0.1, 0.1, box_height * 0.001 + 0.05])

                if place_approach_pose[2] > PICK_FEATURE[2] +  box_height * 0.001 + 0.05:
                    approach_pose[2] = place_approach_pose[2]
                end

                movel(approach_pose)

                # place action
                place_pose = get_place_pose()
                approach_pose = get_approach_pose(place_pose, offset=[0.1, 0.1, box_height * 0.001 + 0.05])
                movej(approach_pose)
                movel(place_pose)

                release()

                approach_pose = get_approach_pose(place_pose, offset=[0, 0, 0.1])
                if approach_pose[2] < PICK_FEATURE[2] +  box_height * 0.001 + 0.05:
                    approach_pose[2] = PICK_FEATURE[2] +  box_height * 0.001 + 0.05
                end

                movel(approach_pose)
                current_row = current_row + 1
            end

            current_row = 0
            current_column = current_column + 1
        end

        current_row = 0
        current_column = 0
        current_layer = current_layer + 1
    end
end

Polyscope Setup

To install this HMI application in a production environment follow these steps:

1) Features

Inside installation tab define those reference frames as Plane Features.

Feature Name

LEFT_PALLET_FEATURE

RIGHT_PALLET_FEATURE

PICK_FEATURE

2) Installation Variables

Inside installation tab define those variables.

Variable Name
Default Value

rows

2

columns

4

layers

8

selected_pallet

"LEFT PALLET"

box_length

300

box_width

400

box_height

200

current_row

0

current_column

0

current_layer

0

1004KB
pallet.hmi
4KB
pallet_script.script
2KB
pallet_app.urp