# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .lla import Lla
from .quaternion import Quaternion


class Pose(UniversalBaseModel):
    pos: typing.Optional[Lla] = pydantic.Field(default=None)
    """
    Geospatial location defined by this Pose.
    """

    att_enu: typing_extensions.Annotated[typing.Optional[Quaternion], FieldMetadata(alias="attEnu")] = pydantic.Field(
        default=None
    )
    """
    The quaternion to transform a point in the Pose frame to the ENU frame. The Pose frame could be Body, Turret,
     etc and is determined by the context in which this Pose is used.
     The normal convention for defining orientation is to list the frames of transformation, for example
     att_gimbal_to_enu is the quaternion which transforms a point in the gimbal frame to the body frame, but
     in this case we truncate to att_enu because the Pose frame isn't defined. A potentially better name for this
     field would have been att_pose_to_enu.
    
     Implementations of this quaternion should left multiply this quaternion to transform a point from the Pose frame
     to the enu frame.
    
     Point<Pose\> posePt{1,0,0};
     Rotation<Enu, Pose\> attPoseToEnu{};
     Point<Enu\> = attPoseToEnu*posePt;
    
     This transformed point represents some vector in ENU space that is aligned with the x axis of the attPoseToEnu
     matrix.
    
     An alternative matrix expression is as follows:
     ptEnu = M x ptPose
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
