diff --git a/src/py_pubsub/py_pubsub/publisher_member_function.py b/src/py_pubsub/py_pubsub/publisher_member_function.py index 919bdd2e6f15daabeb6c5eceef3400ed7ba4bf9f..b6bdc1dbd5ab764b1f80054884bc954901b4114e 100755 --- a/src/py_pubsub/py_pubsub/publisher_member_function.py +++ b/src/py_pubsub/py_pubsub/publisher_member_function.py @@ -3,6 +3,7 @@ from rclpy.node import Node from std_msgs.msg import String + class MinimalPublisher(Node): def __init__(self): super().__init__('minimal_publisher') @@ -18,6 +19,7 @@ class MinimalPublisher(Node): self.get_logger().info(f"Publishing: \"{msg.data}\"") self.i += 1 + def main(args=None): rclpy.init(args=args) @@ -29,5 +31,6 @@ def main(args=None): rclpy.shutdown() + if __name__ == "__main__": main() \ No newline at end of file