Skip to content

Commit

Permalink
fix(components): make all possible attributes private
Browse files Browse the repository at this point in the history
  • Loading branch information
domire8 committed Oct 28, 2024
1 parent 731e8e2 commit b5c3fa8
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 119 deletions.
16 changes: 8 additions & 8 deletions source/modulo_components/modulo_components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def _step(self):
Step function that is called periodically.
"""
try:
self._evaluate_periodic_callbacks()
self._evaluate_periodic_component_callbacks()
self.on_step_callback()
self._publish_outputs()
self._publish_predicates()
self._publish_component_outputs()
self._publish_component_predicates()
except Exception as e:
self.get_logger().error(f"Failed to execute step function: {e}", throttle_duration_sec=1.0)
self.raise_error()
Expand Down Expand Up @@ -88,12 +88,12 @@ def add_output(self, signal_name: str, data: str, message_type: MsgT,
:param publish_on_step: If true, the output is published periodically on step
"""
try:
parsed_signal_name = self._create_output(signal_name, data, message_type, clproto_message_type,
default_topic, fixed_topic, publish_on_step)
parsed_signal_name = self._create_component_output(signal_name, data, message_type, clproto_message_type,
default_topic, fixed_topic, publish_on_step)
topic_name = self.get_parameter_value(parsed_signal_name + "_topic")
self.get_logger().debug(f"Adding output '{parsed_signal_name}' with topic name '{topic_name}'.")
publisher = self.create_publisher(message_type, topic_name, self._qos)
self._outputs[parsed_signal_name]["publisher"] = publisher
publisher = self.create_publisher(message_type, topic_name, self.get_qos())
self._set_output_publisher(parsed_signal_name, publisher)
except Exception as e:
self.get_logger().error(f"Failed to add output '{signal_name}': {e}")

Expand All @@ -103,4 +103,4 @@ def raise_error(self):
"""
super().raise_error()
self.set_predicate("in_error_state", True)
self._finalize_interfaces()
self._finalize_component_interfaces()
Loading

0 comments on commit b5c3fa8

Please sign in to comment.