From 0cbc4b576ecb0f5bdedaf003f438cdb2595e3b18 Mon Sep 17 00:00:00 2001 From: sklaw Date: Fri, 6 Jul 2018 21:07:05 +0800 Subject: [PATCH] Delete old codes --- .../RostopicsToTimeseries.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/rostopics_to_timeseries/RostopicsToTimeseries.py b/src/rostopics_to_timeseries/RostopicsToTimeseries.py index 6e24bd3..2901b39 100644 --- a/src/rostopics_to_timeseries/RostopicsToTimeseries.py +++ b/src/rostopics_to_timeseries/RostopicsToTimeseries.py @@ -157,7 +157,7 @@ def start_publishing_timeseries(self, topic_name): smoothed_sample = self.smooth_output(sample) if smoothed_sample is not None: msg = Timeseries(h, smoothed_sample) - self.smooth_pub(msg) + self.pub.publish(msg) else: break @@ -166,18 +166,6 @@ def start_publishing_timeseries(self, topic_name): except rospy.ROSInterruptException: break - def smooth_pub(self, msg): - self.smooth_cache.append(copy.deepcopy(msg)) - self.running_sum += msg.sample - if len(self.smooth_cache) == self.smooth_window_size: - smooth_sample = self.running_sum/self.smooth_window_size - msg = Timeseries(self.smooth_cache[self.centre].header, smooth_sample) - self.pub.publish(msg) - - ousted = self.smooth_cache.popleft() - self.running_sum -= ousted.sample - - class OfflineRostopicsToTimeseries(RostopicsToTimeseries): def __init__(self, topic_filtering_config): super(OfflineRostopicsToTimeseries, self).__init__(topic_filtering_config)