airobot.utils.urscript_util¶
Tools for creating URScript messages, for communicating with the real UR robots over TCP/IP by creating URScript programs and sending them for execution on the robot’s system
built off of urscript.py, part of python-urx library (https://github.com/SintefManufacturing/python-urx)
-
class
airobot.utils.urscript_util.
Robotiq2F140URScript
(socket_host, socket_port, socket_name)[source]¶ Bases:
airobot.utils.urscript_util.URScript
Class for creating Robotiq 2F140 specific URScript messages to send to the UR robot, for setting gripper related variables
Parameters: -
set_activate
()[source]¶ Activate the gripper, by setting some internal variables on the UR controller to 1
-
set_gripper_force
(force)[source]¶ Set maximum gripper force
Parameters: force (int) – Desired maximum gripper force, ranges from 0-255
-
-
class
airobot.utils.urscript_util.
URScript
[source]¶ Bases:
object
Class for creating urscript programs to send to the UR5 controller
-
__init__
()[source]¶ Constructor, each urscript has a header and a program that runs on the contoller
-
constrain_unsigned_char
(value)[source]¶ Ensure that unsigned char values are constrained to between 0 and 255.
Parameters: value (int) – Value to ensure is between 0 and 255
-
sleep
(value)[source]¶ Add a sleep command to urscript program, sleep for a specified amount of time
Parameters: value (float) – Amount of time in seconds for program to sleep
-
socket_close
(socket_name)[source]¶ Add a close socket command to urscript program.
Parameters: socket_name (str) – Name of socket to close (must be same as name of socket that was opened previously)
-
socket_get_var
(var, socket_name)[source]¶ Add a command to the program with communicates over a socket connection to get the value of a variable
Parameters:
-
socket_open
(socket_host, socket_port, socket_name)[source]¶ Add a open socket command to urscript program with specified host, port, and name
Parameters:
-