+
    åûj¹1  ã                  ó€   € R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
Ht ^ RIHt R.tR
R R llt ! R	 R4      tR# )ai  Rigid SE(2) and SE(3) poses that carry the names of their source and destination frames.

A pose ``b_from_a`` maps points in frame ``a`` to frame ``b``, and ``c_from_b * b_from_a`` is ``c_from_a``: the
names make a composition whose frames do not chain raise instead of returning a wrong pose.

Which class to use:

- A pose between named frames, built from an :class:`~kornia.geometry.liegroup.Se3` or
  :class:`~kornia.geometry.liegroup.Se2`, a rotation and a translation, or a matrix: :class:`NamedPose`.
- The pose without names: :class:`~kornia.geometry.liegroup.Se3` and :class:`~kornia.geometry.liegroup.Se2`.
)ÚannotationsN)ÚKORNIA_CHECK_TYPE)ÚSe2ÚSe3ÚSo2ÚSo3)Ú
QuaternionÚ	NamedPosec               ó$   € V ^8„  d   QhRRRRRR/# )é   Úmatrixútorch.TensorÚmatrix_typeÚstrÚreturnÚNone© )Úformats   "ÚPC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\geometry\pose.pyÚ__annotate__r   +   s&   € ÷ wñ w ð w¸3ð wÈñ wó    c           	     óF  € . pVR8X  d
   ^^.^^..pMVR8X  d	   ^^.^^..p\        V P                  4      ^8”  g8   \        V P                  4      ^8  g   \        V P                  RR 4      V9  d/   \        V RV^ ,           RV^,           RV P                   24      hR# )z"Verify matrix shape based on type.ÚRÚRTNz must be either z or ú, got éþÿÿÿ)ÚlenÚshapeÚlistÚ
ValueError)r   r   Útarget_shapess   && r   Ú_check_matrix_shaper!   +   s³   € à€MØ�cÔØ˜Q˜ ! Q Ð(‰Ø	˜Ô	Ø˜Q˜ ! Q Ð(ˆÜ
ˆ6�<‰<Ó˜1Ô¤ F§L¡LÓ 1°AÔ 5¼¸f¿l¹lÈ2È3Ð>OÓ9PÐXeÔ9eÜ˜K˜=Ð(8¸ÀqÕ9IÐ8JÈ$È}Ð]^ÕO_ÐN`Ð`fÐgm×gsÑgsÐftÐuÓvÐvñ :fr   c                  óü   € ] tR t^6tRtRR R l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4       t]R R l4       t]RR R ll4       t]RR R ll4       tR R ltR R ltRtR# )r	   a½	  Hold an SE(2) or SE(3) pose with the names of its two frames, which composition checks.

``b_from_a = NamedPose(pose, frame_src="a", frame_dst="b")`` wraps an :class:`~kornia.geometry.liegroup.Se3` or
:class:`~kornia.geometry.liegroup.Se2` pose that maps frame ``a`` to frame ``b``;
``b_from_a.transform_points(points)`` maps points from ``a`` to ``b``, and ``c_from_b * b_from_a`` composes two
poses into ``c_from_a`` after checking that the frames chain. An unbatched ``Se3`` maps ``(3,)`` or ``(N, 3)``,
and a batch of ``B`` maps ``(B, 3)``, one point per pose (a batch of one also maps ``(N, 3)``); an unbatched
``Se2`` maps ``(2,)`` or ``(N, 2)``, and a batch of ``B`` maps ``(B, 2)``. Other layouts, such as a batch of poses
with a point set ``(B, N, 3)``, raise ``ValueError``. Build one from a rotation and a translation with
:meth:`from_rt`, or from a ``3 x 3`` or ``4 x 4`` matrix with :meth:`from_matrix`. For a pose without frame names,
use the Lie group classes directly; for ``4 x 4`` matrices,
:func:`~kornia.geometry.linalg.compose_transformations`.

