| @@ -3,6 +3,8 @@ from builtin_interfaces.msg import Duration | |||||
| import rclpy | import rclpy | ||||
| from rclpy.node import Node | from rclpy.node import Node | ||||
| import time | |||||
| class JTCPublisher(Node): | class JTCPublisher(Node): | ||||
| def __init__(self): | def __init__(self): | ||||
| super().__init__('jtc_publisher') | super().__init__('jtc_publisher') | ||||
| @@ -38,6 +40,12 @@ class JTCPublisher(Node): | |||||
| JointTrajectoryPoint (time_from_start = Duration(sec = 10), positions =[direction * 0, direction * -1.4, direction * 0]), | JointTrajectoryPoint (time_from_start = Duration(sec = 10), positions =[direction * 0, direction * -1.4, direction * 0]), | ||||
| ] | ] | ||||
| ) | ) | ||||
| for tag in self.group_tags_: | |||||
| while self.count_subscribers(f"/{tag}_group_controller/joint_trajectory") == 0: | |||||
| time.sleep(0.1) | |||||
| for tag in self.group_tags_: | |||||
| self.publisher_[tag].publish(trajectory[tag]) | self.publisher_[tag].publish(trajectory[tag]) | ||||
| def main(args = None): | def main(args = None): | ||||