+
    åûji  ã                  óþ   € ^ RI Ht ^ RIHtHtHt ^ RIt^ RIHu H	t
 ^ RIHt ^ RIHtHtHt ^ RIHtHt ^ RIHtHt ^ RIHtHtHtHt ^ R	IHt ^ R
IHt ^ RIHt R R lt R R lt! ! R R]PD                  4      t#R# )é    )Úannotations)ÚOptionalÚUnionÚoverloadN)Únn)ÚKORNIA_CHECKÚKORNIA_CHECK_SAME_DEVICESÚKORNIA_CHECK_SHAPE)ÚDeviceErrorÚTypeCheckError)Ú_deepcopy_module_stateÚregister_module_state)ÚSo3Ú_check_points_layoutÚ_so3_rotateÚ_so3_small_angle_coefficients)Úbatched_dot_product)Ú
Quaternion)ÚVector3c               ó$   € V ^8„  d   QhRRRRRR/# ©é   ÚrúQuaternion | So3Útútorch.TensorÚreturnÚNone© )Úformats   "ÚXC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\geometry\liegroup\se3.pyÚ__annotate__r"   %   s"   € ÷ 
ñ 
Ð,ð 
°ð 
À$ñ 
ó    c           	     óD  € \        V \        4      '       d   V P                  MT pVP                  P                  R R p \
        P                  ! W1P                  R R 4       R #   \         d1    \        R\        T4       R\        TP                  4       R24      R hi ; i)NzFExpected a translation whose batch broadcasts with the rotation batch z. Got translation of shape Ú.éÿÿÿÿ)
