cmvr-biohead/generated/cmvr/api/biohead_service_pb2_grpc.py
2025-08-21 13:49:41 +08:00

175 lines
7.8 KiB
Python

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from cmvr.api import biohead_command_pb2 as cmvr_dot_api_dot_biohead__command__pb2
class BioHeadServiceStub(object):
"""生物头部机器人服务接口
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SetExpression = channel.unary_unary(
'/cmvr.api.BioHeadService/SetExpression',
request_serializer=cmvr_dot_api_dot_biohead__command__pb2.SetFacialExpression.Request.SerializeToString,
response_deserializer=cmvr_dot_api_dot_biohead__command__pb2.SetFacialExpression.Feedback.FromString,
)
self.StreamExpression = channel.stream_stream(
'/cmvr.api.BioHeadService/StreamExpression',
request_serializer=cmvr_dot_api_dot_biohead__command__pb2.StreamFacialExpression.Request.SerializeToString,
response_deserializer=cmvr_dot_api_dot_biohead__command__pb2.StreamFacialExpression.Feedback.FromString,
)
self.GetSystemStatus = channel.unary_unary(
'/cmvr.api.BioHeadService/GetSystemStatus',
request_serializer=cmvr_dot_api_dot_biohead__command__pb2.GetStatus.Request.SerializeToString,
response_deserializer=cmvr_dot_api_dot_biohead__command__pb2.GetStatus.Feedback.FromString,
)
self.EmergencyStop = channel.unary_unary(
'/cmvr.api.BioHeadService/EmergencyStop',
request_serializer=cmvr_dot_api_dot_biohead__command__pb2.EmergencyStop.Request.SerializeToString,
response_deserializer=cmvr_dot_api_dot_biohead__command__pb2.EmergencyStop.Feedback.FromString,
)
class BioHeadServiceServicer(object):
"""生物头部机器人服务接口
"""
def SetExpression(self, request, context):
"""设置面部表情
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def StreamExpression(self, request_iterator, context):
"""流式表情控制
rpc StreamExpression(StreamFacialExpression.Request) returns (StreamFacialExpression.Feedback){};
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSystemStatus(self, request, context):
"""获取状态
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EmergencyStop(self, request, context):
"""紧急停止
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_BioHeadServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'SetExpression': grpc.unary_unary_rpc_method_handler(
servicer.SetExpression,
request_deserializer=cmvr_dot_api_dot_biohead__command__pb2.SetFacialExpression.Request.FromString,
response_serializer=cmvr_dot_api_dot_biohead__command__pb2.SetFacialExpression.Feedback.SerializeToString,
),
'StreamExpression': grpc.stream_stream_rpc_method_handler(
servicer.StreamExpression,
request_deserializer=cmvr_dot_api_dot_biohead__command__pb2.StreamFacialExpression.Request.FromString,
response_serializer=cmvr_dot_api_dot_biohead__command__pb2.StreamFacialExpression.Feedback.SerializeToString,
),
'GetSystemStatus': grpc.unary_unary_rpc_method_handler(
servicer.GetSystemStatus,
request_deserializer=cmvr_dot_api_dot_biohead__command__pb2.GetStatus.Request.FromString,
response_serializer=cmvr_dot_api_dot_biohead__command__pb2.GetStatus.Feedback.SerializeToString,
),
'EmergencyStop': grpc.unary_unary_rpc_method_handler(
servicer.EmergencyStop,
request_deserializer=cmvr_dot_api_dot_biohead__command__pb2.EmergencyStop.Request.FromString,
response_serializer=cmvr_dot_api_dot_biohead__command__pb2.EmergencyStop.Feedback.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'cmvr.api.BioHeadService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class BioHeadService(object):
"""生物头部机器人服务接口
"""
@staticmethod
def SetExpression(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/cmvr.api.BioHeadService/SetExpression',
cmvr_dot_api_dot_biohead__command__pb2.SetFacialExpression.Request.SerializeToString,
cmvr_dot_api_dot_biohead__command__pb2.SetFacialExpression.Feedback.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StreamExpression(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(request_iterator, target, '/cmvr.api.BioHeadService/StreamExpression',
cmvr_dot_api_dot_biohead__command__pb2.StreamFacialExpression.Request.SerializeToString,
cmvr_dot_api_dot_biohead__command__pb2.StreamFacialExpression.Feedback.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetSystemStatus(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/cmvr.api.BioHeadService/GetSystemStatus',
cmvr_dot_api_dot_biohead__command__pb2.GetStatus.Request.SerializeToString,
cmvr_dot_api_dot_biohead__command__pb2.GetStatus.Feedback.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def EmergencyStop(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/cmvr.api.BioHeadService/EmergencyStop',
cmvr_dot_api_dot_biohead__command__pb2.EmergencyStop.Request.SerializeToString,
cmvr_dot_api_dot_biohead__command__pb2.EmergencyStop.Feedback.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)