ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Getting individual joint positions in openni_tracker

asked 2014-03-18 01:11:52 -0500

Latif Anjum gravatar image

Hi all,

I have openni_tracker running and publishing at /tf. I get following type of data if I try to publish /tf or save it in rosbag or text file.

      seq: 0
        secs: 1395050118
        nsecs: 781445267
      frame_id: /openni_depth_frame
    child_frame_id: /left_hand_1
        x: 2.29258546773
        y: 0.40955856152
        z: 0.746916322515
        x: 0.499999999997
        y: 0.500001836603
        z: 0.499999999997
        w: 0.499998163397
      seq: 0
        secs: 1395050118
        nsecs: 781469499
      frame_id: /openni_depth_frame
    child_frame_id: /right_shoulder_1
        x: 2.45040462809
        y: -0.0277115992896
        z: 0.594173250142
        x: 0.713314685492
        y: 0.667630701545
        z: 0.17342876346
        w: -0.123991410271
//--- and so on!

How can I subscribe to individual joints position, e.g. to only right_shoulder_1? I tried /tf/right_shoulder_1 but it didn't work. Shouldn't I be able to get even the translation of a joint? For example /tf/right_shoulder_1/translation/x should give me x translation position of right_shoulder_1.

The data saved together with all joints makes it difficult to use. I also need individual joint data in inside a program.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-03-18 02:23:27 -0500

The /tf data isn't really designed to work like a normal topic. You don't typically just subscribe to it. More about how /tf data works can be read on the tf wiki page. Here are 2 simple solutions for you to consider:

  1. You could write a node that creates a TransformListener, and then in some callback (maybe from a Timer) you lookup the transform from some frame attached to the depth sensor (maybe /<camera>_depth_optical_frame) to the frame at the joint you are interested in. This transform could then be converted into some other message type (maybe a PoseStamped) and published on some other topic. Or it could be directly worked with to do whatever you want.
  2. You could edit the openni_tracker source code to publish a message that contains the data you want. I have a package that I worked on a few years ago that does this for all of the skeleton tracking data. Here is the package and here are the associated message definitions. You might also want to look at the pi_tracker package as I think they do something very similar.
edit flag offensive delete link more


Thanks sir. Seems like I was pretty much away from my target. Looking into /tf details.

Latif Anjum gravatar image Latif Anjum  ( 2014-03-18 03:43:03 -0500 )edit

Question Tools

1 follower


Asked: 2014-03-18 01:11:52 -0500

Seen: 740 times

Last updated: Mar 18 '14