Convention:
    - ``NamedPose(pose, frame_src="1", frame_dst="0")`` is ``trans_01`` in the notation of
      :func:`~kornia.geometry.linalg.relative_transformation`, for an ``Se2`` and an ``Se3`` pose alike.
    - The matrix of ``c_from_b * b_from_a`` is ``c_from_b.pose.matrix() @ b_from_a.pose.matrix()``.
      The left operand's ``frame_src`` must equal the right operand's ``frame_dst``, otherwise ``*`` raises
      ``ValueError``; :meth:`inverse` inverts the pose and swaps the frame names.
    - The pose must be an ``Se2`` or an ``Se3``: an ``So3``, ``So2``, ``Quaternion`` or tensor is rejected at
      construction (use :meth:`from_rt` or :meth:`from_matrix` to build a pose from one), and ``*`` raises
      ``TypeError`` for a right operand that is not a ``NamedPose`` or holds the other group.

See Also:
    - :class:`~kornia.geometry.liegroup.Se3`: the 3D rigid pose it wraps, without frame names.
    - :class:`~kornia.geometry.liegroup.Se2`: the 2D rigid pose it wraps, without frame names.
    - :func:`~kornia.geometry.linalg.relative_transformation`: the relative pose of two ``4 x 4`` matrices.

Example:
    >>> b_from_a = NamedPose(Se3.identity(), frame_src="frame_a", frame_dst="frame_b")
    >>> b_from_a
    NamedPose(dst_from_src=rotation: tensor([1., 0., 0., 0.])
    translation: Parameter containing:
    tensor([0., 0., 0.], requires_grad=True),
    frame_src: frame_a -> frame_dst: frame_b)

Nc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Údst_from_srcú	Se2 | Se3Ú	frame_srcú
str | NoneÚ	frame_dstr   r   r   )r   s   "r   r   ÚNamedPose.__annotate__]   s*   € ÷ 8ñ 8 Yð 8¸:ð 8ÐYcð 8Ðosñ 8r   c                óö   € \        V\        \        34       Wn        T;'       g     \        P
                  ! 4       P                  V n        T;'       g     \        P
                  ! 4       P                  V n        R# )a]  Construct NamedPose.

Args:
    dst_from_src: Pose from source frame to destination frame.
    frame_src: Name of the source frame; a random unique name when omitted or empty.
    frame_dst: Name of the destination frame; a random unique name when omitted or empty.

Raises:
    TypeCheckError: if ``dst_from_src`` is not an ``Se2`` or an ``Se3``.

N)	r   r   r   Ú_dst_from_srcÚuuidÚuuid4ÚhexÚ
_frame_srcÚ
_frame_dst)Úselfr$   r&   r(   s   &&&&r   Ú__init__ÚNamedPose.__init__]   sN   € ô 	˜,¬¬c¨
Ô3Ø)ÔØ#×7Ð7¤t§z¢z£|×'7Ñ'7ˆŒØ#×7Ð7¤t§z¢z£|×'7Ñ'7ˆŽr   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r)   n   s   € ÷ 
ñ 
˜#ñ 
r   c                	óV   € R V P                    RV P                   RV P                   R2# )zNamedPose(dst_from_src=z,
frame_src: z -> frame_dst: Ú))r+   r/   r0   ©r1   s   &r   Ú__repr__ÚNamedPose.__repr__n   s7   € à% d×&8Ñ&8Ð%9ð :ØŸ/™/Ð*¨/¸$¿/¹/Ð9JÈ!ðMð	
r   c               ó    € V ^8„  d   QhRRRR/# )r   Úotherr	   r   r   )r   s   "r   r   r)   t   s   € ÷ wñ w˜Yð w¨9ñ wr   c                ó\  € \        V\        4      '       g   \        R\        V4       24      hV P                  VP
                  8w  d   \        RV  RV 24      h\        V P                  \        4      '       de   \        VP                  \        4      '       dE   \        V P                  P                  VP                  4      VP                  V P
                  4      # \        V P                  \        4      '       de   \        VP                  \        4      '       dE   \        V P                  P                  VP                  4      VP                  V P
                  4      # \        R\        V P                  4      P                   R\        VP                  4      P                   R24      h)aœ  Compose two NamedPoses.

