def __init__(self): self.server_robot = ServerRobot() rospy.init_node('robot_server', anonymous=False) rospy.Subscriber('robot_command_json', MsgRobotCommand, self.callback, queue_size=None)
def __init__(self): rospy.init_node('robot_service_server', anonymous=False) self.service = rospy.Service('robot_send_command', SrvRobotCommand, self.cb_robot_command) robot_ip = rospy.get_param('~robot_ip', '192.168.30.4') self.server_robot = ServerRobot() self.server_robot.connect(robot_ip) rospy.on_shutdown(self.server_robot.disconnect) rospy.spin()