Main Content

urRTDEClient

Connect to simulated or physical cobot from Universal Robots over RTDE

Since R2024a

    Description

    The urRTDEClient object represents a connection from MATLAB to the Real-Time Data Exchange (RTDE) server in Universal Robots (UR) controller. You can connect to the UR controller in the URSim offline simulator from Universal Robots or to the UR controller in a physical cobot, and then exchange data over the RTDE protocol. To interact with the cobot to read robot state data, send joint and Cartesian control commands, and follow a set of joint-space or task-space waypoints, use this object with the functions listed in Object Functions.

    Creation

    Description

    example

    ur = urRTDEClient(URControllerIP) creates a connection, ur, and connects to the RTDE server in the UR controller at the specified IP address. The UR controller can run in the URSim simulator or in the Mini-ITX PC in the Control Box.

    example

    ur = urRTDEClient(URControllerIP,Name=Value) sets properties using one or more name-value arguments. For example, to exchange data at a rate of 500 Hz, set RTDEFrequency to 500.

    Input Arguments

    expand all

    IP address of the UR controller, specified as a string scalar or character vector.

    Data Types: string | char

    Properties

    expand all

    Name of the Universal Robots cobot for which you want to create the connection object, specified as a string scalar. By default, the value is 'universalUR5e'.

    Example: ur = urRTDEClient('172.19.98.176',CobotName='universalUR10e')

    Data Types: string

    Data sampling and exchange frequency (in Hz), specified as a numeric scalar. The MATLAB client and UR controller server sample and exchange data over RTDE at the specified frequency. By default, the value is 125.

    Example: ur = urRTDEClient('172.19.98.176',RTDEFrequency=500)

    Data Types: double

    Timeout duration, specified as a numeric scalar. The TCP/IP server attempts to establish a connection within the specified duration. By default, the value is 5.

    Example: ur = urRTDEClient('172.19.98.176',ConnectionTimeOut=10)

    Data Types: double

    This property is read-only.

    Rigid body tree robot model, returned as a rigidBodyTree object.

    This property is read-only.

    UR controller version, returned as a numeric scalar.

    Data Types: double

    Object Functions

    readJointConfigurationGet current joint configuration from the robot
    readJointVelocityGet current joint velocities from the robot
    readCartesianPoseGet current end-effector pose from the robot
    readEndEffectorVelocityGet current end-effector velocities from the robot
    recordRobotStateLog the key robot state parameters during motion of robot
    sendJointConfigurationCommand robot to move to desired joint configuration
    sendJointConfigurationAndWaitCommand robot to move to joint configuration and wait for the motion to complete
    sendCartesianPoseAndWaitCommand robot to move to desired Cartesian pose and wait for the motion to complete
    readMotionStatusGet current motion status of the robot
    manageGripperAttachmentAttach or detach gripper connected to Universal Robots cobot
    actuateGripperControl attached gripper with grip or release action
    sendServoJCommandsSend Servoj commands
    sendSpeedJCommandsSend speedj commands
    executeURScriptCommandSend URScript command to control cobot over RTDE interface
    followCartesianWaypointsCommand robot to move along the desired Cartesian waypoints
    followJointWaypointsCommand robot to move along the desired joint space waypoints

    Examples

    collapse all

    Connect to the physical or simulated cobot (in the URSim offline simulator from Universal Robots), over RTDE, be specifying the controller IP address.

    ur = urRTDEClient('172.19.98.176');
    ur = 
      urRTDEClient with properties:
    
                CobotName: 'universalUR5e'
           URControllerIP: '172.19.98.176'
        ControllerVersion: '5.11.1.0'
            RTDEFrequency: 125
        ConnectionTimeOut: 10

    Connect to the physical or simulated cobot (in the URSim offline simulator from Universal Robots), over RTDE, by specifying the cobot name, RTDE frequency, and timeout.

    Specify cobot name to establish the connection.

    ur = urRTDEClient('172.19.98.176',CobotName=universalUR10e);

    Specify the frequency for data exchange over RTDE.

    ur = urRTDEClient('172.19.98.176',CobotName=universalUR10e,RTDEFrequency=500);

    Specify the timeout value for establishing connection over RTDE.

    ur = urRTDEClient('172.19.98.176',CobotName='universalUR10e',ConnectionTimeOut=10);

    Version History

    Introduced in R2024a