# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: a42/sensors/camera.proto, a42/sensors/lidar.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List

import betterproto

from . import common
from . import data
from . import label


class LaserName(betterproto.Enum):
    """Identifiziert, welcher LiDAR das war"""

    UNKNOWN_NAME = 0
    WIM_HOR = 1
    ANPR_HOR = 2
    AMPEL_HOR = 3
    WIM_VER = 4
    ANPR_VER = 5
    AMPEL_VER = 6
    CLASS_QB2 = 7
    CLASS_OS0 = 8
    CLASS_AERIES_II = 9


@dataclass
class CameraCalibration(betterproto.Message):
    """Kamera-spezifische Metadaten"""

    sensor_name: str = betterproto.string_field(1)
    # z.B. Intrinsic-Matrix (3×3 row-major)
    intrinsic: List[float] = betterproto.double_field(2)


@dataclass
class CameraFrame(betterproto.Message):
    """Eine einzelne Kamera-Aufnahme"""

    sensor_name: str = betterproto.string_field(1)
    frame_timestamp_ns: int = betterproto.uint64_field(2)
    width: int = betterproto.uint32_field(3)
    height: int = betterproto.uint32_field(4)
    encoding: str = betterproto.string_field(5)
    image_data: bytes = betterproto.bytes_field(6)
    calibration: "CameraCalibration" = betterproto.message_field(7)


@dataclass
class LidarScan(betterproto.Message):
    """Alle Daten eines Sensors pro Sweep/Zeitstempel"""

    laser_name: "LaserName" = betterproto.enum_field(1)
    scan_timestamp_ns: int = betterproto.uint64_field(2)
    # Hier die gekapselte Punktwolke:
    pointcloud: data.PointCloud = betterproto.message_field(3)
    # Kalibrierungs-Infos
    calibration: common.SensorCalibration = betterproto.message_field(4)
    # Objekte, die in diesem Scan detektiert wurden
    object_list: List[label.ObjectBBox] = betterproto.message_field(5)
