UR5e
Inherits from:Arm
A class to control the Universal Robots UR5e robotic arm.
Attributes:
rtde_c: RTDE Control interface object
rtde_r: RTDE Receive interface object
rtde_i: RTDE IO interface object
end_effector: Gripper/end effector object if attached, should be an INSTANTIATED object
ee_state (int): Current state of end effector (OPEN/CLOSED)
Inherited methods
init
Arguments
IP address of the robot. Defaults to “192.168.1.102”.
End effector instance to use. Defaults to None.
Named camera interfaces. Defaults to None.
Whether to enable the rtde_c interface of the robot. For free-drive mode, set to False.
getImage
Arguments
moveToDeltaPose
Arguments
position offset (relative to the current position) added to current XYZ coordinates (meters)
orientation offset (relative to the current orientation) composed with current orientation. Defaults to the identity orientation.
Wait for movement to complete. Defaults to True.
Time to complete the movement. Defaults to 0.5.
Time to accelerate/decelerate. Defaults to 0.2.
getState
Returns
Current state of the robot containing: - robot_mode: int, Current robot mode (eg. 0 = Disconnected, 2 = Booting, 7 = Running, etc.) - joint_positions: 6-element list, Current joint positions (radians) - joint_velocities: 6-element list, Current joint velocities (radians/s) - tcp_force: 6-element list, Generalized forces in the Tool Center Point (N) - tcp_pose: 6-element list, Current TCP pose [x, y, z, rx, ry, rz] where rotation is in rotation vector format - tcp_speed: 6-element list, Actual speed of the tool given in Cartesian coordinates (m/s)
moveToPose
avoid_force can be used to stop the movement early if the force applied to the end effector exceeds a threshold, useful for soft placement or other movements where a collision is possible/ expected.
Arguments
Target pose position (meters)
Target pose orientation
Wait for movement to complete. Defaults to True.
Time to complete the movement (seconds). Defaults to 2.0s.
Time to spend accelerating and decelerating (seconds). Defaults to 0.5s.
If True, the robot will stop the movement early if the force applied to the end effector exceeds a threshold. Defaults to False.
Acceleration to use when stopping the movement. Defaults to 1.0.
Threshold for force to consider the movement successful. Defaults to 10.0.
startFreeDrive
endFreeDrive
moveToNamedPose
Arguments
Name of the pose to move to. Options are “home”, “sleep”, and “upright”.
Wait for movement to complete. Defaults to True.
Time to complete the movement. Defaults to 2.0.
Time to accelerate/decelerate. Defaults to 0.75.
moveByVelocity
Arguments
stop
Arguments
If True, stops immediately by killing script. If False, performs controlled stop and doesn’t kill the script. Defaults to False.
suction_grasp
Arguments
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
args
No description provided.
kwargs
No description provided.
grasp
validate_grasp
Returns
release
shutdown
getEndEffectorPose
getPosition
getOrientation
Returns
getJointAngles
getJointVelocities
setJointAngles
Arguments
moveToHome
Arguments
servoJointAngles
Arguments
List of target joint angles in radians
(seconds) Duration for which the command controls the robot. This is blocking.
(seconds) Range [0.03,0.2]. The current position is projected forward in time with the current velocity, and used to smooth the trajectory. A low value gives fast reaction, a high value prevents overshoot.
(range [100,2000]) Proportional gain of the PID controller that tracks target joint position Higher gains will cause the robot to move faster, but could cause jerkiness or oscillations.
initPeriod
Returns
Optional[float]
Current time (indicating the start of the current loop iteration), or None if the robot is not in control mode