# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Sensor(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Sensor()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsSensor(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def SensorBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

    # Sensor
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Sensor
    def SensorName(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Sensor
    def SensorTypes(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Sensor
    def CameraType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Sensor
    def BoundingBox(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # Sensor
    def TrackActorTypes(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # Sensor
    def TrackActorTypesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Sensor
    def TrackActorTypesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

    # Sensor
    def ShowBoundingBoxes(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # Sensor
    def WorldSensor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # Sensor
    def SensorLocation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            x = o + self._tab.Pos
            from communications.isp.Location import Location
            obj = Location()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Sensor
    def SensorRotation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            x = o + self._tab.Pos
            from communications.isp.Rotation import Rotation
            obj = Rotation()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Sensor
    def SensorResolution(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            x = o + self._tab.Pos
            from communications.isp.Resolution import Resolution
            obj = Resolution()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Sensor
    def FrameOfReference(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Sensor
    def Fov(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Sensor
    def AttachToActor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Sensor
    def Radius(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Sensor
    def Occlusion(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

def SensorStart(builder): builder.StartObject(15)
def Start(builder):
    return SensorStart(builder)
def SensorAddSensorName(builder, sensorName): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(sensorName), 0)
def AddSensorName(builder, sensorName):
    return SensorAddSensorName(builder, sensorName)
def SensorAddSensorTypes(builder, sensorTypes): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(sensorTypes), 0)
def AddSensorTypes(builder, sensorTypes):
    return SensorAddSensorTypes(builder, sensorTypes)
def SensorAddCameraType(builder, cameraType): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(cameraType), 0)
def AddCameraType(builder, cameraType):
    return SensorAddCameraType(builder, cameraType)
def SensorAddBoundingBox(builder, boundingBox): builder.PrependBoolSlot(3, boundingBox, 0)
def AddBoundingBox(builder, boundingBox):
    return SensorAddBoundingBox(builder, boundingBox)
def SensorAddTrackActorTypes(builder, trackActorTypes): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(trackActorTypes), 0)
def AddTrackActorTypes(builder, trackActorTypes):
    return SensorAddTrackActorTypes(builder, trackActorTypes)
def SensorStartTrackActorTypesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartTrackActorTypesVector(builder, numElems):
    return SensorStartTrackActorTypesVector(builder, numElems)
def SensorAddShowBoundingBoxes(builder, showBoundingBoxes): builder.PrependBoolSlot(5, showBoundingBoxes, 0)
def AddShowBoundingBoxes(builder, showBoundingBoxes):
    return SensorAddShowBoundingBoxes(builder, showBoundingBoxes)
def SensorAddWorldSensor(builder, worldSensor): builder.PrependBoolSlot(6, worldSensor, 0)
def AddWorldSensor(builder, worldSensor):
    return SensorAddWorldSensor(builder, worldSensor)
def SensorAddSensorLocation(builder, sensorLocation): builder.PrependStructSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(sensorLocation), 0)
def AddSensorLocation(builder, sensorLocation):
    return SensorAddSensorLocation(builder, sensorLocation)
def SensorAddSensorRotation(builder, sensorRotation): builder.PrependStructSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(sensorRotation), 0)
def AddSensorRotation(builder, sensorRotation):
    return SensorAddSensorRotation(builder, sensorRotation)
def SensorAddSensorResolution(builder, sensorResolution): builder.PrependStructSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(sensorResolution), 0)
def AddSensorResolution(builder, sensorResolution):
    return SensorAddSensorResolution(builder, sensorResolution)
def SensorAddFrameOfReference(builder, frameOfReference): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(frameOfReference), 0)
def AddFrameOfReference(builder, frameOfReference):
    return SensorAddFrameOfReference(builder, frameOfReference)
def SensorAddFov(builder, fov): builder.PrependFloat64Slot(11, fov, 0.0)
def AddFov(builder, fov):
    return SensorAddFov(builder, fov)
def SensorAddAttachToActor(builder, attachToActor): builder.PrependUOffsetTRelativeSlot(12, flatbuffers.number_types.UOffsetTFlags.py_type(attachToActor), 0)
def AddAttachToActor(builder, attachToActor):
    return SensorAddAttachToActor(builder, attachToActor)
def SensorAddRadius(builder, radius): builder.PrependFloat64Slot(13, radius, 0.0)
def AddRadius(builder, radius):
    return SensorAddRadius(builder, radius)
def SensorAddOcclusion(builder, occlusion): builder.PrependBoolSlot(14, occlusion, 0)
def AddOcclusion(builder, occlusion):
    return SensorAddOcclusion(builder, occlusion)
def SensorEnd(builder): return builder.EndObject()
def End(builder):
    return SensorEnd(builder)