

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/percept_pipeline/data/coordinate_system.proto, blickfeld/percept_pipeline/data/health.proto, blickfeld/percept_pipeline/data/point_cloud_type.proto, blickfeld/percept_pipeline/data/point_type.proto, blickfeld/percept_pipeline/data/state.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict

import blickfeld_qb2.betterproto as betterproto
import blickfeld_qb2.betterproto.lib.google.protobuf as betterproto_lib_google_protobuf

from ...base import data as __base_data__


class CoordinateSystem(betterproto.Enum):
    """Specifies the coordinates system the data is expressed in"""

    COORDINATE_SYSTEM_UNSPECIFIED = 0
    """
    Coordinate system not specified. Not accepted neither within a request nor
    as response
    """

    COORDINATE_SYSTEM_LOCAL = 1
    """
    The data is expressed in the coordiante system of the data-source/device
    """

    COORDINATE_SYSTEM_TRANSFORMED = 2
    """The data is expressed in a map coordinate system"""


class PointCloudType(betterproto.Enum):
    """The type of the point cloud"""

    POINT_CLOUD_TYPE_UNSPECIFIED = 0
    """The zero value that is not accepted"""

    POINT_CLOUD_TYPE_FULL = 1
    """
    Full point cloud (combined point cloud of all devices or unfiltered point
    cloud coming from one device)
    """

    POINT_CLOUD_TYPE_FOREGROUND = 2
    """Point cloud containing only foreground/points from moving objects"""

    POINT_CLOUD_TYPE_FULL_OPTIMIZED = 3
    """
    Same as 'POINT_CLOUD_TYPE_FULL' but with reduced point cloud density to
    reduce the size of the point cloud
    """

    POINT_CLOUD_TYPE_FILTERED = 4
    """
    Same as 'POINT_CLOUD_TYPE_FULL' but with all points excluded that are in
    exclusion zones
    """

    POINT_CLOUD_TYPE_FILTERED_FOREGROUND = 5
    """
    Same as 'POINT_CLOUD_TYPE_FOREGROUND' but with all points excluded that are
    in exclusion zones
    """

    POINT_CLOUD_TYPE_BACKGROUND = 6
    """
    Point cloud containing the points representing the background model/point
    cloud
    """

    POINT_CLOUD_TYPE_ANNOTATED = 7
    """
    Point cloud containing a collection of points with annotation per point
    """


class PointType(betterproto.Enum):
    """The type of the point"""

    POINT_TYPE_UNSPECIFIED = 0
    """The point type is unspecified (default)."""

    POINT_TYPE_FOREGROUND = 1
    """The point is part of the foreground point cloud."""

    POINT_TYPE_BACKGROUND = 2
    """The point is part of the background point cloud."""

    POINT_TYPE_FILTERED = 4
    """
    The point is filtered, e.g. by applying an exclusion zone or the radius
    outlier filter.
    """

    POINT_TYPE_SHADOW = 8
    """The point is part of a shadow."""

    POINT_TYPE_OBJECT = 256
    """The point is part of a detected object point cloud."""

    POINT_TYPE_OBJECT_INTRUDING = 512
    """
    The point is part of a detected object point cloud which is currently
    intruding a object based security zone.
    """

    POINT_TYPE_OBJECT_INTRUDER = 1024
    """
    The point is part of a detected object point cloud which was previously
    intruding a object based security zone.
    """


class State(betterproto.Enum):
    """The states of pipeline"""

    STATE_UNSPECIFIED = 0
    """State field is not set"""

    STATE_STARTING = 1
    """Pipeline is getting started currently."""

    STATE_STABLE = 2
    """
    Pipeline is stable input and output of the pipeline are achieving the same
    frequency. Only very few frames are allowed to be dropped.
    """

    STATE_UNSTABLE = 3
    """
    Pipeline is unstable if the pipeline cannot process all frames of the data
    source and thus has to drop frames to keep up.
    """

    STATE_BROKEN = 4
    """
    Pipeline is broken if the pipeline does not generate the expected outputs,
    i.e. frames or state list at all. This can happen if the devices in the
    'data source' cannot be reached.
    """

    STATE_RESTARTING = 5
    """
    Pipeline is restarting if there is a larger configuration change, i.e. data
    source changed.
    """

    STATE_IDLE = 6
    """No processing is happening in the pipeline."""


@dataclass(eq=False, repr=False)
class Health(betterproto.Message):
    """
    A health message that contains information about the pipeline status and
    the module itself.
    """

    state: "__base_data__.HealthState" = betterproto.enum_field(1)
    """High-level state of module."""

    state_reason: str = betterproto.string_field(2)
    """Reason for the given state. It is not set if state is STATE_OK."""

    data_source: "HealthDataSource" = betterproto.message_field(4)
    """Data source related health information."""

    statistics: "HealthStatistics" = betterproto.message_field(5)
    """Perception related health information."""


