Package tf :: Module listener :: Class TransformListener
[hide private]
[frames] | no frames]

Class TransformListener

source code

 object --+        
          |        
Transformer --+    
              |    
 TransformerROS --+
                  |
                 TransformListener

TransformListener is a subclass of :class:`tf.TransformerROS` that
subscribes to the ``"/tf"`` message topic, and calls :meth:`tf.Transformer.setTransform`
with each incoming transformation message.

In this way a TransformListener object automatically
stays up to to date with all current transforms.  Typical usage might be::

    import tf
    from geometry_msgs.msg import PointStamped

    class MyNode:

        def __init__(self):

            self.tl = tf.TransformListener()
            rospy.Subscriber("/sometopic", PointStamped, self.some_message_handler)
            ...
        
        def some_message_handler(self, point_stamped):

            # want to work on the point in the "world" frame
            point_in_world = self.tl.transformPoint("world", point_stamped)
            ...
    

Instance Methods [hide private]
 
__init__(self, *args)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
asMatrix(self, target_frame, hdr)
:param target_frame: the tf target frame, a string :param hdr: a message header :return: a :class:`numpy.matrix` 4x4 representation of the transform :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code
 
fromTranslationRotation(self, translation, rotation)
:param translation: translation expressed as a tuple (x,y,z) :param rotation: rotation quaternion expressed as a tuple (x,y,z,w) :return: a :class:`numpy.matrix` 4x4 representation of the transform :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code
 
transformPoint(self, target_frame, ps)
:param target_frame: the tf target frame, a string :param ps: the geometry_msgs.msg.PointStamped message :return: new geometry_msgs.msg.PointStamped message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code
 
transformPointCloud(self, target_frame, point_cloud)
:param target_frame: the tf target frame, a string :param ps: the sensor_msgs.msg.PointCloud message :return: new sensor_msgs.msg.PointCloud message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code
 
transformPose(self, target_frame, ps)
:param target_frame: the tf target frame, a string :param ps: the geometry_msgs.msg.PoseStamped message :return: new geometry_msgs.msg.PoseStamped message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code
 
transformQuaternion(self, target_frame, ps)
:param target_frame: the tf target frame, a string :param ps: the geometry_msgs.msg.QuaternionStamped message :return: new geometry_msgs.msg.QuaternionStamped message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code
 
transformVector3(self, target_frame, v3s)
:param target_frame: the tf target frame, a string :param v3s: the geometry_msgs.msg.Vector3Stamped message :return: new geometry_msgs.msg.Vector3Stamped message, in frame target_frame :raises: any of the exceptions that :meth:`~tf.Transformer.lookupTransform` can raise (Inherited from tf.listener.TransformerROS)
source code

Inherited from Transformer: __new__, allFramesAsDot, allFramesAsString, canTransform, canTransformFull, chain, clear, frameExists, getFrameStrings, getLatestCommonTime, getTFPrefix, lookupTransform, lookupTransformFull, lookupTwist, lookupTwistFull, setTransform, setUsingDedicatedThread, waitForTransform, waitForTransformFull

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)