Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-labs committed Aug 14, 2024
1 parent 3d4704e commit adc3d82
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AssertTopicLatency(BaseAction):
def __init__(self, topic_name: str, topic_type: str, latency: float, comparison_operator: bool, rolling_average_count: int, wait_for_first_message: bool):
super().__init__()
self.topic_name = topic_name
self.topic_type_str = topic_type
self.topic_type = topic_type
self.latency = latency
self.comparison_operator_feedback = comparison_operator[0]
self.comparison_operator = get_comparison_operator(comparison_operator)
Expand Down Expand Up @@ -101,8 +101,8 @@ def check_topic(self):
for name, topic_type in available_topics:
if name == self.topic_name:
topic_type = topic_type[0].replace('/', '.')
if self.topic_type_str:
if self.topic_type_str == topic_type:
if self.topic_type:
if self.topic_type == topic_type:
self.call_subscriber()
self.is_topic = True
return True
Expand All @@ -124,14 +124,14 @@ def check_topic(self):
return True

def call_subscriber(self):
datatype_in_list = self.topic_type_str.split(".")
self.topic_type = getattr(
datatype_in_list = self.topic_type.split(".")
topic_type = getattr(
importlib.import_module(".".join(datatype_in_list[:-1])),
datatype_in_list[-1]
)

self.subscription = self.node.create_subscription(
msg_type=self.topic_type,
msg_type=topic_type,
topic=self.topic_name,
callback=self._callback,
qos_profile=get_qos_preset_profile(['sensor_data']))
Expand Down

0 comments on commit adc3d82

Please sign in to comment.