Ú
isinstancer   ÚqÚdataÚshapeÚtorchÚbroadcast_shapesÚRuntimeErrorÚ
ValueErrorÚtuple)r   r   r(   Úr_batchs   &&  r!   Ú_check_se3_r_t_shaper1   %   s•   € Ü˜!œS×!Ò!ˆ�Š q€AØ�f‰f�l‰l˜3˜BÐ€GðÜ×Ò˜w¯©°°¨Ö5øÜô ÜØTÔUZÐ[bÓUcÐTdð e(Ü(-¨a¯g©g«Ð'7°qð:ó
ð ð	ðús   ¿#A$ Á$;Bc               ó$   € V ^8„  d   QhRRRRRR/# r   r   )r    s   "r!   r"   r"   2   s"   € ÷ 
ñ 
Ð#3ð 
¸ð 
Èñ 
r#   c                óÊ  € \        V \        4      '       d   V P                  MT pVP                  pVP	                  4       '       d&   \        RVP                   R2VP                  R7      hVP                  4       '       g&   \        RVP                   R2VP                  R7      hVP                  VP                  8w  d>   \        RVP                   RVP                   R2VP                  VP                  R	7      hVP                  VP                  8w  dJ   \        R
VP                   RVP                   R2VP                  VP                  .VP                  R7      hR# )zaReject a translation the rotation's methods cannot combine with: another dtype or another device.z:Se3 translation must be a real floating-point tensor; got r%   )Úactual_typezSSe3 stores 'translation' as module state, which needs a floating-point tensor; got z-. Cast it first, for example with `.float()`.z5Se3 translation must have the dtype of its rotation, z; got z8. Cast one of them first, for example with `.to(dtype)`.)r4   Úexpected_typez7Se3 translation must be on the device of its rotation, )Úactual_devicesÚexpected_deviceN)
r'   r   r(   r)   Ú
is_complexr   ÚdtypeÚis_floating_pointÚdevicer   )r   r   r(   Úq_datas   &&  r!   Ú_check_se3_r_t_dtype_devicer=   2   s@  € ä˜!œS×!Ò!ˆ�Š q€AØ�V‰V€FØ‡|�|‡~‚~ÜØHÈÏÉÈ	ÐQRÐSØŸ™ô
ð 	
ð ×Ñ× Ò äØaÐbc×biÑbiÐajð k:ð :àŸ™ô
ð 	
ð
 	‡w�w�&—,‘,ÔÜØCÀFÇLÁLÀ>ÐQWÐXY×X_ÑX_ÐW`ð aEð EàŸ™Ø Ÿ,™,ô	
ð 	
ð 	‡x�x�6—=‘=Ô ÜØEÀfÇmÁmÀ_ÐTZÐ[\×[cÑ[cÐZdÐdeÐfØ"ŸM™M¨1¯8©8Ð4Ø"ŸM™Mô
ð 	
ñ !r#   c                  óœ  a € ] tR t^QtRt]tR V 3R lltR R ltR R lt	R R	 lt
]R
 R l4       t]R R l4       t]R R l4       tR R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       tR  R! lt]R" R# l4       t]R$ R% l4       t]RCR& R' ll4       tR( R) lt]RDR* R+ ll4       t]R, R- l4       tR. R/ lt]RCR0 R1 ll4       t]R2 R3 l4       t ]R4 R5 l4       t!]R6 R7 l4       t"]R8 R9 l4       t#]R: R; l4       t$]R< R= l4       t%]R> R? l4       t&R@ RA lt'RBt(V ;t)# )EÚSe3a  Represent a 3D rigid motion, rotation and translation, as an SE(3) Lie group element.

``g = Se3(rotation, t)`` pairs an :class:`So3` or :class:`~kornia.geometry.quaternion.Quaternion` rotation with a
translation ``t`` of shape ``(B, 3)``; ``Se3.exp(v)`` builds one from tangent vectors
:math:`v = [\upsilon, \omega]` of shape ``(B, 6)``, translation first, :meth:`from_matrix` from ``(B, 4, 4)``
matrices, :meth:`from_qxyz` from ``(B, 7)`` rows ``[qw, qx, qy, qz, x, y, z]``, and ``Se3.identity(B)`` and
``Se3.random(B)`` build ``B`` poses, or an unbatched one with ``batch_size=None``. ``g1 * g2`` composes a batch
with a batch of the same size, a batch of one or an unbatched pose; ``g.inverse()`` inverts, ``g.log()`` returns
the ``(B, 6)`` tangent vectors and ``g.matrix()`` the ``(B, 4, 4)`` matrices; an unbatched pose drops the ``B``.
``g * p`` maps points as :math:`R p + t`: ``(3,)`` or ``(N, 3)`` points for an unbatched pose, and ``(B, 3)``,
one point per pose, or a single ``(1, 3)`` point, not ``(3,)``, for a batch of ``B``; a batch of one also maps
``(N, 3)``. For a pose that
names its frames and checks them when composing, use :class:`~kornia.geometry.pose.NamedPose`; for plain
``(N, 4, 4)`` matrices, :func:`~kornia.geometry.linalg.compose_transformations`.

SE(3) is the group of rigid motions of :math:`R^3` under composition; see
https://ingmec.ual.es/~jlblanco/papers/jlblanco2010geometry3D_techrep.pdf.

Convention:
    - The tangent vector is :math:`[\upsilon, \omega]`, translation first
      (:ref:`Rotations and rigid motions <rotation-conventions>` maps it onto Sophus and GTSAM): ``exp`` rotates by
      ``So3.exp(omega)`` and translates by :math:`V(\omega) \upsilon`, ``hat`` is
      :math:`[[\hat\omega, \upsilon], [0, 0]]`, and ``log`` is principal, with :math:`|\omega| \le \pi`.
    - ``matrix()`` is the 4x4 :math:`[[R, t], [0, 1]]`. ``a * b`` is ``a.matrix() @ b.matrix()``, so ``b`` acts
      first, and ``g * p`` is :math:`R p + t`. ``adjoint()`` is :math:`[[R, \hat t R], [0, R]]`.
    - The rotation is an :class:`~kornia.geometry.liegroup.So3`, whose storage and point-shape conventions
      apply: a non-unit quaternion stands for the rotation of its direction. ``from_matrix`` ignores the bottom
      row.
    - ``t`` is always a tensor, whichever constructor built the pose, and registered as module state outside
      graph capture; a ``Vector3`` passed to the constructor is unwrapped. ``g * p`` returns a ``Vector3`` only
      when ``p`` is one.
    - ``state_dict()``, ``load_state_dict()`` and module device/dtype conversions include both the rotation
      and translation. Rotation state follows :class:`~kornia.geometry.quaternion.Quaternion`'s
      buffer/parameter convention. ``copy.deepcopy`` copies state with autograd history, such as that of
      ``exp(v)`` for a ``v`` that requires grad, as new leaves, as described there for the quaternion.
    - ``a * b`` and ``g * p`` compute in float32 for float16/bfloat16 inputs and return the input dtype,
      rounding :math:`R p + t` once; ``matrix()`` and ``inverse()`` take the rotation from
      :class:`~kornia.geometry.liegroup.So3`, which does the same.

See Also:
    - :class:`Se2`: the 2D rigid motion, with an :class:`So2` rotation and a ``(B, 2)`` translation.
    - :class:`So3`: the rotation alone, without a translation.
    - :class:`~kornia.geometry.pose.NamedPose`: wraps an ``Se3`` with the names of its source and destination
      frames, and checks that they chain when composing.
    - :func:`~kornia.geometry.linalg.compose_transformations`: the same composition on plain ``(N, 4, 4)``
      matrices, without a group object.

Example:
    >>> q = Quaternion.identity()
    >>> s = Se3(q, torch.ones(3))
    >>> s.r
    tensor([1., 0., 0., 0.])
    >>> s.t
    Parameter containing:
    tensor([1., 1., 1.], requires_grad=True)

c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úrotationr   ÚtranslationzVector3 | torch.Tensorr   r   r   )r    s   "r!   r"   ÚSe3.__annotate__�   s$   € ÷ 1&ñ 1&Ð!1ð 1&Ð@Vð 1&Ð[_ñ 1&r#   c                ó  <€ \         SV `  4        \        V\        \        34      '       g   \        R\        V4       24      h\        V\        \        P                  34      '       g   \        R\        V4       24      h\        V\        4      '       d   VP                  MTp\        VRR.4       \        W4       \        W4       V  V  \        V RV4       \        V\        4      '       d   \	        V4      V n        R# Wn        R# )aó  Construct an Se3 from a rotation and a translation.

Internally represented by an So3 rotation and a translation 3-vector.

Args:
    rotation: So3 group encompassing a rotation, or a Quaternion to wrap in one; it is stored as given, and
        a non-unit quaternion stands for the rotation of its direction.
    translation: translation torch.Tensor with shape ``(B, 3)``, or ``(3,)`` for an unbatched translation,
        or a Vector3 wrapping one; the tensor is what gets stored. Multidimensional batch shapes ``(*, 3)``
        are also accepted. The rotation and translation batch shapes must be broadcastable (an unbatched side
        may broadcast against a batched side). Incompatible batch shapes raise a ``ValueError`` at
        construction time. It must have the rotation's dtype and device.

Raises:
    ValueError: if translation shape does not end in 3, or rotation and translation batch shapes cannot be
        broadcast.
    TypeCheckError: if the translation is an integer, bool or complex tensor (an ``nn.Parameter`` too), or its
        dtype differs from the rotation's (``inverse``, ``adjoint`` and the other methods cannot combine them).
    DeviceError: if the translation is on another device than the rotation.

Example:
    >>> from kornia.geometry.quaternion import Quaternion
    >>> q = Quaternion.identity(batch_size=1)
    >>> s = Se3(q, torch.ones((1, 3)))
    >>> s.r
    tensor([[1., 0., 0., 0.]])
    >>> s.t
    Parameter containing:
    tensor([[1., 1., 1.]], requires_grad=True)

zrotation type is ztranslation type is Ú*Ú3Ú_translationN)ÚsuperÚ__init__r'   r   r   Ú	TypeErrorÚtyper   r+   ÚTensorr)   r
   r1   r=   r   Ú	_rotation)ÚselfrA   rB   Ú_t_dataÚ	__class__s   &&& €r!   rI   ÚSe3.__init__�   sÐ   ø€ ô@ 	‰ÑÔä˜(¤Z´Ð$5×6Ò6ÜÐ/´°X³Ð/?Ð@ÓAÐAä˜+¬´·±Ð'>×?Ò?ÜÐ2´4¸Ó3DÐ2EÐFÓGÐGÜ&0°¼g×&FÒ&F�+×"Ò"ÈKˆÜ˜7 S¨# JÔ/Ü˜XÔ/Ü# HÔ6ÙÙÜ˜d N°GÔ<Ü�h¤
×+Ò+Ü  ›]ˆDŽNà%ŽNr#   c               ó   € V ^8„  d   QhRR/# )r   r   Ústrr   )r    s   "r!   r"   rC   Â   s   € ÷ <ñ <˜#ñ <r#   c                	ó:   € R V P                    RV P                   2# )z
rotation: z
translation: )r   r   ©rN   s   &r!   Ú__repr__ÚSe3.__repr__Â   s   € Ø˜DŸF™F˜8 ?°4·6±6°(Ð;Ð;r#   c               ó    € V ^8„  d   QhRRRR/# )r   Úidxzint | slicer   r?   r   )r    s   "r!   r"   rC   Å   s   € ÷ =ñ =˜{ð =¨sñ =r#   c                	óþ  € V P                   pV P                  p\        V\        4      '       d   VP                  MTpVP
                  P                  R R pVP                  R R p\        V4      ^ 8X  d)   \        V4      ^ 8X  d   \        W!,          W1,          4      # \        V4      ^ 8X  d   RMTp\        V4      ^ 8X  d   RMTp\        P                  ! Wx4      p	VP
                  P                  R R V	8X  d   VP
                  M!VP
                  P                  V	R,           4      p
VP                  R R V	8X  d   TMVP                  V	R,           4      p\        \        \        W¡,          4      4      W±,          4      # )Nr&   )é   )é   ©é   )rM   rG   r'   r   r(   r)   r*   Úlenr?   r+   r,   Úexpandr   )rN   rY   r   r   r(   r0   Út_batchÚr_bÚt_bÚb_batchr<   Út_exps   &&          r!   Ú__getitem__ÚSe3.__getitem__Å   s  € Ø�N‰NˆØ×ÑˆÜ˜a¤×%Ò%ˆA�CŠC¨1ˆØ—&‘&—,‘,˜s Ð#ˆØ—'‘'˜#˜2�,ˆÜˆw‹<˜1Ô¤ W£°Ô!2Ü�q•v˜q�vÓ&Ð&Ü˜'“l aÔ'‰d¨WˆÜ˜'“l aÔ'‰d¨WˆÜ×(Ò(¨Ó2ˆØŸ6™6Ÿ<™<¨¨Ð,°Ô7�—’¸Q¿V¹V¿]¹]È7ÐUYÍ>Ó=ZˆØ—W‘W˜S˜b�\ WÔ,‘°!·(±(¸7ÀT½>Ó2JˆÜ”3”z &¥+Ó.Ó/°µÓ<Ð<r#   c               ó    € V ^8„  d   QhRRRR/# ©r   Úrightr?   r   r   )r    s   "r!   r"   rC   Ô   s   € ÷ ñ ˜cð  cñ r#   c                	ó`  € V P                   VP                   ,          pV P                  \        V P                   P                  VP                  4      ,           P	                  \
        P                  ! V P                  P                  VP                  P                  4      4      p\        W#4      # ©N)	r   r   r   r(   Útor+   Úpromote_typesr9   r?   )rN   rj   Ú_rÚ_ts   &&  r!   Ú_mul_se3ÚSe3._mul_se3Ô   sl   € Ø�V‰V�e—g‘gÕˆà�f‰f”{ 4§6¡6§8¡8¨U¯W©WÓ5Õ5×9Ñ9¼%×:MÒ:MÈdÏfÉfÏlÉlÐ\a×\cÑ\c×\iÑ\iÓ:jÓkˆÜ�2‹{Ðr#   c               ó    € V ^8„  d   QhRRRR/# ri   r   )r    s   "r!   r"   rC   Û   s   € ×-Ñ-˜SÐ- SÑ-r#   c                	ó   € R # rl   r   ©rN   rj   s   &&r!   Ú__mul__ÚSe3.__mul__Ú   s   € Ù*-r#   c               ó    € V ^8„  d   QhRRRR/# )r   rj   r   r   r   )r    s   "r!   r"   rC   Þ   s   € ×5Ñ5˜WÐ5¨Ñ5r#   c                	ó   € R # rl   r   ru   s   &&r!   rv   rw   Ý   s   € Ù25r#   c               ó    € V ^8„  d   QhRRRR/# )r   rj   r   r   r   )r    s   "r!   r"   rC   á   s   € ×?Ñ?˜\Ð?¨lÑ?r#   c                	ó   € R # rl   r   ru   s   &&r!   rv   rw   à   s   € Ù<?r#   c               ó    € V ^8„  d   QhRRRR/# )r   rj   zSe3 | Vector3 | torch.Tensorr   r   )r    s   "r!   r"   rC   ã   s   € ÷ <ñ <Ð9ð <Ð>Zñ <r#   c                óŽ  € V P                   pV P                  p\        V\        4      '       d   V P	                  V4      # \        V\
        \        P                  34      '       dË   \        V\        P                  4      '       d   TMVP                  p\        VRR.4       \        VP                  V4       \        VP                  V4      V,           P                  \        P                  ! VP                  VP                  4      4      p\        V\
        4      '       d   \        V4      # T# \!        R\#        V4       24      h)a  Compose two Se3 transformations, or transform points.

Both compute in float32 for float16/bfloat16 inputs and return the input dtype.

Args:
    right: the other Se3 transformation, unbatched, a batch of the same size or a batch of one, or points
        as a tensor or ``Vector3``: ``(3,)`` or ``(N, 3)`` for an unbatched pose, and ``(B, 3)``, one point
        per pose, or ``(1, 3)``, not ``(3,)``, for a batch of ``B`` (a batch of one also maps ``(N, 3)``).

Return:
    The resulting Se3 transformation, or the transformed points.

rE   ÚNzUnsupported type: )Úso3r   r'   r?   rq   r   r+   rL   r)   r
   r   r(   r   rm   rn   r9   rJ   rK   )rN   rj   r   r   Ú_right_dataÚouts   &&    r!   rv   rw   ã   sé   € ð �h‰hˆØ�F‰FˆÜ�eœS×!Ò!à—=‘= Ó'Ð'Ü�eœg¤u§|¡|Ð4×5Ò5Ü#-¨e´U·\±\×#BÒ#B™%ÈÏ
