tf target frame does not exist [closed]

asked 2015-10-20 12:35:00 -0500

dasanche gravatar image

updated 2015-10-27 10:04:14 -0500

Hi, I'm working with ROS Indigo,

I was trying to set up two new transformations in a system in which I already have many and came across with the problem that ROS tells me these particular two recently adde don't exist when I ask for them.

I decided to try it out in a simpler manner, so I attached the code 2 very simple nodes, one broadcasts and the other one looks for the transform, I have both C++ and python versions. Basic code:

C++ broadcaster:

tf::TransformBroadcaster br;
tf::Transform transform;
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_camera", "base_arm"));
    //br.sendTransform(tf::StampedTransform(proximal_tf[i], ros::Time::now(), s1, s2));

Python broadcaster:

tf_br = tf.TransformBroadcaster()
while (1):
     tf_br.sendTransform((0.5,0.0,0.5), (0.0,0.0,0.0,1.0),, "base_camera", "base_arm")

C++ listener:

tf::TransformListener listener;
tf::StampedTransform transform;
char s1[50]; char s2[50];
sprintf(s1, "base_camera");
sprintf(s2, "base_arm");
        listener.lookupTransform(s1, s2, ros::Time(0), transform);
        //listener.lookupTransform(s1, s2, ros::Time(0), transform);
}catch (tf::TransformException ex){

Python listener:

tf_frames = tf.TransformListener()
    #object_in_arm = tf_frames.transformPose("Base_Camera", "Base_Arm", object_in_cam)
    (object_in_arm.pose.position, object_in_arm.pose.orientation) = tf_frames.lookupTransform("base_camera", "base_arm", rospy.Time(0))

This is what I get when executing either C++ or pythin versions:

rosrun control_node tf_helper `[ERROR] [1445342805.139442730]: "base_camera" passed to lookupTransform argument target_frame does not exist. Similar in Python:

rosrun control_node
Object in camera frame: [0.1, 0.1, 0.1] [0.0, 0.0, 0.0, 1.0] Traceback (most recent call last): File "/home/alva_da/catkin_src/src/control_node/src/", line 25, in <module> (object_in_arm.pose.position, object_in_arm.pose.orientation) = tf_frames.lookupTransform("base_camera", "base_arm", rospy.Time(0)) tf.LookupException: "Base_Camera" passed to lookupTransform argument target_frame does not exist.

So I thought frames where not being published for some reason, but I actually got normal results when used tf tools:

rosrun tf tf_echo "/base_camera" "/base_arm"

At time 1445343041.156 - Translation: [-0.500, 0.000, -0.500] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] in RPY (radian) [0.000, -0.000, 0.000] in RPY (degree) [0.000, -0.000, 0.000]

Also, tf monitor results show:

rosrun tf tf_monitor "base_camera" "base_arm"

Waiting for transform chain to become available between base_camera and base_arm RESULTS: for base_camera to base_arm Chain is: Net delay avg = 0.0223074: max = 0.215266 Frames: All Broadcasters:

Also, when executig view_frames, the two frames ar listed as parent and child.

I came back to this, th only new clue I found is that roswtf tells me this:

`WARNING The following node subscriptions are unconnected:

  • /data_analyzer_node:
    • /tf_static
  • /reflex_tf_broadcaster:
    • /object_pose
  • /rviz:
    • /finger1_sensor9_array
    • /finger1_sensor7_array
    • /finger1_sensor8_array
    • /finger1_sensor6_array
    • /finger1_sensor3_array
    • /finger1_sensor5_array
    • /finger1_proximal_pad_array
    • /finger1_sensor2_array
    • /particles_array
    • /object_array
    • /tf_static`

Although I'm ... (more)

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by dasanche
close date 2019-06-08 05:15:05.414225