Skip to content

Commit

Permalink
added to scan test, odom test
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com>
  • Loading branch information
delihus committed Oct 30, 2023
1 parent e5532e4 commit 00e9fd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 9 additions & 4 deletions rosbot_xl_bringup/test/test_scan_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ def test_scan_filter():
node.start_publishing_fake_hardware()

node.start_node_thread()
# msgs_received_flag = node.scan_filter_event.wait(timeout=10.0)
# assert (
# msgs_received_flag
# ), "Expected filtered scan but it is not filtered properly. Check laser_filter!"
msgs_received_flag = node.scan_filter_event.wait(timeout=10.0)
assert (
msgs_received_flag
), "Expected filtered scan but it is not filtered properly. Check laser_filter!"

msgs_received_flag = node.odom_tf_event.wait(timeout=10.0)
assert (
msgs_received_flag
), "Expected odom to base_link tf but it was not received. Check robot_localization!"

finally:
rclpy.shutdown()
10 changes: 5 additions & 5 deletions rosbot_xl_bringup/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def create_test_subscribers_and_publishers(self):
self.tf_buffer = Buffer()
self.tf_listener = TransformListener(self.tf_buffer, self)

# self.scan_publisher = self.create_publisher(LaserScan, "scan", 10)
# self.filtered_scan_subscriber = self.create_subscription(
# LaserScan, "scan_filtered", self.filtered_scan_callback, 10
# )
self.scan_publisher = self.create_publisher(LaserScan, "scan", 10)
self.filtered_scan_subscriber = self.create_subscription(
LaserScan, "scan_filtered", self.filtered_scan_callback, 10
)

self.timer = None

Expand Down Expand Up @@ -76,7 +76,7 @@ def filtered_scan_callback(self, msg: LaserScan):
def timer_callback(self):
self.publish_fake_hardware_messages()
self.lookup_transform_odom()
# self.publish_scan()
self.publish_scan()

def publish_fake_hardware_messages(self):
imu_msg = Imu()
Expand Down

0 comments on commit 00e9fd7

Please sign in to comment.