def _depth_cb(self, img): self._depth_counter += 1 if self._depth_counter > self._THROTTLE: rospy.logdebug('publish depth') self._depth_pub.publish(img) self._depth_counter = 0