Skip to content

Commit

Permalink
only import compasses when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrehall68 committed Nov 23, 2024
1 parent ceda5bc commit c3d46b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compass/compass/main.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")
Expand Down

0 comments on commit c3d46b2

Please sign in to comment.