From 71694ace536d0f5245403775ff0bcfd44887c29b Mon Sep 17 00:00:00 2001 From: Eric Omielan Date: Sun, 22 Sep 2024 17:02:50 -0700 Subject: [PATCH] Prevent data collection from making file when not in use --- .../nodes/data_collection/data_collection_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boat_simulator/boat_simulator/nodes/data_collection/data_collection_node.py b/src/boat_simulator/boat_simulator/nodes/data_collection/data_collection_node.py index 38dd3ace7..71d6c615e 100644 --- a/src/boat_simulator/boat_simulator/nodes/data_collection/data_collection_node.py +++ b/src/boat_simulator/boat_simulator/nodes/data_collection/data_collection_node.py @@ -32,9 +32,9 @@ def shutdown_handler(signum: int, frame: Any) -> None: def main(args=None): rclpy.init(args=args) - node = DataCollectionNode() if is_collection_enabled(): try: + node = DataCollectionNode() # TODO Explore alternatives to using the signal library, such as ROS event handlers signal.signal(signal.SIGINT, shutdown_handler) rclpy.spin(node)