Skip to content

UR Simulator

Andreas Østvik edited this page Feb 1, 2024 · 3 revisions

In order to run the code without connecting to a physical robot, it is possible to use the simulator provided by Universal robots. There are several ways to achieve this, and below we describe how to perform this either through use of docker or virtual machines.

Docker

The docker image is provided by Universal Robots through dockerhub.

Pull the docker:

docker pull universalrobots/ursim_cb3

Run the image:

docker run --rm -it -p 30003:30003 -p 6080:6080 universalrobots/ursim_cb3

View the robots user interface through a web browser with URL http://localhost:6080/vnc.html?host=localhost&port=6080, and connect using "localhost" as the robot IP in the example below..

Additional options, instruction and details can be found on dockerhub.

Virtual machine

The virtual machine for the desired CB version can be downloaded from their support site.

Download steps:

  • Select robot type: Choose the control box you want to simulate. The module libromocc should support both control boxes, and is tested with CB-Series version 3.0.X and e-Series 5.3.0.
  • Select type of download: Select Software
  • Select type of software: Select Offline simulator
  • Select operating system: The simulators supports some versions of Linux, but we have experienced some issues with Ubuntu 18 and newer java versions. To avoid this, it is possible to choose the Non Linux and install this on a virtual machine. We have tested this with VMWare player as suggested by Universal robots in the install description.

Setting up the simulator on a Virtual machine

Follow the instructions provided here.

Power on the virtual machine, and select the UR robot to use by clicking the desktop icon (either URSim UR5 or URSim UR10). A new window similar to the following should pop up:

Click the red bottom next to "Power off" and follow the instructions to initialize the robot. After the brakes are released and the robot is in Normal mode, exit and change to Move tab for visualization. The window should now look similar to:

Connecting to the machine from libromocc

An easy way to find the IP of the VM is to open the terminal (CTRL+ALT+T) and run ifconfig. It is listed under inet addr for the ethernet link, e.g. inet addr:192.168.153.131. Copy this IP and use it with the example code provided in the repository to get started.

Example use

from pyromocc import Robot

# Connect to robot
robot = Robot(ip="192.168.153.131", port=30003, manipulator="UR5")
robot.connect()

# Print current operational configuration
print(robot.operational_config)

# Move 50 mm upwards
robot.z += 50

# Print current operational configuration
print(robot.operational_config)