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
  1. HMI Designer
  2. Working Examples
  3. Universal Robots

Pick and Place Example

PreviousUniversal RobotsNextPolishing Example

Last updated 10 months ago

HMI Panel File

Robot Program File

# variables
global velocity = 200
global loop_forever = False
global repetitions = 2
global gripper_status = "ACTIVATED"
global counter = 0
global aborted = False
global completed = False
global status = "READY"

# positions (can be defined also as installation variables to store their value)
global pick_pose = p[0, 0, 0, 0, 0, 0]
global place_pose = p[0, 0, 0, 0, 0, 0]

# functions
def open_gripper():
    if gripper_status == "ACTIVATED":
        textmsg("open")
        #rq_open()
    end
end

def close_gripper():
    if gripper_status == "ACTIVATED":
        textmsg("close")
        #rq_close()
    end
end

def pick(pose):
    if not aborted:
        status = "PICKING"
        approach = pose_trans(pose, p[0, 0, -0.1, 0, 0, 0])
        movel(approach, a=0.1, v=velocity/1000)
        movel(pick_pose, a=0.1, v=velocity/1000)
        close_gripper()
        movel(approach, a=0.1, v=velocity/1000)
    end
end

def place(pose):
    if not aborted:
        status = "PLACING"
        approach = pose_trans(pose, p[0, 0, -0.1, 0, 0, 0])
        movel(approach, a=0.1, v=velocity/1000)
        movel(pick_pose, a=0.1, v=velocity/1000)
        open_gripper()
        movel(approach, a=0.1, v=velocity/1000)
    end
end

def start_task():
    global counter = 0
    global aborted = False
    global completed = False
    while (not aborted) and (loop_forever or counter < repetitions):
        pick(pick_pose)
        place(place_pose)
        pick(place_pose)
        place(pick_pose)
        counter = counter + 1
    end
    completed = True
    status = "READY"
end

def stop_task():
    global aborted = True
    status = "STOPPING..."
    while not completed:
        sleep(0.1)
    end
end
2KB
pick_place.script
346KB
pick_place.hmi