From fa299cc83fd4bb0cb86a21e0ff42406feefab1ba Mon Sep 17 00:00:00 2001 From: yjinzero Date: Thu, 13 Feb 2025 22:01:39 +0900 Subject: [PATCH] reorg a bit --- deploy/deploy_real/state_pub.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy/deploy_real/state_pub.py b/deploy/deploy_real/state_pub.py index 602c49f..c966985 100644 --- a/deploy/deploy_real/state_pub.py +++ b/deploy/deploy_real/state_pub.py @@ -11,14 +11,12 @@ import yaml class StatePublisher(Node): def __init__(self): - rclpy.init() super().__init__('state_publisher') qos_profile = QoSProfile(depth=10) with open('./configs/ik.yaml', 'r') as fp: self.joint_names = yaml.safe_load(fp)['motor_joint'] - self.low_state = LowStateHG() self.low_state_subscriber = self.create_subscription(LowStateHG, 'lowstate', self.on_low_state, 10) @@ -62,8 +60,11 @@ class StatePublisher(Node): def main(): + rclpy.init() node = StatePublisher() - node.run() + rclpy.spin(node) + node.destroy_node() + rclpy.shutdown() if __name__ == '__main__': main() \ No newline at end of file