Skip to content

Commit

Permalink
added sleep timer to loop
Browse files Browse the repository at this point in the history
  • Loading branch information
tcappellari committed Oct 6, 2022
1 parent 85fa6a4 commit dd75461
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import rclpy
from rclpy.node import Node
import time
import py_perception.srv
from py_perception.srv import FilterCloud
from sensor_msgs.msg import PointCloud2
Expand Down Expand Up @@ -31,6 +32,7 @@ def call_filters(self):
self.passthrough_filter()
self.plane_segmentation()
self.cluster_extraction()
time.sleep(3.0)

def voxel_filter(self):
# =======================
Expand Down Expand Up @@ -133,8 +135,7 @@ def cluster_extraction(self):

def main(args=None):
rclpy.init(args=args)
node = FilterNode()
rclpy.spin(node)
rclpy.spin(FilterNode())
rclpy.shutdown()

if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import rclpy
from rclpy.node import Node
import py_perception.srv
import time
from py_perception.srv import FilterCloud
from sensor_msgs.msg import PointCloud2

Expand All @@ -28,6 +29,8 @@ def call_filters(self):
while rclpy.ok():
self.voxel_filter()

time.sleep(3.0) # sleep for 3 seconds

def voxel_filter(self):
# =======================
# VOXEL GRID FILTER
Expand Down Expand Up @@ -55,8 +58,7 @@ def cluster_extraction(self):

def main(args=None):
rclpy.init(args=args)
node = FilterNode()
rclpy.spin(node)
rclpy.spin(FilterNode())
rclpy.shutdown()

if __name__ == '__main__':
Expand Down

0 comments on commit dd75461

Please sign in to comment.