diff --git a/setup.py b/setup.py index 3200cec..5b14d87 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.command.install_data import install_data setup (name = "urx", - version = "0.9.3", + version = "0.9.4", description = "Python library to control an UR robot", author = "Olivier Roulet-Dubonnet", author_email = "olivier.roulet@gmail.com", diff --git a/urx/robot.py b/urx/robot.py index f607eae..7f37136 100644 --- a/urx/robot.py +++ b/urx/robot.py @@ -209,13 +209,13 @@ class Robot(URRobot): vector = vector.list return URRobot.set_gravity(self, vector) - def new_csys_from_pxy(self): + def new_csys_from_xpy(self): """ - Return new coordinate system from three points: Origin, X, Y + Return new coordinate system from three points: X, Origin, Y based on math3d: Transform.new_from_xyp """ print("A new coordinate system will be defined from the next three points") - print("Firs point is origin, second X, third Y") + print("Firs point is X, second Origin, third Y") print("Set it as a new reference by calling myrobot.set_csys(new_csys)") input("Move to first point and click Enter") # we do not use get_pose so we avoid rounding values diff --git a/urx/urrobot.py b/urx/urrobot.py index 85265ec..7e6fc6a 100644 --- a/urx/urrobot.py +++ b/urx/urrobot.py @@ -171,6 +171,12 @@ class URRobot(object): """ return self.secmon.get_digital_out(val, wait=wait) + def get_digital_out_bits(self, wait=False): + """ + get digital output as a byte + """ + return self.secmon.get_digital_out_bits(wait=wait) + def set_analog_out(self, output, val): """ set analog output, val is a float diff --git a/urx/ursecmon.py b/urx/ursecmon.py index 07b9562..87df541 100644 --- a/urx/ursecmon.py +++ b/urx/ursecmon.py @@ -364,6 +364,12 @@ class SecondaryMonitor(Thread): else: return 0 + def get_digital_out_bits(self, wait=False): + if wait: + self.wait() + with self._dictLock: + return self._dict["MasterBoardData"]["digitalOutputBits"] + def get_digital_in(self, nb, wait=False): if wait: self.wait() @@ -375,18 +381,18 @@ class SecondaryMonitor(Thread): else: return 0 - def get_analog_in(self, nb, wait=False): - if wait: - self.wait() - with self._dictLock: - return self._dict["MasterBoardData"]["analogInput" + str(nb)] - def get_digital_in_bits(self, wait=False): if wait: self.wait() with self._dictLock: return self._dict["MasterBoardData"]["digitalInputBits"] + def get_analog_in(self, nb, wait=False): + if wait: + self.wait() + with self._dictLock: + return self._dict["MasterBoardData"]["analogInput" + str(nb)] + def get_analog_inputs(self, wait=False): if wait: self.wait()