pycram.local_transformer
========================

.. py:module:: pycram.local_transformer


Classes
-------

.. autoapisummary::

   pycram.local_transformer.LocalTransformer


Module Contents
---------------

.. py:class:: LocalTransformer

   Bases: :py:obj:`pytransform3d.transform_manager.TransformManager`


   .. py:attribute:: _instance
      :value: None



   .. py:attribute:: prospection_prefix
      :type:  str
      :value: 'prospection/'



   .. py:attribute:: world
      :type:  pycram.datastructures.world.World
      :value: None



   .. py:attribute:: prospection_world
      :type:  pycram.datastructures.world.World
      :value: None



   .. py:attribute:: _initialized
      :value: True



   .. py:method:: transform_to_object_frame(pose: pycram.datastructures.pose.PoseStamped, world_object: pycram.world_concepts.world_object.Object, link_name: str = None) -> typing_extensions.Union[pycram.datastructures.pose.PoseStamped, None]

      Transforms the given PoseStamped to the object coordinate frame

      :param pose: The Pose that should be transformed
      :param world_object: The world object to which coordinate frame should be transformed
      :param link_name: An optional link name of the object
      :return: The transformed PoseStamped



   .. py:method:: update_transforms_for_objects(objects: typing_extensions.List[pycram.world_concepts.world_object.Object]) -> None

      Updates the transforms for objects affected by the transformation. The objects are identified by their names.

      :param objects: List of objects for which the transforms should be updated



   .. py:method:: transform_pose(pose: pycram.datastructures.pose.PoseStamped, target_frame: str) -> typing_extensions.Optional[pycram.datastructures.pose.PoseStamped]

      Transforms the given PoseStamped to an arbitrary coordinate frame

      :param pose: The pose that should be transformed
      :param target_frame: The name of the target frame
      :return: The transformed PoseStamped in target frame



   .. py:method:: get_object_from_frame(frame: str) -> typing_extensions.Optional[pycram.world_concepts.world_object.Object]

      Get the name of the object that is associated with the given frame.

      :param frame: The frame for which the object name should be returned
      :return: The name of the object associated with the frame



   .. py:method:: translate_pose_along_local_axis(pose: pycram.datastructures.pose.PoseStamped, axis: typing_extensions.List, distance: float) -> pycram.datastructures.pose.PoseStamped
      :staticmethod:


      Translate a pose along a given 3d vector (axis) by a given distance. The axis is given in the local coordinate
      frame of the pose. The axis is normalized and then scaled by the distance.

      :param pose: The pose that should be translated
      :param axis: The local axis along which the translation should be performed
      :param distance: The distance by which the pose should be translated

      :return: The translated pose



   .. py:method:: get_object_from_link_frame(link_frame: str) -> typing_extensions.Optional[pycram.world_concepts.world_object.Object]

      Get the name of the object that is associated with the given link frame.

      :param link_frame: The frame of the link for which the object name should be returned
      :return: The name of the object associated with the link frame



   .. py:method:: get_world_from_frame(frame: str) -> pycram.datastructures.world.World

      Get the world that is associated with the given frame name.

      :param frame: The frame name.



   .. py:method:: lookup_transform_from_source_to_target_frame(source_frame: str, target_frame: str, time: typing_extensions.Optional[pycram.ros.Time] = None) -> pycram.datastructures.pose.TransformStamped


   .. py:method:: update_transforms(transforms: typing_extensions.Iterable[pycram.datastructures.pose.TransformStamped], time: pycram.ros.Time = None) -> None

      Updates transforms by updating the time stamps of the header of each transform. If no time is given the current
      time is used.



   .. py:method:: xyzw_to_wxyz(xyzw: typing_extensions.List[float]) -> typing_extensions.List[float]
      :staticmethod:


      Convert a quaternion from XYZW to WXYZ format.

      :param xyzw: The quaternion in XYZW format.



   .. py:method:: get_all_frames() -> typing_extensions.Dict[typing_extensions.Tuple[typing_extensions.Hashable, typing_extensions.Hashable], pycram.datastructures.pose.Transform]


   .. py:method:: _check_pose_integrity(pose: pycram.datastructures.pose.PoseStamped) -> None
      :staticmethod:


      Check the integrity of the pose. This is a placeholder for any integrity checks that might be needed.



