Skip to content

Commit c46c867

Browse files
Merge pull request #43 from Vayu-Robotics/jashton/fix-subscriber-coordinator
Fix errors when instantiating numeric set subscriber
2 parents 6abb20e + 614a6c5 commit c46c867

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

formant_ros2_adapter/scripts/components/subscriber/numeric_set_subscriber_coodinator.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def _setup_subscription_for_config(self, numeric_set_config: NumericSetConfig):
8484
subscriber.qos_profile, qos_profile_system_default
8585
)
8686

87-
new_sub = self.ros2_node.create_subscription(
87+
new_sub = self._node.create_subscription(
8888
get_ros2_type_from_string(ros2_type),
8989
topic,
90-
lambda msg, stream=formant_stream, config=numeric_set_config, subscriber_config=subscriber: self._handle_message(
91-
msg, stream, config, subscriber_config
90+
lambda msg, config=numeric_set_config, subscriber_config=subscriber: self._handle_message(
91+
msg, config, subscriber_config
9292
),
9393
qos_profile=qos_profile,
9494
)
@@ -100,12 +100,9 @@ def _handle_message(
100100
subscriber_config: NumericSetSubscriberConfig,
101101
):
102102
with self._config_lock:
103-
self._logger.info("Handling message")
104103
formant_stream = numeric_set_config.formant_stream
105104
path = subscriber_config.message_path
106105
if path:
107-
path = subscriber_config["ros2_message_path"]
108-
109106
try:
110107
msg = get_message_path_value(msg, path)
111108
msg_type = type(msg)

0 commit comments

Comments
 (0)