Main Content

Set Up URSim Offline Simulator for RTDE

Universal Robots provides a software emulator, URSim, to test and validate motion planning and control algorithms using offline programming and simulation of robot programs. For more information on the features and limitations of the URSim offline simulator, see Universal Robots > Download.

Configure URSim

The functionality of URSim is almost identical to a real cobot connected over the network. This workflow focuses on launching URSim from the corresponding Docker® image, and controlling the cobot over RTDE.

To connect and launch URSim from the Docker image:

  1. Install and set up Docker in the Linux® environment.

    ubuntu@user:~$ sudo apt-get install docker.io
    ubuntu@user:~$ sudo apt-get install curl
    ubuntu@user:~$ sudo usermod -aG docker $USER
    ubuntu@user:~$ newgrp docker
  2. Download the start_ursim.sh shell script from the UR Client Library GitHub repository.

  3. Navigate to the corresponding folder and make the shell script executable.

    ubuntu@user:~/Downloads$ chmod +x ./start_ursim.sh

  4. Run the shell script to launch URSim, and click the link to open the Docker in the browser.

    ubuntu@user:~/Downloads$ ./start_ursim.sh
  5. Power on the cobot in the URSim offline simulator.

Load and Play UR Program

To load and play the UR program, complete these steps:

  1. Open the MATLAB terminal and access the path where URServerScript.script file is available, by using this command.

    installationFilePath = fullfile(codertarget.urseries.internal.getSpPkgRootDir,'resources')
    cd(installationFilePath)

    Note

    The script is configured by default to disable the gripper actuation for RobotiQ grippers. This facilitates smooth operation with URSim and eliminates the need to download the gripper URCap.

  2. Copy the URServerScript.script file from Current Folder browser in MATLAB into the following path in the Linux system of URSim. The .ursim folder is hidden, by default. To view it, click on the menu icon (three horizontal lines or dots) in the file explorer and enable the option to show hidden files.

    ubuntu@user:~$ cd .ursim/e-series/UR5/programs
  3. Access URSim in the browser.

    1. Create a new program in URSim.

    2. From the left navigation menu, select Advanced > Script.

    3. Click Robot Program > Script, and select File from the drop-down list.

      The Script Code pane now displays the Edit button, which you can use to select the file.

    4. Click Edit > Open, and choose the URServerScript.script file that you copied. Click Exit.

    5. Save the program.

  4. Play the UR program and switch to Remote Control mode in the URSim simulator.

Setting Up Connectivity Medium as RTDE and Validating Connection

The final step in preparing the URSim simulator involves setting RTDE as the connectivity medium and verifying a test connection between MATLAB and the URSim using the Hardware Setup process.

  1. Navigate to the Select connectivity medium window in the Hardware Setup wizard in the , select RTDE, and click Next.

  2. In the Select Interface window, select URSim Simulator, and click Next.

  3. In the Joint Angle Acquisition window, enter the UR Controller IP address in the Robot Address field, and click Get Joint Angles. MATLAB sends a command and verifies the communication with the UR Controller. If the communication is successful, the message - Joint angles acquired is displayed. In that case, click Next and follow the remaining steps to complete the Hardware Setup process.

    Tip

    To obtain the UR Controller IP address on Linux, go to Settings > Network, and click the icon corresponding to the network. You can enter the displayed IPV4 address in the Robot Address field.