Args:
    other: NamedPose to compose with.

Returns:
    Composed NamedPose.

Raises:
    TypeError: if ``other`` is not a ``NamedPose`` or its pose is not of the same group as ``self.pose``.
    ValueError: if ``self.frame_src`` is not ``other.frame_dst``.

Example:
    >>> b_from_a = NamedPose(Se3.identity(), frame_src="frame_a", frame_dst="frame_b")
    >>> c_from_b = NamedPose(Se3.identity(), frame_src="frame_b", frame_dst="frame_c")
    >>> c_from_b * b_from_a
    NamedPose(dst_from_src=rotation: tensor([1., 0., 0., 0.])
    translation: tensor([0., 0., 0.], grad_fn=<AddBackward0>),
    frame_src: frame_a -> frame_dst: frame_c)

z5NamedPose can only be composed with a NamedPose, got zCannot compose z with zCannot compose an z pose with an z pose)Ú
isinstancer	   Ú	TypeErrorÚtyper/   r0   r   Úposer   r+   Ú_mul_se2r   Ú_mul_se3Ú__name__)r1   r<   s   &&r   Ú__mul__ÚNamedPose.__mul__t   s9  € ô, ˜%¤×+Ò+ÜÐSÔTXÐY^ÓT_ÐS`ÐaÓbÐbØ�?‰?˜e×.Ñ.Ô.Ü˜¨t¨f°F¸5¸'ÐBÓCÐCÜ�d—i‘i¤×%Ò%¬*°U·Z±ZÄ×*EÒ*EÜ˜T×/Ñ/×8Ñ8¸¿¹ÓDÀe×FVÑFVÐX\×XgÑXgÓhÐhÜ�d—i‘i¤×%Ò%¬*°U·Z±ZÄ×*EÒ*EÜ˜T×/Ñ/×8Ñ8¸¿¹ÓDÀe×FVÑFVÐX\×XgÑXgÓhÐhÜÐ,¬T°$·)±)«_×-EÑ-EÐ,FÀnÔUYÐZ_×ZdÑZdÓUe×UnÑUnÐToÐotÐuÓvÐvr   c               ó   € V ^8„  d   QhRR/# )r   r   r%   r   )r   s   "r   r   r)   •   s   € ÷ "ñ "�iñ "r   c                ó   € V P                   # )z-Pose from source frame to destination frame .©r+   r8   s   &r   rA   ÚNamedPose.pose”   s   € ð ×!Ñ!Ð!r   c               ó   € V ^8„  d   QhRR/# )r   r   z	So3 | So2r   )r   s   "r   r   r)   š   s   € ÷ +ñ +˜)ñ +r   c                ó.   € V P                   P                  # )zRotation part of the pose.)r+   Úrotationr8   s   &r   rM   ÚNamedPose.rotation™   s   € ð ×!Ñ!×*Ñ*Ð*r   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   r)   Ÿ   s   € ÷ .ñ .˜\ñ .r   c                ó.   € V P                   P                  # )zTranslation part of the pose.)r+   Útranslationr8   s   &r   rQ   ÚNamedPose.translationž   s   € ð ×!Ñ!×-Ñ-Ð-r   c               ó   € V ^8„  d   QhRR/# r5   r   )r   s   "r   r   r)   ¤   ó   € ÷ ñ ˜3ñ r   c                ó   € V P                   # )zName of the source frame.)r/   r8   s   &r   r&   ÚNamedPose.frame_src£   ó   € ð �‰Ðr   c               ó   € V ^8„  d   QhRR/# r5   r   )r   s   "r   r   r)   ©   rT   r   c                ó   € V P                   # )zName of the destination frame.)r0   r8   s   &r   r(   ÚNamedPose.frame_dst¨   rW   r   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   rM   z%So3 | So2 | torch.Tensor | QuaternionrQ   r   r&   r'   r(   r   úNamedPose | Noner   )r   s   "r   r   r)   ®   s<   € ÷ 4ñ 4à7ð4ð "ð4ð ð	4ð
 ð4ð 
ñ4r   c           
     óà  € \        V\        \        34      '       d   V ! \        W4      W44      # \        V\        4      '       d   V ! \        W4      W44      # \        V\        P                  4      '       Edb   \        V4       VP                  R,          pVP                  RR	 pVP                  VP                  RR 8w  dQ   \        R\        VP                  RR 4       R\        VP                  4       R\        VP                  4       24      h\        P                  ! V^,           VP                  VP                  R7      pVP                  ! . VOV^,           NV^,           N5!  P!                  4       pWRRV1RV13&   W'RRV1V3&   V^8X  d   V ! \
        P"                  ! V4      W44      # V^8X  d   V ! \        P"                  ! V4      W44      #  R# \        R\%        V4       24      h)
a(  Construct NamedPose from rotation and translation.

Args:
    rotation: Rotation part of the pose.
    translation: Translation part of the pose.
    frame_src: Name of the source frame; a random unique name when omitted or empty.
    frame_dst: Name of the destination frame; a random unique name when omitted or empty.

Returns:
    NamedPose constructed from rotation and translation.

Example:
    >>> b_from_a_rot = So3.identity()
    >>> b_from_a_trans = torch.tensor([1., 2., 3.])
    >>> b_from_a = NamedPose.from_rt(b_from_a_rot, b_from_a_trans, frame_src="frame_a", frame_dst="frame_b")
    >>> b_from_a
    NamedPose(dst_from_src=rotation: tensor([1., 0., 0., 0.])
    translation: Parameter containing:
    tensor([1., 2., 3.], requires_grad=True),
    frame_src: frame_a -> frame_dst: frame_b)

Nztranslation must have shape z for a rotation of shape r   )ÚdeviceÚdtype.z6R must be either So2, So3, Quaternion, or Tensor, got éÿÿÿÿr   )r>   r   r   r   r   r   ÚtorchÚTensorr!   r   r   ÚtupleÚeyer^   r_   ÚexpandÚcloneÚfrom_matrixr@   )ÚclsrM   rQ   r&   r(   ÚdimÚbatch_shaper   s   &&&&&   r   Úfrom_rtÚNamedPose.from_rt­   s»  € ô< �h¤¤jÐ 1×2Ò2Ù”s˜8Ó1°9ÓHÐHÜ�h¤×$Ò$Ù”s˜8Ó1°9ÓHÐHÜ�h¤§¡×-Ó-Ü Ô)Ø—.‘. Õ$ˆCØ"Ÿ.™.¨¨"Ð-ˆKØ× Ñ  H§N¡N°3°BÐ$7Ô7Ü Ø2´5¸¿¹ÈÈÐ9LÓ3MÐ2NÐNgÜ˜XŸ^™^Ó,Ð-¨V´E¸+×:KÑ:KÓ4LÐ3MðOóð ô —’˜3 �7¨8¯?©?À(Ç.Á.ÔQˆBØ—’Ð:˜KÐ:¨¨q­Ð:°#¸µ'Ó:×@Ñ@ÓBˆBØ"*ˆs�D�S�D˜$˜3˜$ˆÑØ!,ˆs�D�S�D˜#ˆ~ÑØ�aŒxÙœ3Ÿ?š?¨2Ó.°	ÓEÐEØ�aŒxÙœ3Ÿ?š?¨2Ó.°	ÓEÐEð ñ ô ÐUÔVZÐ[cÓVdÐUeÐfÓgÐgr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r   r   r&   r'   r(   r   r\   r   )r   s   "r   r   r)   å   s,   € ÷ ñ Ø!ðØ.8ðØLVðà	ñr   c                óÖ   € \        VRR7       VP                  R,          pV^8X  d   V ! \        P                  ! V4      W#4      # V^8X  d   V ! \        P                  ! V4      W#4      # R# )a£  Construct NamedPose from a matrix.

Args:
    matrix: Matrix representation of the pose.
    frame_src: Name of the source frame; a random unique name when omitted or empty.
    frame_dst: Name of the destination frame; a random unique name when omitted or empty.

Returns:
    NamedPose constructed from a matrix.

Example:
    >>> b_from_a_matrix = torch.eye(4)
    >>> b_from_a = NamedPose.from_matrix(b_from_a_matrix, frame_src="frame_a", frame_dst="frame_b")
    >>> b_from_a
    NamedPose(dst_from_src=rotation: tensor([1., 0., 0., 0.])
    translation: Parameter containing:
    tensor([0., 0., 0.], requires_grad=True),
    frame_src: frame_a -> frame_dst: frame_b)

r   )r   Nr`   )r!   r   r   rg   r   )rh   r   r&   r(   ri   s   &&&& r   rg   ÚNamedPose.from_matrixä   sY   € ô0 	˜F°Õ5Ø�l‰l˜2ÕˆØ�!Œ8Ù”s—’ vÓ.°	ÓEÐEØ�!Œ8Ù”s—’ vÓ.°	ÓEÐEÙr   c               ó   € V ^8„  d   QhRR/# )r   r   r	   r   )r   s   "r   r   r)     s   € ÷ Yñ Y˜ñ Yr   c                ót   € \        V P                  P                  4       V P                  V P                  4      # )ao  Inverse of the NamedPose.

Returns:
    Inverse of the NamedPose.

Example:
    >>> b_from_a = NamedPose(Se3.identity(), frame_src="frame_a", frame_dst="frame_b")
    >>> b_from_a.inverse()
    NamedPose(dst_from_src=rotation: tensor([1., -0., -0., -0.])
    translation: tensor([0., 0., 0.], grad_fn=<SliceBackward0>),
    frame_src: frame_b -> frame_dst: frame_a)

)r	   r+   Úinverser0   r/   r8   s   &r   rr   ÚNamedPose.inverse  s*   € ô ˜×+Ñ+×3Ñ3Ó5°t·±ÈÏÉÓXÐXr   c               ó    € V ^8„  d   QhRRRR/# )r   Úpoints_in_srcr   r   r   )r   s   "r   r   r)     s   € ÷ 2ñ 2¨lð 2¸|ñ 2r   c                ó(   € V P                   V,          # )ag  Transform points from source frame to destination frame.

