tool functions are added.
This commit is contained in:
parent
58e1a1dad4
commit
80e0c2e917
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,7 +3,7 @@ build
|
|||||||
.idea/
|
.idea/
|
||||||
.history/
|
.history/
|
||||||
*.pyc
|
*.pyc
|
||||||
dist/urx-0.11.0-py3.10.egg
|
dist/*.egg
|
||||||
urx.egg-info/dependency_links.txt
|
urx.egg-info/dependency_links.txt
|
||||||
urx.egg-info/PKG-INFO
|
urx.egg-info/PKG-INFO
|
||||||
urx.egg-info/requires.txt
|
urx.egg-info/requires.txt
|
||||||
|
@ -254,6 +254,27 @@ class URRobot(object):
|
|||||||
prog = "set_tool_voltage(%s)" % (val)
|
prog = "set_tool_voltage(%s)" % (val)
|
||||||
self.send_program(prog)
|
self.send_program(prog)
|
||||||
|
|
||||||
|
def set_tool_digital_in(self, input_id):
|
||||||
|
"""
|
||||||
|
set voltage to be delivered to the tool, val is 0, 12 or 24
|
||||||
|
"""
|
||||||
|
prog = "set_tool_digital_in(%s)" % (input_id)
|
||||||
|
self.send_program(prog)
|
||||||
|
|
||||||
|
def set_tool_digital_out(self, input_id, signal_level):
|
||||||
|
"""
|
||||||
|
set voltage to be delivered to the tool, val is 0, 12 or 24
|
||||||
|
"""
|
||||||
|
prog = "set_tool_digital_out(%s, %s)" % (input_id, signal_level)
|
||||||
|
self.send_program(prog)
|
||||||
|
|
||||||
|
def set_tool_communication(self, enabled=True, baud_rate=9600, parity=0, stop_bits=1, rx_idle_chars=1.0, tx_idle_chars=3.5):
|
||||||
|
"""
|
||||||
|
set voltage to be delivered to the tool, val is 0, 12 or 24
|
||||||
|
"""
|
||||||
|
prog = "set_tool_communication(%s, %s, %s, %s, %s, %s)" % (enabled, baud_rate, parity, stop_bits, rx_idle_chars, tx_idle_chars)
|
||||||
|
self.send_program(prog)
|
||||||
|
|
||||||
def _wait_for_move(self, target, threshold=None, timeout=5, joints=False):
|
def _wait_for_move(self, target, threshold=None, timeout=5, joints=False):
|
||||||
"""
|
"""
|
||||||
wait for a move to complete. Unfortunately there is no good way to know when a move has finished
|
wait for a move to complete. Unfortunately there is no good way to know when a move has finished
|
||||||
|
@ -151,6 +151,30 @@ class URScript(object):
|
|||||||
self.add_line_to_program(msg)
|
self.add_line_to_program(msg)
|
||||||
self._sync()
|
self._sync()
|
||||||
|
|
||||||
|
def _get_tool_digital_in(self, input_id):
|
||||||
|
assert(input_id in [0, 1])
|
||||||
|
msg = "get_standard_digital_in({})".format(input_id)
|
||||||
|
self.add_line_to_program(msg)
|
||||||
|
|
||||||
|
def _set_tool_digital_out(self, input_id, signal_level):
|
||||||
|
assert(input_id in [0, 1])
|
||||||
|
assert(signal_level in [True, False])
|
||||||
|
msg = "set_standard_digital_out({}, {})".format(input_id, signal_level)
|
||||||
|
self.add_line_to_program(msg)
|
||||||
|
|
||||||
|
def _set_tool_communication(self, enabled=True, baud_rate=9600, parity=0, stop_bits=1, rx_idle_chars=1.5, tx_idle_chars=3.5):
|
||||||
|
# stop_bits:Thenumberofstopbits(int).Validvalues:1,2.
|
||||||
|
# rx_idle_chars:AmountofcharstheRXunitinthetoolshouldwaitbeforemarkingamessage asover/sendingittothePC(float).Validvalues:min=1.0max=40.0.
|
||||||
|
# tx_idle_chars:
|
||||||
|
# set_tool_communication(True,115200,1,2,1.0,3.5)
|
||||||
|
# :9600,19200,38400,57600,115200, 1000000,2000000,5000000
|
||||||
|
assert(baud_rate in [9600,19200,38400,57600,115200, 1000000,2000000,5000000])
|
||||||
|
assert(parity in [0, 1, 2])
|
||||||
|
assert(stop_bits in [1, 2])
|
||||||
|
assert(enabled in [True, False])
|
||||||
|
msg = "set_tool_communication({}, {}, {}, {}, {}, {})".format(enabled, baud_rate, parity, stop_bits, rx_idle_chars, tx_idle_chars)
|
||||||
|
self.add_line_to_program(msg)
|
||||||
|
|
||||||
def _sync(self):
|
def _sync(self):
|
||||||
msg = "sync()"
|
msg = "sync()"
|
||||||
self.add_line_to_program(msg)
|
self.add_line_to_program(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user