From c3d46b2d8fa52130e3c05d2232e8ae65a8695814 Mon Sep 17 00:00:00 2001 From: chrehall68 Date: Sat, 23 Nov 2024 13:24:21 -0800 Subject: [PATCH] only import compasses when needed --- src/compass/compass/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compass/compass/main.py b/src/compass/compass/main.py index fbb8f7f..2da3621 100644 --- a/src/compass/compass/main.py +++ b/src/compass/compass/main.py @@ -1,5 +1,3 @@ -from compass.actual_compass import ActualCompass -from compass.fake_compass import FakeCompass from std_msgs.msg import Float64 from constants import COMPASS_TOPIC, QOS from rclpy.node import Node @@ -20,8 +18,12 @@ def __init__(self): ) if self.get_parameter("compass_type").value == "actual": + from compass.actual_compass import ActualCompass + self.compass = ActualCompass() elif self.get_parameter("compass_type").value == "fake": + from compass.fake_compass import FakeCompass + self.compass = FakeCompass() else: raise ValueError("Unknown compass type")