How to callback specific tf joint from openni_tracker
hey, I'm trying to write a callback for tf's from the openni_tracker node but i get errors at runtime. To "echo" the data, i launch the tracker with this parameters:
<node pkg="openni_tracker" type="openni_tracker" name="openni_tracker">
<param name="tf_prefix" value="tracker" />
<param name="camera_frame_id" value="/camera_link" />
</node>
i'm using the following code (excerpt) to get the data:
ros::Subscriber openni_sub = n.subscribe("tf", 1000, openniCallback);
....
void openniCallback(const tf::tfMessage openni_sub) {
tf::TransformListener listener;
tf::StampedTransform tf_right_hand;
ros::NodeHandle n;
try {
listener.lookupTransform("/camera_link",
"/tracker/right_hand_1", ros::Time(0), tf_right_hand);
x_right_hand = tf_right_hand.getOrigin().x();
//same with left_hand and head.
.....
}
catch (tf::TransformException ex) {
ROS_ERROR("%s", ex.what());
}
}
My Problem is, that i get the data for right_hand, left_hand and head, but i also get a lot of errors like:
[ERROR] [1372076533.053340930]: Frame id /tracker/right_hand_1 does not exist! Frames (15): Frame /tracker/torso_1 exists with parent /camera_link.
My idea is, that i get a callback, but there is no data to lookup. so:
- how can i get a callback if there is new data for the right_hand, left_hand and head, not a callback for any tfMessage?
- is it possible not to use a transformListener.lookupTransform like "openni_sub.getOrigin().x()? - i did not get that one work, too...