API Reference

Connection

URCtrl(...)

Create a UR controller instance; connect() is called during initialization.

connect() -> bool

Connect the RTDEControl, RTDEReceive, and RTDEIO interfaces from SDU Robotics ur_rtde.

disconnect() -> bool

Save virtual variables and close the connections.

reconnect() -> bool

Disconnect and reconnect.

is_connected() -> bool

Return whether the ur_rtde interfaces are connected.

get_version() -> str

Return the PolyScope or SDU Robotics ur_rtde version.

Variables

get_var(kind_or_combined, id_num=None)

Retrieve P/I/F/IO variables.

set_var(kind_or_combined, id_or_value, value=None)

Set P/I/F/IO variables.

get_P(id_num) / set_P(id_num, value)

Access P variables.

teach(kind_or_combined="P", id_num=None, save=True)

Save the current P/J values to virtual variables.

get_I() / set_I() / get_F() / set_F()

Access I/F variables.

Settings

set_motion_mode() / get_motion_mode()

Set or retrieve the motion mode.

set_coord_type() / get_coord_type()

Set or retrieve the default P/J coordinate type.

set_speed() / get_speed()

Set or retrieve the linear-speed percentage.

set_jspeed() / get_jspeed()

Set or retrieve the joint-speed percentage.

set_accel() / get_accel()

Set or retrieve the acceleration percentage.

set_decel() / get_decel()

Set or retrieve the stopping-deceleration percentage.

Status

current_position

Return the current P pose.

current_angle

Return the current J angles.

state()

Return UR status as a dictionary.

is_running()

Return the RTDE script execution status.

motion_complete()

Return whether the robot is steady.

wait_for_complete(timeout=None, interval=0.02)

Wait for completion.

Motion

move(target, ...)

Move to a single target.

move_path(targets, ...)

Move through multiple targets.

drive(target, relative=False, ...)

Move a specified joint axis.

dev(base, offset)

Simple component-wise addition of six values.

pose_trans(base, offset)

Equivalent to URScript pose_trans().

p2j(p_type_pos) / j2p(j_type_pos)

Inverse/forward kinematics.

stop() / halt() / task_stop() / hand_stop()

Stop motion.

IO / TCP

set_IO(id_num, value) / get_IO(id_num)

Digital output.

get_digital_input(id_num)

Digital input.

set_tcp(tcp)

Set the TCP offset.

get_current_tool()

Get the TCP offset.

is_pose_within_safety_limits(pose)

Check whether a P pose is within safety limits.

is_joints_within_safety_limits(joints)

Check whether joint coordinates are within safety limits.

Errors

get_current_error_info()

Return current error information.

reset_error()

Attempt recovery.

turn_on_motor() / turn_off_motor()

Control motor power/brakes through Dashboard.

Unsupported

The following are unsupported in the UR implementation or specific to COBOTTA.

  • move_circle()

  • rotate()

  • init_hand()

  • open_hand()

  • hand()

  • take_camera()

  • take_script()

  • run_script()

  • COBOTTA file-transfer functions