diff --git a/examples/matrices.py b/examples/matrices.py index d162a9d..1abc791 100644 --- a/examples/matrices.py +++ b/examples/matrices.py @@ -4,7 +4,7 @@ import urx import logging if __name__ == "__main__": - rob = urx.Robot("192.168.1.6", logLevel=logging.WARNING) + rob = urx.Robot("192.168.1.6") rob.set_tcp((0,0,0,0,0,0)) rob.set_payload(0.5, (0,0,0)) try: diff --git a/examples/simple.py b/examples/simple.py index 94129bc..12d1e7f 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -3,7 +3,9 @@ import urx import logging if __name__ == "__main__": - rob = urx.Robot("192.168.1.6", logLevel=logging.INFO) + logging.basicConfig(level=logging.WARN) + + rob = urx.Robot("192.168.1.6") rob.set_tcp((0,0,0,0,0,0)) rob.set_payload(0.5, (0,0,0)) try: diff --git a/examples/test_movep.py b/examples/test_movep.py index d0aee51..f60ab82 100644 --- a/examples/test_movep.py +++ b/examples/test_movep.py @@ -4,7 +4,7 @@ import logging if __name__ == "__main__": - rob = urx.Robot("192.168.1.6", logLevel=logging.INFO) + rob = urx.Robot("192.168.1.6") try: l = 0.1 v = 0.07 diff --git a/urx/robot.py b/urx/robot.py index cb90cc6..a16dbf9 100644 --- a/urx/robot.py +++ b/urx/robot.py @@ -6,7 +6,7 @@ http://support.universal-robots.com/URRobot/RemoteAccess from __future__ import absolute_import # necessary for import tricks to work with python2 __author__ = "Olivier Roulet-Dubonnet" -__copyright__ = "Copyright 2011-2013, Sintef Raufoss Manufacturing" +__copyright__ = "Copyright 2011-2015, Sintef Raufoss Manufacturing" __license__ = "GPLv3" import logging @@ -37,16 +37,13 @@ class URRobot(object): The RT interfaces is only used for the get_force related methods Rmq: A program sent to the robot i executed immendiatly and any running program is stopped """ - def __init__(self, host, useRTInterface=False, logLevel=logging.WARN, parserLogLevel=logging.WARN): + def __init__(self, host, useRTInterface=False): self.logger = logging.getLogger(self.__class__.__name__) - if len(logging.root.handlers) == 0: #dirty hack - logging.basicConfig() - self.logger.setLevel(logLevel) self.host = host self.csys = None self.logger.info("Opening secondary monitor socket") - self.secmon = ursecmon.SecondaryMonitor(self.host, logLevel=logLevel, parserLogLevel=parserLogLevel) #data from robot at 10Hz + self.secmon = ursecmon.SecondaryMonitor(self.host) #data from robot at 10Hz self.rtmon = None if useRTInterface: @@ -424,8 +421,8 @@ class Robot(URRobot): Compared to the URRobot class, this class adds the possibilty to work directly with matrices and includes support for calibrating the robot coordinate system """ - def __init__(self, host, useRTInterface=False, logLevel = logging.WARN, parserLogLevel=logging.WARN): - URRobot.__init__(self, host, useRTInterface, logLevel=logLevel, parserLogLevel=parserLogLevel) + def __init__(self, host, useRTInterface=False): + URRobot.__init__(self, host, useRTInterface) self.default_linear_acceleration = 0.01 self.default_linear_velocity = 0.01 self.csys_dict = {} diff --git a/urx/ursecmon.py b/urx/ursecmon.py index 5ff5b47..020b0ca 100644 --- a/urx/ursecmon.py +++ b/urx/ursecmon.py @@ -33,9 +33,8 @@ class TimeoutException(Exception): class ParserUtils(object): - def __init__(self, logLevel=logging.WARN): + def __init__(self): self.logger = logging.getLogger(__name__) - self.logger.setLevel(logLevel) def parse(self, data): """ @@ -194,11 +193,10 @@ class SecondaryMonitor(Thread): """ Monitor data from secondary port and send programs to robot """ - def __init__(self, host, logLevel=logging.WARN, parserLogLevel=logging.WARN): + def __init__(self, host): Thread.__init__(self) self.logger = logging.getLogger(self.__class__.__name__) - self.logger.setLevel(logLevel) - self._parser = ParserUtils(parserLogLevel) + self._parser = ParserUtils() self._dict = {} self._dictLock = Lock() self.host = host