Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
naoki-mizuno committed Dec 3, 2019
2 parents e31be82 + 031803c commit 70fcfec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/ds4_driver/controller_ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def cb_feedback(self, msg):
:type msg: Feedback
:return:
"""
if self.device is None:
return

def to_int(v): return int(v * 255)
self.control(
# LED color
Expand Down
19 changes: 10 additions & 9 deletions src/ds4_driver/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ def new_module(module):
return Logger(module)

def error(self, msg, *args, **kwargs):
msg = self._format_msg_(msg)
rospy.logerr(msg, *args, **kwargs)
msg = self._format_msg_(msg, *args, **kwargs)
rospy.logerr(msg)

def warning(self, msg, *args, **kwargs):
msg = self._format_msg_(msg)
rospy.logwarn(msg, *args, **kwargs)
msg = self._format_msg_(msg, *args, **kwargs)
rospy.logwarn(msg)

def info(self, msg, *args, **kwargs):
msg = self._format_msg_(msg)
rospy.loginfo(msg, *args, **kwargs)
msg = self._format_msg_(msg, *args, **kwargs)
rospy.loginfo(msg, *args)

def debug(self, msg, *args, **kwargs):
msg = self._format_msg_(msg)
rospy.logdebug(msg, *args, **kwargs)
msg = self._format_msg_(msg, *args, **kwargs)
rospy.logdebug(msg)

def _format_msg_(self, msg):
def _format_msg_(self, msg, *args, **kwargs):
msg = msg.format(*args, **kwargs)
return '[{0}]: {1}'.format(self.module, msg)

0 comments on commit 70fcfec

Please sign in to comment.