# automatically generated by the FlatBuffers compiler, do not modify

# namespace: foxglove

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

# A timestamped pose for an object or reference frame in 3D space
class PoseInFrame(object):
    __slots__ = ['_tab']

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

    @classmethod
    def GetRootAsPoseInFrame(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # PoseInFrame
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Timestamp of pose
    # PoseInFrame
    def Timestamp(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from .Time import Time
            obj = Time()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Frame of reference for pose position and orientation
    # PoseInFrame
    def FrameId(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

    # Pose in 3D space
    # PoseInFrame
    def Pose(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Pose import Pose
            obj = Pose()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def PoseInFrameStart(builder): builder.StartObject(3)
def Start(builder):
    return PoseInFrameStart(builder)
def PoseInFrameAddTimestamp(builder, timestamp): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(timestamp), 0)
def AddTimestamp(builder, timestamp):
    return PoseInFrameAddTimestamp(builder, timestamp)
def PoseInFrameAddFrameId(builder, frameId): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(frameId), 0)
def AddFrameId(builder, frameId):
    return PoseInFrameAddFrameId(builder, frameId)
def PoseInFrameAddPose(builder, pose): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(pose), 0)
def AddPose(builder, pose):
    return PoseInFrameAddPose(builder, pose)
def PoseInFrameEnd(builder): return builder.EndObject()
def End(builder):
    return PoseInFrameEnd(builder)