geometry
geometry copied to clipboard
Warnings from inner TF2 not wrapped by ROS logging when used via TF.
The first line in the log here is shown for reference, it is what a normal ROS log message looks like. The following lines come from tf2/src/buffer_core.cpp. In that file you can see it is using something called "logWarn()", but apparently this is not connected to the normal ROS logging when used via the older TF API.
[INFO] [WallTime: 1374596992.623081] No target received yet.
Warning: Invalid argument passed to canTransform argument target_frame in tf2 frame_ids cannot be empty
at line 122 in /tmp/buildd/ros-hydro-tf2-0.4.5-0precise-20130721-0218/src/buffer_core.cpp
This is important to me because rosconsole log messages can be made to tell you what node is emitting the error message. Since everything in the whole system uses TF (and thus now TF2), I have no idea where this error is coming from.
I think the fix is to add rosconsole_bridge as a dependency of tf2_ros. I'll work up a test case shortly.
I can reproduce the problem with this simple program, depending on tf. lookupTransform goes out over ros but canTransform's warnings do no.
#include <ros/ros.h>
#include <tf/transform_listener.h>
int main(int argc, char** argv){
ros::init(argc, argv, "my_tf_listener");
ros::NodeHandle node;
tf::TransformListener listener;
ros::Rate rate(10.0);
while (node.ok()){
tf::StampedTransform transform;
try{
listener.canTransform("", "other", ros::Time(0));
listener.lookupTransform("", "/turtle1", ros::Time(0), transform);
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
rate.sleep();
}
return 0;
}
From which I get this:
Error: Invalid argument passed to canTransform argument target_frame in tf2 frame_ids cannot be empty
at line 122 in /home/tfoote/work/geometry_experimental/src/geometry_experimental/tf2/src/buffer_core.cpp
[ERROR] [1376692168.915507885]: Invalid argument passed to lookupTransform argument target_frame in tf2 frame_ids cannot be empty
Showing rosconsole working properly for the
I've explicitly changed libtf2.so to link against rosconsole_bridge.so but I'm still not getting the output on rosout. @isucan any suggestions?