UR5e

Inherits from: Robot

A class to control the Universal Robots UR5e robotic arm.

This class provides methods to control the UR5e robot arm using the RTDE interface. It supports basic movement controls, gripper operations, and status queries.

Attributes
rtde_c

RTDE Control interface object

rtde_r

RTDE Receive interface object

end_effector

Gripper/end effector object if attached

UR5e

UR5e(robot_ip: str, end_effector, velocity: float, acceleration: float)

Initialize the UR5e robot arm.

Arguments
robot_ip (str)
required

defaults to “192.168.1.102”. IP address of the robot. Defaults to “192.168.1.102”.

end_effector (optional)
required

defaults to None. End effector class to use. Defaults to None.

velocity (float)
required

defaults to 0.1. Default velocity scaling (0-1). Defaults to 0.1.

acceleration (float)
required

defaults to 0.1. Default acceleration scaling (0-1). Defaults to 0.1.

getImage

UR5e.getImage(camera_name: str, image_type: str)

Get an image from the robot’s camera.

The UR5e does not have a camera, so this method always raises an exception.

Arguments
camera_name (str)
required

Unused

image_type (str)
required

Unused

Returns

Image

Never returns as exception is raised

cleanup

UR5e.cleanup()

moveToDeltaPose

UR5e.moveToDeltaPose(delta_pose: Pose, blocking: bool, moving_time: float, accel_time: float)

Move the robot end effector by a relative pose offset from its current pose.

Arguments
delta_pose (Pose)
required

Pose

Relative pose offset to move by, containing position and orientation deltas

blocking (bool), optional

defaults to False. Wait for movement to complete. Defaults to False.

moving_time (float), optional

defaults to 0.3. Time to complete the movement. Defaults to 0.3.

accel_time (float), optional

defaults to 0.15. Time to accelerate/decelerate. Defaults to 0.15.

moveToPose

UR5e.moveToPose(position: Position, orientation: Orientation, blocking: bool, moving_time: float, accel_time: float, name: str)

Move the robot end effector to a specified pose.

Arguments
position (Position)
required

Position

Target position coordinates

orientation (Orientation)
required

Orientation

Target orientation

blocking (bool), optional

defaults to True. Wait for movement to complete. Defaults to True.

moving_time (float), optional

defaults to 0.3. Time to complete the movement. Defaults to 0.3.

accel_time (float), optional

defaults to 0.15. Time to accelerate/decelerate. Defaults to 0.15.

name (str), optional

Unused

moveByVelocity

UR5e.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, name: str)

Move the robot end effector with specified velocities.

Arguments
linear_velocity (Velocity)
required

Velocity

Linear velocity components

angular_velocity (Velocity)
required

Velocity

Angular velocity components

name (str), optional

Unused

stop

UR5e.stop(immediate)

Stop any movement of the robot.

Arguments
immediate (bool), optional

If True, stops immediately by killing script. If False, performs controlled stop. Defaults to False.

grasp

UR5e.grasp()

release

UR5e.release()

shutdown

UR5e.shutdown()

getEndEffectorPose

UR5e.getEndEffectorPose()

Get the current end effector pose.

Returns

Pose

Current end effector position and orientation

getPosition

UR5e.getPosition(name: str)

Get the current end effector position.

Returns

Position

Current end effector position name (str, optional): Unused

getOrientation

UR5e.getOrientation(name: str)

Get the current end effector orientation.

Returns

Orientation

Current end effector orientation name (str, optional): Unused

getJointAngles

UR5e.getJointAngles()

Get current joint angles.

Returns

List of current joint angles in radians

getJointVelocities

UR5e.getJointVelocities()

Get current joint velocities.

Returns

List of current joint velocities in radians/second

setJointAngles

UR5e.setJointAngles(angles: list, blocking: bool, moving_time: float | None, accel_time: float | None)

Set joint angles directly.

Arguments
angles (list)
required

List of target joint angles in radians

blocking (bool), optional

defaults to True. Wait for movement to complete. Defaults to True.

moving_time (float | None), optional

defaults to None. Time to complete the movement. Defaults to None.

accel_time (float | None), optional

defaults to None. Time to accelerate/decelerate. Defaults to None.

moveToHome

UR5e.moveToHome()

Was this page helpful?