openni_tracker listener cannot find 'openni_depth_frame' (groovy) [closed]

asked 2013-04-17 13:40:02 -0500

cooly64x gravatar image

updated 2016-10-24 08:34:42 -0500

ngrennan gravatar image

Following a tutorial (can't post link) to write an tf listener for the frames openni_tracker publishes. Here is my listener:

  from kinect import Kinect      
  kin = Kinect()
  for i in xrange(10):
  print i, kin.get_posture()

Here is the kinect class file:

import roslib
import rospy
import tf

BASE_FRAME = '/openni_depth_frame'

 class Kinect:
 def __init__(self, name='kinect_listener', user=1):
 rospy.init_node(name, anonymous=True)
 self.listener = tf.TransformListener()
 self.user = user

 def get_posture(self):

      frames = []
      for frame in FRAMES:
          trans, rot = self.listener.lookupTransform(BASE_FRAME,
                  "/%s_%d" % (frame, self.user), LAST)
          frames.append((trans, rot))
      return frames
      #except (tf.LookupException,
      #        tf.ConnectivityException,
      #        tf.ExtrapolationException):
    #    raise IndexError

When I run this I get this error:

Traceback (most recent call last):
File "/home/robotlab/catkin_ws/src/kinect_listener/src/", line 8, in <module>
print i, kin.get_posture()
File "/home/robotlab/catkin_ws/src/kinect_listener/src/", line 49, in get_posture
"/%s_%d" % (frame, self.user), LAST)
tf.LookupException: Frame id /openni_depth_frame does not exist! Frames (1):

Which doesn't make sense because when I run rostopic echo tf I can see the frame and the published transforms (for example):

frame_id: /openni_depth_frame
child_frame_id: /right_foot_1
    x: 1.04582212435
    y: -0.372131748083
    z: -0.909085018278
    x: 0.499999999997
    y: 0.500001836603
    z: 0.499999999997
    w: 0.499998163397

Why can rostopic see the frame fine but my code cannot? I already did the Psi pose in front of the kinect when I ran openni_tracker.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-06-16 19:27:35.263542


Hey, i try to run the example too, but I get the same Error like you. I have no idea how to solve this problem, because the terminal shows me, that the user is calibrated. Maybe anyone run this example and can help us. Thanks for solution approaches

Turtlebot23 gravatar image Turtlebot23  ( 2013-08-26 23:19:21 -0500 )edit

Did you find a solution??

G212 gravatar image G212  ( 2015-12-22 17:20:52 -0500 )edit