Beispiel #1
0
def run_service(bosdyn_sdk_robot,
                port,
                service_name,
                device_names,
                show_debug_information=False,
                logger=None,
                codec="",
                res_width=-1,
                res_height=-1):
    # Proto service specific function used to attach a servicer to a server.
    add_servicer_to_server_fn = image_service_pb2_grpc.add_ImageServiceServicer_to_server

    # Instance of the servicer to be run.
    service_servicer = make_webcam_image_service(bosdyn_sdk_robot,
                                                 service_name,
                                                 device_names,
                                                 show_debug_information,
                                                 logger=logger,
                                                 codec=codec,
                                                 res_width=res_width,
                                                 res_height=res_height)
    return GrpcServiceRunner(service_servicer,
                             add_servicer_to_server_fn,
                             port,
                             logger=logger)
Beispiel #2
0
def main():
    parser = argparse.ArgumentParser()
    bosdyn.client.util.add_service_hosting_arguments(parser)
    options = parser.parse_args()

    setup_logging()

    # Create & initialize python service server
    announce_service_servicer = AnnounceServicer()
    service_runner = GrpcServiceRunner(
        announce_service_servicer,
        announce_service_protos_grpc.add_AnnounceServiceServicer_to_server,
        options.port)

    # Keep service alive until a keyboard interrupt.
    service_runner.run_until_interrupt()

    return True
def run_service(port, logger=None):
    # Proto service specific function used to attach a servicer to a server.
    add_servicer_to_server_fn = remote_service_pb2_grpc.add_RemoteMissionServiceServicer_to_server

    # Instance of the servicer to be run.
    service_servicer = HelloWorldServicer(logger=logger)
    return GrpcServiceRunner(service_servicer,
                             add_servicer_to_server_fn,
                             port,
                             logger=logger)
Beispiel #4
0
def run_service(bosdyn_sdk_robot, port, logger=None):
    # Proto service specific function used to attach a servicer to a server.
    add_servicer_to_server_fn = remote_service_pb2_grpc.add_RemoteMissionServiceServicer_to_server

    # Instance of the servicer to be run.
    service_servicer = PowerOffServicer(bosdyn_sdk_robot, logger=logger)
    return GrpcServiceRunner(service_servicer,
                             add_servicer_to_server_fn,
                             port,
                             logger=logger)
def run_service(bosdyn_sdk_robot, port, logger=None):
    # Proto service specific function used to attach a servicer to a server.
    add_servicer_to_server_fn = data_acquisition_plugin_service_pb2_grpc.add_DataAcquisitionPluginServiceServicer_to_server

    # Instance of the servicer to be run.
    service_servicer = make_service(bosdyn_sdk_robot, logger=logger)
    return GrpcServiceRunner(service_servicer,
                             add_servicer_to_server_fn,
                             port,
                             logger=logger)
Beispiel #6
0
def run_service(bosdyn_sdk_robot, options, logger=None):
    # Proto service specific function used to attach a servicer to a server.
    add_servicer_to_server_fn = image_service_pb2_grpc.add_ImageServiceServicer_to_server

    # Instance of the servicer to be run.
    init_success, service_servicer = make_ricoh_theta_image_service(
        options.theta_ssid, options.theta_password, options.theta_client,
        bosdyn_sdk_robot, logger, options.capture_continuously,
        options.live_stream)
    if init_success and service_servicer is not None:
        service_runner = GrpcServiceRunner(service_servicer,
                                           add_servicer_to_server_fn,
                                           options.port,
                                           logger=logger)
        return True, service_runner
    else:
        return False, None