Hauptinhalt

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

URSim Offline Simulator can be run on a Linux desktop or on a Linux VM hosted on Windows. To install and set up Linux VM on Windows, refer to the steps mentioned in Set Up Virtual Machine. Alternatively, to quickly get started with the VM setup on Windows by using a pre-configured VMX file, refer to the Windows (64-bit) section in Virtual Machine Installation Instructions.

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.

After you set up the Linux desktop or the Linux VM hosted on Windows, follow these steps 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/ur5e/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. Start the UR program by clicking Play at the bottom of the window, and then switch to Remote Control mode in the URSim simulator using these steps:

    1. Select Settings from the top right button.

    2. Select System > Remote Control.

    3. Click Enable.

    4. Change the mode of operation to Remote Control.

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.

Troubleshooting URSim Setup

  • If you plan to set up the URSim Offline Simulator on a Linux VM hosted on Windows, and encounter issues while running the newgrp docker command, log out from VM and log in again before running the command.

  • If you are facing issues with launching the URSim (using ./start_ursim.sh ) or if you are unable to find the copied URServerScript.script file in the .ursim/e-series/ur5e/programs directory , perform Step 1 of Configure URSim to install and set up the Docker again.

  • If you are unable to get joint angles as part of validating the connection using the Hardware Setup process, ensure that the required security services are enabled in the URSim simulator. To do this, refer to the steps mentioned in Enable Services.

  • After launching URSim Docker container for the first time, relaunching the Docker again by using ./start_ursim.sh command results in an error. Therefore, it is recommended that you use the browser-based PolyScope access directly, if the container is already launched. If you still face issues with Docker container, do the following:

    1. List the Docker containers that are running:

      user@user:~/Downloads$ docker ps
    2. Use the container ID to kill the corresponding Docker container:

      ursep@ursep:~/Downloads$ docker kill <CONTAINER ID>