Connection and Initialization
Constructor
URCtrl(
robot_ip="10.170.10.56",
arm_name="Arm",
instance_name="Ctrl",
logger=None,
log_level=None,
config=None,
)
On initialization, URCtrl connects SDU Robotics ur_rtde RTDEControl, RTDEReceive, and RTDEIO. Dashboard is connected only when enabled in the configuration.
config
Representative configuration settings are listed below.
Setting |
Meaning |
|---|---|
|
UR controller IP address |
|
Virtual-variable storage file |
|
Enable DashboardClient |
|
Maximum linear speed |
|
Maximum linear acceleration |
|
Maximum joint speed |
|
Maximum joint acceleration |
|
Blend radius for |
|
Allow safety restart |
Dashboard
turn_on_motor(), turn_off_motor(), and some reset_error() operations require Dashboard.
class Config:
ROBOT_IP = "10.170.10.56"
UR_USE_DASHBOARD = True
robot = URCtrl(config=Config)
Without Dashboard, these operations return False and record the reason in the error information.
connect()
robot.connect()
Connect SDU Robotics ur_rtde RTDEControlInterface, RTDEReceiveInterface, and RTDEIOInterface.
disconnect()
robot.disconnect()
Save virtual variables, then disconnect Dashboard, RTDEIO, RTDEReceive, and RTDEControl in that order.
Context Manager (with)
with URCtrl(ROBOT_IP) as robot:
...
Using with calls disconnect() when leaving the context.