@dataclass(eq=False, repr=False)
class HealthDataSource(betterproto.Message):
    """Data source related health."""

    device: Dict[str, "HealthDataSourceDevice"] = betterproto.map_field(
        1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )
    """Map of devices. The key is the serial number of the device."""


@dataclass(eq=False, repr=False)
class HealthDataSourceDevice(betterproto.Message):
    """Configured device."""

    error_flags: "HealthDataSourceDeviceErrorFlags" = betterproto.message_field(1)
    """Error flags"""


@dataclass(eq=False, repr=False)
class HealthDataSourceDeviceErrorFlags(betterproto.Message):
    """Error flags"""

    connect_failed: bool = betterproto.bool_field(1)
    """
    The connection to the device has failed. This is most probably caused by
    power supply or network connectivity issues.
    """

    start_failed: bool = betterproto.bool_field(2)
    """
    The start-up of the device failed. This indicates that the device can not
    operate properly. Please review the diagnostics information of the device.
    """

    point_cloud_fetch_failed: bool = betterproto.bool_field(3)
    """
    The point cloud fetch failed. This indicates that the device can not
    operate properly or network bandwidth / stability issues.
    """

    environmental_effects: bool = betterproto.bool_field(4)
    """
    There are some environmental influences, e.g. fog, rain or snow in the
    scene.
    """


@dataclass(eq=False, repr=False)
class HealthStatistics(betterproto.Message):
    """Perception pipeline related statistics"""

    security: "HealthStatisticsSecurity" = betterproto.message_field(
        1, group="perception_type"
    )
    """Security pipeline health"""

    volume: "HealthStatisticsVolume" = betterproto.message_field(
        2, group="perception_type"
    )
    """Volume pipeline health"""

    traffic: "HealthStatisticsTraffic" = betterproto.message_field(
        3, group="perception_type"
    )
    """Traffic pipeline health"""


@dataclass(eq=False, repr=False)
class HealthStatisticsSecurity(betterproto.Message):
    """Security pipeline health"""

    motion_detection: "HealthStatisticsSecurityMotionDetection" = (
        betterproto.message_field(1)
    )
    """Motion detection"""

    object_tracking: "HealthStatisticsSecurityObjectTracking" = (
        betterproto.message_field(2)
    )
    """Object tracking"""


@dataclass(eq=False, repr=False)
class HealthStatisticsSecurityMotionDetection(betterproto.Message):
    """Motion detection"""

    number_of_foreground_points: float = betterproto.float_field(1)
    """Number of foreground points"""

    number_of_outlier_points: float = betterproto.float_field(2)
    """Number of outlier points (number of points which got not clustered)"""

    median_reflectivity_of_outlier_points: float = betterproto.float_field(3)
    """Median reflectivity of outlier points"""

    adaptive_noise_filter_threshold: float = betterproto.float_field(4)
    """Reflectivity value used for adaptive noise filtering"""

    number_of_adaptive_noise_outliers: float = betterproto.float_field(5)
    """Number of points that were removed by the adaptive noise filter"""


@dataclass(eq=False, repr=False)
class HealthStatisticsSecurityObjectTracking(betterproto.Message):
    """Objects detection & tracking"""

    number_of_objects: float = betterproto.float_field(1)
    """indicates that objects are present"""

    reference_properties: (
        "HealthStatisticsSecurityObjectTrackingReferenceProperties"
    ) = betterproto.message_field(2)
    """reference object properties"""


@dataclass(eq=False, repr=False)
class HealthStatisticsSecurityObjectTrackingReferenceProperties(betterproto.Message):
    """
    Reference object properties which contain the 90% percentile of relevant
    object state values.   This data is used to generate long term statistics
    of object properties which allow the fine tuning of zone algorithm
    parameters.
    """

    lifetime: float = betterproto.float_field(1)
    """Lifetime of the object"""

    num_points: float = betterproto.float_field(2)
    """/ Number of measurements that belong to the object point cloud."""

    median_reflectivity: float = betterproto.float_field(3)
    """
    / Median reflectivity of the measurements from the object point cloud.
    """

    bounding_box_2_d_surface: float = betterproto.float_field(4)
    """
    Surface area of the largest xz / yz bounding box plane. This is used for
    the simple object size classification.
    """

    track_length: float = betterproto.float_field(5)
    """The estimated track length of an object."""

    intruding_duration: float = betterproto.float_field(6)
    """
    Intruding duration of objects. Only objects are taken into account which
    are actually intruding.
    """


@dataclass(eq=False, repr=False)
class HealthStatisticsVolume(betterproto.Message):
    """Volume pipeline health"""

    pass


@dataclass(eq=False, repr=False)
class HealthStatisticsTraffic(betterproto.Message):
    """Traffic pipeline health"""

    rain_filter_confidence: float = betterproto.float_field(1)
    """
    The confidence of the moving average filter that checks the traffic lane
    for rain
    """
