jsk-ros-pkg / jsk_3rdparty

42 stars 60 forks source link

[respeaker_ros] Stop timer on shutdown #385

Closed nakane11 closed 1 year ago

nakane11 commented 2 years ago

This PR avoids AttributeError when ctrl + C is pressed.

Exception in thread Thread-10:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/timer.py", line 234, in run   
    self._callback(TimerEvent(last_expected, last_real, current_expected, current_real, last_duration))
  File "/home/fetch/ros/melodic/src/jsk-ros-pkg/jsk_3rdparty/respeaker_ros/scripts/respeaker_node.py", line 482, in on_timer
    is_voice = self.respeaker.is_voice()
AttributeError: 'NoneType' object has no attribute 'is_voice'