É
ˆKÜ˜{¨S°#¨JÔ7Ü  §¡¨Ô4ä˜sŸu™u kÓ2°QÕ6×:Ñ:¼5×;NÒ;NÈqÏwÉwÐXc×XiÑXiÓ;jÓkˆCÜ#-¨e´W×#=Ò#=”7˜3“<ÐFÀ3ÐFÜÐ,¬T°%«[¨MÐ:Ó;Ð;r#   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r    s   "r!   r"   rC      s   € ÷ ñ �Sñ r#   c                ó   € V P                   # ©z$Return the underlying rotation(So3).©rM   rU   s   &r!   r   ÚSe3.so3ÿ   ó   € ð �~‰~Ðr#   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r    s   "r!   r"   rC     s   € ÷  ñ  ˜Jñ  r#   c                ó.   € V P                   P                  # )z+Return the underlying rotation(Quaternion).)rM   r(   rU   s   &r!   Ú
quaternionÚSe3.quaternion  s   € ð �~‰~×ÑÐr#   c               ó   € V ^8„  d   QhRR/# rƒ   r   )r    s   "r!   r"   rC   
  s   € ÷ ñ �3ñ r#   c                ó   € V P                   # r…   r†   rU   s   &r!   r   ÚSe3.r	  rˆ   r#   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r    s   "r!   r"   rC     s   € ÷ !ñ !�<ñ !r#   c                ó   € V P                   # ©z<Return the underlying translation vector of shape ``(B,3)``.©rG   rU   s   &r!   r   ÚSe3.t  ó   € ð × Ñ Ð r#   c               ó   € V ^8„  d   QhRR/# rƒ   r   )r    s   "r!   r"   rC     s   € ÷ ñ ˜#ñ r#   c                ó   € V P                   # )z&Return the underlying `rotation(So3)`.r†   rU   s   &r!   rA   ÚSe3.rotation  rˆ   r#   c               ó   € V ^8„  d   QhRR/# r‘   r   )r    s   "r!   r"   rC     s   € ÷ !ñ !˜\ñ !r#   c                ó   € V P                   # r“   r”   rU   s   &r!   rB   ÚSe3.translation  r–   r#   c               ó    € V ^8„  d   QhRRRR/# )r   Úvr   r   r?   r   )r    s   "r!   r"   rC     s   € ÷ $;ñ $;ˆ|ð $; ñ $;r#   c                ó¬  € \        V RR.4       V R,          pV R,          p\        P                  ! V4      pW3,          p\        W"4      pV^ 8„  p\        P
                  ! We\        P                  ! V4      4      p\        P
                  ! WgP                  4       \        P                  ! V4      4      p\        P                  ! V4      p	\        V4      w  r«p\        P                  ! ^V P                  V P                  R7      V
R,          V,          ,           VR,          V,          ,           p\        W‘R,          V,          P                  R4      4      # )	aj  Convert elements of lie algebra to elements of lie group.

Args:
    v: vector :math:`[\upsilon, \omega]` of shape ``(B, 6)``, translation first, rotation vector last.

Example:
    >>> v = torch.zeros((1, 6))
    >>> s = Se3.exp(v)
    >>> s.r
    tensor([[1., 0., 0., 0.]])
    >>> s.t
    Parameter containing:
    tensor([[0., 0., 0.]], requires_grad=True)

rE   Ú6©r;   r9   ©.ºNr^   N©.:r^   NN©.NN©.N:NNNr&   )r
   r   Úhatr   r+   ÚwhereÚ	ones_likeÚsqrtÚ
