Skip to content

Commit

Permalink
rospy.sleep exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
fmessmer committed Jan 19, 2017
1 parent c8d9b18 commit d573c99
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cob_dashboard/scripts/cob_dashboard_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ def publish(self):
r = rospy.Rate(1)
while not rospy.is_shutdown():
da.publish()
r.sleep()
try:
r.sleep()
except rospy.exceptions.ROSInterruptException as e:
#print "ROSInterruptException", e
pass
13 changes: 11 additions & 2 deletions cob_monitoring/src/hz_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ def run(self):
break
rospy.loginfo("hz monitor is waiting for type of topics %s."%str(self.missing_topics))
self.publish_diagnostics()
r.sleep()

try:
r.sleep()
except rospy.exceptions.ROSInterruptException as e:
#print "ROSInterruptException", e
pass

# call rostopic hz
#rt = rostopic.ROSTopicHz(self.window_size)
Expand All @@ -65,7 +70,11 @@ def run(self):
while not rospy.is_shutdown():
#rt.print_hz() # taken from 'rostopic hz' (/opt/ros/indigo/lib/python2.7/dist-packages/rostopic/__init__.py)
self.publish_diagnostics(rt_HZ_store)
r.sleep()
try:
r.sleep()
except rospy.exceptions.ROSInterruptException as e:
#print "ROSInterruptException", e
pass

def publish_diagnostics(self, rt_HZ_store = []):
# set desired rates
Expand Down

0 comments on commit d573c99

Please sign in to comment.