Skip to content

Commit

Permalink
Delete old codes
Browse files Browse the repository at this point in the history
  • Loading branch information
sklaw committed Jul 6, 2018
1 parent afd5082 commit 0cbc4b5
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/rostopics_to_timeseries/RostopicsToTimeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 0cbc4b5

Please sign in to comment.