import rclpy from rclpy.node import Node # Service Type Files from custom_interfaces.srv import CustomSrv1 # Service Minimal Host and Client import pubsub.pubsub_library_v3 as lib def main(args=None): rclpy.init(args=args) minimal_service = lib.MinimalServiceProvider(NODE_NAME="Srv_host_test_node", SRV_NAME="test_srv", SRV_TYPE=CustomSrv1) while rclpy.ok(): try: rclpy.spin_once(minimal_service, timeout_sec=0.1) # Either the scripts checks to see if new srv calls are available to work off, # or you implement this work inside the class # pro/cons: abstraction is at a maximum, every further level is already too specific for the general task except (KeyboardInterrupt, SystemExit): print("\n\nShutting down...") minimal_service.destroy_node() rclpy.shutdown() if __name__ == '__main__': main()