zeros_likeÚexpr   Úeyer;   r9   r?   Úsum)rž   ÚupsilonÚomegaÚ	omega_hatÚomega_hat_sqÚtheta_sqÚnonzeroÚsafe_theta_sqÚthetaÚRÚaÚbÚ_ÚVs   &             r!   r¬   ÚSe3.exp  s	  € ô" 	˜1˜s C˜jÔ)Ø�G•*ˆØ�'•
ˆÜ—G’G˜E“Nˆ	Ø Õ,ˆÜ& uÓ4ˆØ˜Q‘,ˆô
 Ÿš G´u·²ÀxÓ7PÓQˆÜ—’˜G×%7Ñ%7Ó%9¼5×;KÒ;KÈHÓ;UÓVˆÜ�GŠG�E‹NˆÜ/°Ó6‰ˆˆaä�IŠI�a §¡°·±Ô8Ø�Õ  9Õ,õ-à�Õ  <Õ/õ0ð 	
ô
 �1˜|Õ,¨qÕ0×5Ñ5°bÓ9Ó:Ð:r#   c               ó   € V ^8„  d   QhRR/# r‘   r   )r    s   "r!   r"   rC   D  s   € ÷ #/ñ #/�\ñ #/r#   c                óÌ  € V P                   P                  4       p\        W4      pV^ 8„  p\        P                  ! W2P                  R4      \        P                  ! V4      4      p\        P                  ! W4P                  4       \        P                  ! V4      4      pV P                  p\        P                  ! V4      pWw,          p\        V4      w   rš\        P                  ! ^VP                  VP                  R7      RV,          ,
          V
