0
$\begingroup$

Rosanswers logo

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.

transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1395050118
        nsecs: 781445267
      frame_id: /openni_depth_frame
    child_frame_id: /left_hand_1
    transform: 
      translation: 
        x: 2.29258546773
        y: 0.40955856152
        z: 0.746916322515
      rotation: 
        x: 0.499999999997
        y: 0.500001836603
        z: 0.499999999997
        w: 0.499998163397
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1395050118
        nsecs: 781469499
      frame_id: /openni_depth_frame
    child_frame_id: /right_shoulder_1
    transform: 
      translation: 
        x: 2.45040462809
        y: -0.0277115992896
        z: 0.594173250142
      rotation: 
        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.

Thanks.


Originally posted by Latif Anjum on ROS Answers with karma: 79 on 2014-03-18

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.

Originally posted by jarvisschultz with karma: 9031 on 2014-03-18

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Latif Anjum on 2014-03-18:
Thanks sir. Seems like I was pretty much away from my target. Looking into /tf details.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.