Args:
    points_in_src: Points in source frame.

Returns:
    Points in destination frame.

Example:
    >>> b_from_a = NamedPose(Se3.identity(), frame_src="frame_a", frame_dst="frame_b")
    >>> b_from_a.transform_points(torch.tensor([1., 2., 3.]))
    tensor([1., 2., 3.], grad_fn=<AddBackward0>)

rI   )r1   ru   s   &&r   Útransform_pointsÚNamedPose.transform_points  s   € ð ×!Ñ! MÕ1Ð1r   )r+   r0   r/   )NN)rD   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r2   r9   rE   ÚpropertyrA   rM   rQ   r&   r(   Úclassmethodrk   rg   rr   rw   Ú__static_attributes__r   r   r   r	   r	   6   s¶   † ñ$÷L8õ"
õwð@ ô"ó ð"ð ô+ó ð+ð ô.ó ð.ð ôó ðð ôó ðð ö4ó ð4ðl öó ðõ>Y÷ 2ñ 2r   )r   )r|   Ú
__future__r   r,   ra   Úkornia.core.checkr   Úkornia.geometry.liegroupr   r   r   r   Úkornia.geometry.quaternionr   Ú__all__r!   r	   r   r   r   Ú<module>r…      s:   ðñ$
õ #ã ã å /ß 7Ó 7Ý 1àˆ-€÷w÷m2ó m2r   