# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

import agv_calib_control_pb2 as agv__calib__control__pb2

GRPC_GENERATED_VERSION = '1.78.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in agv_calib_control_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class AgvCalibControlServiceStub(object):
    """=========================================================
    核心服务：AGV 运控大脑（PID/MPC）参数自动化寻优调教代理
    [部署端 Server]：Windows车端 (满血保留自身算法，负责执行闭环追踪与高频汇报)
    [调用端 Client]：Linux标定服务器 (上帝视角，负责发轨迹、看误差、AI打分与发新参数)
    =========================================================
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.SetControlMode = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/SetControlMode',
                request_serializer=agv__calib__control__pb2.ModeRequest.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.EmergencyStop = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/EmergencyStop',
                request_serializer=agv__calib__control__pb2.Empty.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.ExecuteOpenLoopCmd = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/ExecuteOpenLoopCmd',
                request_serializer=agv__calib__control__pb2.OpenLoopRequest.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.FollowTestTrajectory = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/FollowTestTrajectory',
                request_serializer=agv__calib__control__pb2.TrajectoryRequest.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.ExecuteStepResponse = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/ExecuteStepResponse',
                request_serializer=agv__calib__control__pb2.StepResponseRequest.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.InjectTuningParameters = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/InjectTuningParameters',
                request_serializer=agv__calib__control__pb2.ControlParams.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.CommitControlParameters = channel.unary_unary(
                '/agv.calibration.control.AgvCalibControlService/CommitControlParameters',
                request_serializer=agv__calib__control__pb2.Empty.SerializeToString,
                response_deserializer=agv__calib__control__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.StreamTelemetry = channel.unary_stream(
                '/agv.calibration.control.AgvCalibControlService/StreamTelemetry',
                request_serializer=agv__calib__control__pb2.Empty.SerializeToString,
                response_deserializer=agv__calib__control__pb2.TelemetryData.FromString,
                _registered_method=True)


class AgvCalibControlServiceServicer(object):
    """=========================================================
    核心服务：AGV 运控大脑（PID/MPC）参数自动化寻优调教代理
    [部署端 Server]：Windows车端 (满血保留自身算法，负责执行闭环追踪与高频汇报)
    [调用端 Client]：Linux标定服务器 (上帝视角，负责发轨迹、看误差、AI打分与发新参数)
    =========================================================
    """

    def SetControlMode(self, request, context):
        """---------------------------------------------------------
        第一步：权限接管与生命周期安全管控
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：要求切断避障，但保留底层 PID/MPC 算法就绪
        🚙 [Windows 返回 -> Linux]：回复模式切换成功，准备好接考题
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def EmergencyStop(self, request, context):
        """💻 [Linux 发送 -> Windows]：断网或飞车时的最高级别急停，无视一切直接刹车
        🚙 [Windows 返回 -> Linux]：返回底层抱死结果
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecuteOpenLoopCmd(self, request, context):
        """---------------------------------------------------------
        第二步：运动考题下发 (开环排雷 / 闭环寻优 / 波峰对齐)
        ---------------------------------------------------------
        【场景A: 纯物理开环备用】
        💻 [Linux 发送 -> Windows]：要求切断算法盲跑，多用于摸底或辅助验证
        🚙 [Windows 返回 -> Linux]：确认已按指定 RPM/PWM 运转
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FollowTestTrajectory(self, request, context):
        """【场景B: 算法闭环调优】
        💻 [Linux 发送 -> Windows]：下发一条由几百个点组成的测试轨迹(如 S型贝塞尔曲线)
        🚙 [Windows 返回 -> Linux]：收到轨迹后，车端立刻使用它自带的 PID/MPC 算法努力贴合轨迹跑圈
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecuteStepResponse(self, request, context):
        """【场景C: 波峰时序对齐】
        💻 [Linux 发送 -> Windows]：下发极短促的阶跃加速指令，人为制造绝对速度波峰
        🚙 [Windows 返回 -> Linux]：确认加速。(Linux 借此波峰算出网络的绝对 Time Offset)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def InjectTuningParameters(self, request, context):
        """---------------------------------------------------------
        第三步：运控参数 AI 寻优：动态热注入与最终固化
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：Linux 发现上一圈跑得差，AI算出了新的 PID/前瞻距离，要求立即热注入
        🚙 [Windows 返回 -> Linux]：车端将新参数瞬间覆写进运行内存(不重启系统)，随时准备用新参数重跑
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CommitControlParameters(self, request, context):
        """💻 [Linux 发送 -> Windows]：Linux 判定误差极小，调优结束，命令固化目前内存里的最高分参数
        🚙 [Windows 返回 -> Linux]：车端将这组完美参数永久覆写进硬盘的 config.yaml 或系统注册表
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamTelemetry(self, request, context):
        """---------------------------------------------------------
        第四步：高频数字孪生体感上报 (50Hz)
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：空包触发，命令车端开始疯狂推流
        🚙 [Windows 持续流式返回 -> Linux]：以 50Hz 频率，持续上报自己的里程计坐标、速度和单调时间戳
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AgvCalibControlServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SetControlMode': grpc.unary_unary_rpc_method_handler(
                    servicer.SetControlMode,
                    request_deserializer=agv__calib__control__pb2.ModeRequest.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'EmergencyStop': grpc.unary_unary_rpc_method_handler(
                    servicer.EmergencyStop,
                    request_deserializer=agv__calib__control__pb2.Empty.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'ExecuteOpenLoopCmd': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteOpenLoopCmd,
                    request_deserializer=agv__calib__control__pb2.OpenLoopRequest.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'FollowTestTrajectory': grpc.unary_unary_rpc_method_handler(
                    servicer.FollowTestTrajectory,
                    request_deserializer=agv__calib__control__pb2.TrajectoryRequest.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'ExecuteStepResponse': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteStepResponse,
                    request_deserializer=agv__calib__control__pb2.StepResponseRequest.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'InjectTuningParameters': grpc.unary_unary_rpc_method_handler(
                    servicer.InjectTuningParameters,
                    request_deserializer=agv__calib__control__pb2.ControlParams.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'CommitControlParameters': grpc.unary_unary_rpc_method_handler(
                    servicer.CommitControlParameters,
                    request_deserializer=agv__calib__control__pb2.Empty.FromString,
                    response_serializer=agv__calib__control__pb2.StandardResponse.SerializeToString,
            ),
            'StreamTelemetry': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamTelemetry,
                    request_deserializer=agv__calib__control__pb2.Empty.FromString,
                    response_serializer=agv__calib__control__pb2.TelemetryData.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'agv.calibration.control.AgvCalibControlService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('agv.calibration.control.AgvCalibControlService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AgvCalibControlService(object):
    """=========================================================
    核心服务：AGV 运控大脑（PID/MPC）参数自动化寻优调教代理
    [部署端 Server]：Windows车端 (满血保留自身算法，负责执行闭环追踪与高频汇报)
    [调用端 Client]：Linux标定服务器 (上帝视角，负责发轨迹、看误差、AI打分与发新参数)
    =========================================================
    """

    @staticmethod
    def SetControlMode(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,
            '/agv.calibration.control.AgvCalibControlService/SetControlMode',
            agv__calib__control__pb2.ModeRequest.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/agv.calibration.control.AgvCalibControlService/EmergencyStop',
            agv__calib__control__pb2.Empty.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecuteOpenLoopCmd(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,
            '/agv.calibration.control.AgvCalibControlService/ExecuteOpenLoopCmd',
            agv__calib__control__pb2.OpenLoopRequest.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FollowTestTrajectory(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,
            '/agv.calibration.control.AgvCalibControlService/FollowTestTrajectory',
            agv__calib__control__pb2.TrajectoryRequest.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecuteStepResponse(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,
            '/agv.calibration.control.AgvCalibControlService/ExecuteStepResponse',
            agv__calib__control__pb2.StepResponseRequest.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def InjectTuningParameters(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,
            '/agv.calibration.control.AgvCalibControlService/InjectTuningParameters',
            agv__calib__control__pb2.ControlParams.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CommitControlParameters(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,
            '/agv.calibration.control.AgvCalibControlService/CommitControlParameters',
            agv__calib__control__pb2.Empty.SerializeToString,
            agv__calib__control__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamTelemetry(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_stream(
            request,
            target,
            '/agv.calibration.control.AgvCalibControlService/StreamTelemetry',
            agv__calib__control__pb2.Empty.SerializeToString,
            agv__calib__control__pb2.TelemetryData.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
