# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: robot-config.proto
# plugin: python-betterproto2
# This file has been @generated

__all__ = (
    "Anchor",
    "CameraCalibration",
    "Gripper",
    "Resolution",
    "StringmanPilotConfig",
)

from dataclasses import dataclass

import betterproto2

from ...message_pool import default_message_pool

_COMPILER_VERSION = "0.9.0"
betterproto2.check_compiler_version(_COMPILER_VERSION)


@dataclass(eq=False, repr=False)
class Anchor(betterproto2.Message):
    """
    Configuration of an Anchor
    """

    num: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)
    """
    Index of the anchor in the system (0 to 4).
    """

    service_name: "str | None" = betterproto2.field(
        2, betterproto2.TYPE_STRING, optional=True
    )
    """
    123.cranebot-anchor-service.2ccf67bc3fc4
    """

    pose: "_common__.Pose | None" = betterproto2.field(
        3, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    Pose composed of rvec and tvec (standard OpenCV format)
    """

    address: "str | None" = betterproto2.field(
        4, betterproto2.TYPE_STRING, optional=True
    )
    """
    IP address where last seen
    """

    port: "int" = betterproto2.field(5, betterproto2.TYPE_UINT32)


default_message_pool.register_message("nf.config", "Anchor", Anchor)


@dataclass(eq=False, repr=False)
class CameraCalibration(betterproto2.Message):
    resolution: "Resolution | None" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, optional=True
    )

    intrinsic_matrix: "list[float]" = betterproto2.field(
        2, betterproto2.TYPE_DOUBLE, repeated=True
    )
    """
    Flattened 3x3 matrix (row-major)
    [fx, 0, cx, 0, fy, cy, 0, 0, 1]
    """

    distortion_coeff: "list[float]" = betterproto2.field(
        3, betterproto2.TYPE_DOUBLE, repeated=True
    )
    """
    1x5 distortion coefficients
    [k1, k2, p1, p2, k3]
    """


default_message_pool.register_message(
    "nf.config", "CameraCalibration", CameraCalibration
)


@dataclass(eq=False, repr=False)
class Gripper(betterproto2.Message):
    service_name: "str | None" = betterproto2.field(
        1, betterproto2.TYPE_STRING, optional=True
    )
    """
    service name also indicates which type it is, such as pilot gripper or arp.
    """

    address: "str | None" = betterproto2.field(
        2, betterproto2.TYPE_STRING, optional=True
    )

    port: "int" = betterproto2.field(3, betterproto2.TYPE_UINT32)

    frame_room_spin: "float" = betterproto2.field(4, betterproto2.TYPE_DOUBLE)
    """
    Rotation in radians
    """


default_message_pool.register_message("nf.config", "Gripper", Gripper)


@dataclass(eq=False, repr=False)
class Resolution(betterproto2.Message):
    width: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)

    height: "int" = betterproto2.field(2, betterproto2.TYPE_UINT32)


default_message_pool.register_message("nf.config", "Resolution", Resolution)


@dataclass(eq=False, repr=False)
class StringmanPilotConfig(betterproto2.Message):
    """
    Message representing the configuration read and written by observer
    """

    anchors: "list[Anchor]" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, repeated=True
    )

    camera_cal: "CameraCalibration | None" = betterproto2.field(
        2, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    The camera calibration values for a raspberry pi camera module 3 standard
    """

    camera_cal_wide: "CameraCalibration | None" = betterproto2.field(
        10, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    values for a raspberry pi camera module 3 wide
    """

    max_accel: "float" = betterproto2.field(3, betterproto2.TYPE_DOUBLE)
    """
    Max acceleration of anchor line in meters per second squarted
    """

    rec_mod: "int" = betterproto2.field(4, betterproto2.TYPE_INT32)
    """
    record line length every nth iteration of the main anchor loop
    """

    running_ws_delay: "float" = betterproto2.field(5, betterproto2.TYPE_DOUBLE)
    """
    running delay of main anchor loop in seconds.
    """

    gripper: "Gripper | None" = betterproto2.field(
        6, betterproto2.TYPE_MESSAGE, optional=True
    )

    preferred_cameras: "list[int]" = betterproto2.field(
        7, betterproto2.TYPE_INT32, repeated=True
    )
    """
    List of anchor nums of preferred anchor cameras.
    """

    robot_id: "str" = betterproto2.field(8, betterproto2.TYPE_STRING)

    has_been_calibrated: "bool" = betterproto2.field(9, betterproto2.TYPE_BOOL)


default_message_pool.register_message(
    "nf.config", "StringmanPilotConfig", StringmanPilotConfig
)


from .. import common as _common__
