tf target frame does not exist [closed]
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;
transform.setOrigin(tf::Vector3(0.5,0.0,0.5));
transform.setRotation(tf::Quaternion(0.0,0.0,0.0,1.0));
while(1){
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_camera", "base_arm"));
//br.sendTransform(tf::StampedTransform(proximal_tf[i], ros::Time::now(), s1, s2));
ros::Duration(0.5).sleep();
}
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), rospy.Time.now(), "base_camera", "base_arm")
rospy.sleep(0.5)
C++ listener:
tf::TransformListener listener;
tf::StampedTransform transform;
char s1[50]; char s2[50];
sprintf(s1, "base_camera");
sprintf(s2, "base_arm");
try{
listener.lookupTransform(s1, s2, ros::Time(0), transform);
//listener.lookupTransform(s1, s2, ros::Time(0), transform);
}catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
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 tf_read.py
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/tf_read.py", 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 ...