R,          V,          ,           pVR,          V,          P!                  R4      p\        P"                  ! VP$                  RR VP$                  RR 4      pVP$                  RR V8w  d   VP'                  VR,           4      pVP$                  RR V8w  d   VP'                  VR,           4      p\        P(                  ! WÁ3R4      # )	a  Convert elements of lie group  to elements of lie algebra.

Example:
    >>> from kornia.geometry.quaternion import Quaternion
    >>> q = Quaternion.identity()
    >>> Se3(q, torch.zeros(3)).log()
    tensor([0., 0., 0., 0., 0., 0.], grad_fn=<CatBackward0>)

gê-�™—q=r¡   g      à?Nr¥   r¦   r&   r]   )r   Úlogr   r+   r¨   Ú	clamp_minr©   rª   r«   r   r   r§   r   r­   r;   r9   r®   r,   r*   r`   Úcat)rN   r°   r³   r´   rµ   r¶   r   r±   r²   rº   ÚcÚV_invr¯   rd   s   &             r!   r¿   ÚSe3.logD  sx  € ð —‘—
‘
“ˆÜ& uÓ4ˆØ˜Q‘,ˆô Ÿš G×-?Ñ-?ÀÓ-FÌÏÊÐX`ÓHaÓbˆÜ—’˜G×%7Ñ%7Ó%9¼5×;KÒ;KÈHÓ;UÓVˆØ�F‰FˆÜ—G’G˜E“Nˆ	Ø Õ,ˆô 0°Ó6‰ˆˆ1ä�IŠI�a §¡°E·K±KÔ@À3ÈÅ?ÕRÐUVÐWfÕUgÐjvÕUvÕvð 	ð �\•? UÕ*×/Ñ/°Ó3ˆÜ×(Ò(¨¯©°s¸Ð);¸U¿[¹[ÈÈ"Ð=MÓNˆØ�=‰=˜˜"Ð Ô(Ø—n‘n W¨t¥^Ó4ˆGØ�;‰;�s˜Ð˜wÔ&Ø—L‘L ¨4¥Ó0ˆEÜ�yŠy˜'Ð)¨2Ó.Ð.r#   c               ó    € V ^8„  d   QhRRRR/# )r   rž   r   r   r   )r    s   "r!   r"   rC   j  s   € ÷ 'ñ 'ˆ|ð ' ñ 'r#   c                óÖ   € \        V RR.4       V R,          V R,          r!\        P                  ! \        P                  ! V4      VR,          3R4      p\
        P                  ! VR4      # )ac  Convert elements from vector space to lie algebra.

Args:
    v: vector of shape ``(B, 6)``.

Returns:
    matrix of shape ``(B, 4, 4)``.

Example:
    >>> v = torch.ones((1, 6))
    >>> m = Se3.hat(v)
    >>> m
    tensor([[[ 0., -1.,  1.,  1.],
             [ 1.,  0., -1.,  1.],
             [-1.,  1.,  0.,  1.],
             [ 0.,  0.,  0.,  0.]]])

rE   r    r¢   r¤   ©.Nr&   ©r   r   r   r[   )r
   r+   rÁ   r   r§   ÚFÚpad)rž   r¯   r°   Úrts   &   r!   r§   ÚSe3.hati  sT   € ô( 	˜1˜s C˜jÔ)Ø˜7� Q w¥Z�Ü�YŠYœŸš ›¨°	Õ(:Ð;¸RÓ@ˆÜ�uŠu�R˜Ó&Ð&r#   c               ó    € V ^8„  d   QhRRRR/# )r   r°   r   r   r   )r    s   "r!   r"   rC   ƒ  s   € ÷ +ñ +�<ð + Lñ +r#   c                óš   € \        V . RO4       V R,          p\        P                  ! V R,          4      p\        P                  ! W3R4      # )a3  Convert elements from lie algebra to vector space.

Args:
    omega: 4x4-matrix representing lie algebra of shape ``(B,4,4)``.

Returns:
    vector of shape ``(B,6)``.

Example:
    >>> v = torch.ones((1, 6))
    >>> omega_hat = Se3.hat(v)
    >>> Se3.vee(omega_hat)
    tensor([[1., 1., 1., 1., 1., 1.]])

©rE   Ú4rÐ   r&   ©.r£   r&   ©.r£   r£   )r
   r   Úveer+   rÁ   )r°   ÚheadÚtails   &  r!   rÓ   ÚSe3.vee‚  s>   € ô" 	˜5¢/Ô2Ø�[Õ!ˆÜ�wŠw�u˜[Õ)Ó*ˆÜ�yŠy˜$˜ rÓ*Ð*r#   c               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r   Ú
batch_sizezOptional[int]r;   zUnion[str, torch.device, None]r9   zUnion[torch.dtype, None]r   r?   r   )r    s   "r!   r"   rC   ™  s2   € ÷ ?ñ ?à!ð?ð /ð?ð (ð	?ð
 
ñ?r#   c                óž   € \         P                  ! . ROW#R7      pVe   VP                  V^4      pV ! \        P                  ! WV4      V4      # )av  Create a Se3 group representing an identity rotation and zero translation.

Args:
    batch_size: the batch size of the underlying data.
    device: device to place the result on.
    dtype: dtype of the result.

Example:
    >>> s = Se3.identity()
    >>> s.r
    tensor([1., 0., 0., 0.])
    >>> s.t
    Parameter containing:
    tensor([0., 0., 0.], requires_grad=True)

r¡   )ç        rÛ   rÛ   )r+   ÚtensorÚrepeatr   Úidentity)ÚclsrÙ   r;   r9   r   s   &&&& r!   rÞ   ÚSe3.identity˜  sB   € ô. �LŠLš°ÔEˆØÒ!Ø—‘˜ QÓ'ˆAá”3—<’< 
°EÓ:¸AÓ>Ð>r#   c               ó   € V ^8„  d   QhRR/# r‘   r   )r    s   "r!   r"   rC   µ  s   € ÷ ñ ˜ñ r#   c                ó   € V P                   P                  4       p\        P                  ! VP                  RR V P
                  P                  RR 4      pVP                  RR V8w  d   VP                  VR,           4      pV P
                  P                  VP                  4      pVP                  RR V8w  d   VP                  VR,           4      p\        P                  ! WR,          3R4      p\        P                  ! VR4      pRVR	&   V# )
a  Return the matrix representation of shape ``(B, 4, 4)``.

Example:
    >>> s = Se3(So3.identity(), torch.ones(3))
    >>> s.matrix()
    tensor([[1., 0., 0., 1.],
            [0., 1., 0., 1.],
            [0., 0., 1., 1.],
            [0., 0., 0., 1.]], grad_fn=<CopySlices>)

Ng      ð?éþÿÿÿr&   ©r^   r^   r]   rÇ   rÈ   ).r&   r&   )r   Úmatrixr+   r,   r*   r   r`   rm   r9   rÁ   rÉ   rÊ   )rN   Úr_matrixrd   r   rË   Úrt_4x4s   &     r!   rå   Ú
Se3.matrixµ  sÕ   € ð —6‘6—=‘=“?ˆÜ×(Ò(¨¯©¸¸Ð)<¸d¿f¹f¿l¹lÈ3ÈBÐ>OÓPˆØ�>‰>˜#˜2Ð 'Ô)Ø—‘ w°Õ'7Ó8ˆHØ�F‰F�I‰I�h—n‘nÓ%ˆØ�7‰7�3�Bˆ<˜7Ô"Ø—‘˜ 4�Ó(ˆAÜ�YŠY˜ I¥,Ð/°Ó4ˆÜ—’�r˜<Ó(ˆØ!ˆˆ{ÑØˆr#   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rå   r   Úcheck_rotationÚboolr   r?   r   )r    s   "r!   r"   rC   Î  s"   € ÷ ñ  ð ¸tð ÐPSñ r#   c                ó~   € \        V. RO4       \        P                  ! VR,          VR7      pVR,          pV ! W44      # )a%  Create a Se3 group from a matrix.

Args:
    matrix: torch.Tensor of shape ``(B, 4, 4)``.
    check_rotation: if ``True``, raise ``ValueError`` unless the rotation
        block of every input is a rotation matrix. The default ``False``
        keeps the unchecked behaviour, under which a reflection block
        such as ``diag(-1, 1, 1)`` yields a non-unit quaternion.

Example:
    >>> s = Se3.from_matrix(torch.eye(4))
    >>> s.r
    tensor([1., 0., 0., 0.])
    >>> s.t
    Parameter containing:
    tensor([0., 0., 0.], requires_grad=True)

)rê   rÏ   rÒ   rÑ   )r
   r   Úfrom_matrix)rß   rå   rê   r   r   s   &&&  r!   rí   ÚSe3.from_matrixÍ  s7   € ô( 	˜6¢?Ô3Ü�OŠO˜F ;Õ/ÀÔOˆØ�;ÕˆÙ�1‹yÐr#   c               ó    € V ^8„  d   QhRRRR/# )r   Úqxyzr   r   r?   r   )r    s   "r!   r"   rC   ç  s   € ÷ *ñ *˜\ð *¨cñ *r#   c                óz   € \        VRR.4       VR,          VR,          r2V ! \        P                  ! V4      V4      # )aó  Create a Se3 group from a quaternion and a translation vector.

Args:
    qxyz: torch.Tensor of shape ``(B, 7)`` laid out as ``[qw, qx, qy, qz, x, y, z]``, scalar first; the
        quaternion is stored as given, and a non-unit one stands for the rotation of its direction.

Example:
    >>> qxyz = torch.tensor([0., 0., 0., 1., 0., 0., 1.])
    >>> s = Se3.from_qxyz(qxyz)
    >>> s.r
    tensor([0., 0., 0., 1.])
    >>> s.t
    Parameter containing:
    tensor([0., 0., 1.], requires_grad=True)

rE   Ú7).:Nr\   N).:r\   NN)r
   r   Ú	from_wxyz)rß   rð   r(   Úxyzs   &&  r!   Ú	from_qxyzÚSe3.from_qxyzæ  s7   € ô$ 	˜4 # s Ô,Ø�g•  W¥ˆ3Ù”3—=’= Ó# SÓ)Ð)r#   c               ó   € V ^8„  d   QhRR/# )r   r   r?   r   )r    s   "r!   r"   rC   ü  s   € ÷ Jñ J˜ñ Jr#   c                óÒ   € V P                   P                  4       p\        V\        VP                  V P
                  ) 4      P                  V P
                  P                  4      4      # )zïReturn the inverse transformation.

Example:
    >>> s = Se3(So3.identity(), torch.ones(3))
    >>> s_inv = s.inverse()
    >>> s_inv.r
    tensor([1., -0., -0., -0.])
    >>> s_inv.t
    tensor([-1., -1., -1.], grad_fn=<SliceBackward0>)

)r   Úinverser?   r   r(   r   rm   r9   )rN   Úr_invs   & r!   rù   ÚSe3.inverseü  sE   € ð —‘—‘Ó ˆÜ�5œ+ e§g¡g°·±¨wÓ7×:Ñ:¸4¿6¹6¿<¹<ÓHÓIÐIr#   c               ó(   € V ^8„  d   QhRRRRRRRR/# rØ   r   )r    s   "r!   r"   rC     s2   € ÷ ñ à!ðð /ðð (ð	ð
 
ñr#   c                ó®   € Vf   RpM\        V^8¬  RR7       V3p\        P                  ! WV4      p\        P                  ! . VO^N5W#R7      pV ! WV4      # )a  Create a Se3 group representing a random transformation.

Args:
    batch_size: the batch size of the underlying data.
    device: device to place the result on.
    dtype: dtype of the result.

Example:
    >>> s = Se3.random()
    >>> s = Se3.random(batch_size=3)

zbatch_size must be positive)Úmsgr¡   r   )r   r   Úrandomr+   Úrand)rß   rÙ   r;   r9   r*   r   r   s   &&&&   r!   rÿ   Ú
Se3.random  sW   € ð( ÒØ‰Eä˜ q™Ð.KÕLØ�MˆEÜ�JŠJ�z¨5Ó1ˆÜ�JŠJ�{˜�{ ‘{¨6Ô?ˆÙ�1‹yÐr#   c               ó    € V ^8„  d   QhRRRR/# ©r   Úxr   r   r?   r   )r    s   "r!   r"   rC   )  ó   € ÷ @ñ @�lð @ sñ @r#   c                ó–   € \         P                  ! V4      pV ! \        P                  ! V4      \         P                  ! W"V3R4      4      # )zGConstruct a x-axis rotation.

Args:
    x: the x-axis rotation angle.

r&   )r+   r«   r   Úrot_xÚstack©rß   r  Úzss   && r!   r  Ú	Se3.rot_x(  ó8   € ô ×Ò˜aÓ ˆÙ”3—9’9˜Q“<¤§¢¨b°b¨\¸2Ó!>Ó?Ð?r#   c               ó    € V ^8„  d   QhRRRR/# ©r   Úyr   r   r?   r   )r    s   "r!   r"   rC   4  r  r#   c                ó–   € \         P                  ! V4      pV ! \        P                  ! V4      \         P                  ! W"V3R4      4      # )zGConstruct a y-axis rotation.

Args:
    y: the y-axis rotation angle.

r&   )r+   r«   r   Úrot_yr  ©rß   r  r
  s   && r!   r  Ú	Se3.rot_y3  r  r#   c               ó    € V ^8„  d   QhRRRR/# ©r   Úzr   r   r?   r   )r    s   "r!   r"   rC   ?  r  r#   c                ó–   € \         P                  ! V4      pV ! \        P                  ! V4      \         P                  ! W"V3R4      4      # )zGConstruct a z-axis rotation.

Args:
    z: the z-axis rotation angle.

r&   )r+   r«   r   Úrot_zr  ©rß   r  r
  s   && r!   r  Ú	Se3.rot_z>  r  r#   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r  r   r  r  r   r?   r   )r    s   "r!   r"   rC   J  s(   € ÷ 9ñ 9�lð 9 |ð 9¸ð 9Èñ 9r#   c                ó˜  € \        VP                  VP                  8H  4       \        VP                  VP                  8H  4       \        WV.4       \        VP                  4      ^ 8”  d   VP                  ^ ,          MRp\        P
                  ! WAP                  VP                  4      pV ! V\        P                  ! WV3R4      4      # )z�Construct a translation only Se3 instance.

Args:
    x: the x-axis translation.
    y: the y-axis translation.
    z: the z-axis translation.

Nr&   )
r   r*   r	   r_   r   rÞ   r;   r9   r+   r  )rß   r  r  r  rÙ   rA   s   &&&&  r!   ÚtransÚ	Se3.transI  sŒ   € ô 	�Q—W‘W §¡Ñ'Ô(Ü�Q—W‘W §¡Ñ'Ô(Ü! 1¨ )Ô,Ü#& q§w¡w£<°!Ô#3�Q—W‘W˜Q–Z¸ˆ
Ü—<’< 
¯H©H°a·g±gÓ>ˆÙ�8œUŸ[š[¨!°¨°BÓ7Ó8Ð8r#   c               ó    € V ^8„  d   QhRRRR/# r  r   )r    s   "r!   r"   rC   [  ó   € ÷ $ñ $˜ð $¨ñ $r#   c                óR   € \         P                  ! V4      pV P                  WV4      # )zGConstruct a x-axis translation.

Args:
    x: the x-axis translation.

©r+   r«   r  r	  s   && r!   Útrans_xÚSe3.trans_xZ  s%   € ô ×Ò˜aÓ ˆØ�y‰y˜ Ó#Ð#r#   c               ó    € V ^8„  d   QhRRRR/# r  r   )r    s   "r!   r"   rC   f  r   r#   c                óR   € \         P                  ! V4      pV P                  W!V4      # )zGConstruct a y-axis translation.

Args:
    y: the y-axis translation.

r"  r  s   && r!   Útrans_yÚSe3.trans_ye  s%   € ô ×Ò˜aÓ ˆØ�y‰y˜ Ó#Ð#r#   c               ó    € V ^8„  d   QhRRRR/# r  r   )r    s   "r!   r"   rC   q  r   r#   c                óR   € \         P                  ! V4      pV P                  W"V4      # )zGConstruct a z-axis translation.

Args:
    z: the z-axis translation.

r"  r  s   && r!   Útrans_zÚSe3.trans_zp  s%   € ô ×Ò˜aÓ ˆØ�y‰y˜ Ó#Ð#r#   c               ó   € V ^8„  d   QhRR/# r‘   r   )r    s   "r!   r"   rC   {  s   € ÷ +ñ +˜ñ +r#   c                óh  € V P                   P                  4       p\        P                  ! VP                  RR V P
                  P                  RR 4      pVP                  RR V8w  d   VP                  VR,           4      pV P
                  pVP                  RR V8w  d   VP                  VR,           4      p\        P                  ! V4      p\        P                  ! V\        P                  ! V4      V,          3R4      p\        P                  ! WA3R4      p\        P                  ! WV3R4      # )ai  Return the adjoint matrix of shape ``(B, 6, 6)``.

Example:
    >>> s = Se3.identity()
    >>> s.adjoint()
    tensor([[1., 0., 0., 0., 0., 0.],
            [0., 1., 0., 0., 0., 0.],
            [0., 0., 1., 0., 0., 0.],
            [0., 0., 0., 1., 0., 0.],
            [0., 0., 0., 0., 1., 0.],
            [0., 0., 0., 0., 0., 1.]], grad_fn=<CatBackward0>)

Nrã   r&   rä   r]   )r   rå   r+   r,   r*   r   r`   r«   rÁ   r   r§   )rN   r·   rd   r   r  Úrow0Úrow1s   &      r!   ÚadjointÚSe3.adjoint{  sç   € ð �H‰H�O‰OÓˆÜ×(Ò(¨¯©°°"¨°t·v±v·|±|ÀCÀRÐ7HÓIˆØ�7‰7�3�Bˆ<˜7Ô"Ø—‘˜ 6Õ)Ó*ˆAØ�F‰FˆØ�7‰7�3�Bˆ<˜7Ô"Ø—‘˜ 4�Ó(ˆAÜ×Ò˜QÓˆÜ�yŠy˜!œSŸWšW Q›Z¨!�^Ð,¨bÓ1ˆÜ�yŠy˜!˜ Ó$ˆÜ�yŠy˜$˜ rÓ*Ð*r#   r†   )NNN)F)*Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__deepcopy__rI   rV   rf   rq   r   rv   Úpropertyr   r‹   r   r   rA   rB   Ústaticmethodr¬   r¿   r§   rÓ   ÚclassmethodrÞ   rå   rí   rõ   rù   rÿ   r  r  r  r  r#  r'  r+  r1  Ú__static_attributes__Ú__classcell__)rP   s   @r!   r?   r?   Q   s  ø† ñ8ðv *€L÷1&ð 1&õf<õ=õð Ü-ó Ø-àÜ5ó Ø5àÜ?ó Ø?õ<ð8 ôó ðð ô ó ð ð ôó ðð ô!ó ð!ð ôó ðð ô!ó ð!ð ô$;ó ð$;õL#/ðJ ô'ó ð'ð0 ô+ó ð+ð* ö?ó ð?õ8ð0 öó ðð0 ô*ó ð*õ*Jð öó ðð8 ô@ó ð@ð ô@ó ð@ð ô@ó ð@ð ô9ó ð9ð  ô$ó ð$ð ô$ó ð$ð ô$ó ð$÷+ó +r#   r?   )$Ú
__future__r   Útypingr   r   r   r+   Útorch.nn.functionalr   Ú
functionalrÉ   Úkornia.core.checkr   r	   r
   Úkornia.core.exceptionsr   r   Úkornia.core.utilsr   r   Úkornia.geometry.liegroup.so3r   r   r   r   Úkornia.geometry.linalgr   Úkornia.geometry.quaternionr   Úkornia.geometry.vectorr   r1   r=   ÚModuler?   r   r#   r!   Ú<module>rJ     sS   ðõ( #ç ,Ñ ,ã ß Ð Ý ç YÑ Yß >ß Kß nÓ nÝ 6Ý 1Ý *õ
õ
ô>B	+ˆ"�)‰)ö B	+r#   