# tf_echo error while using fake localization

Hi, I am working with erratic robot in gazebo. I have start using fake_localization node. I am facing problem here. When I try to check the transform by using

rosrun tf tf_echo /map /alpha/base_link


I got error. When my alpha robot is not moving it shows correct transform. but when robot is moved to another position the transform from /alpha/base_link to /map start giving error. Error I am getting is that some time its giving correct values and some time its giving wrong values. Also I am getting laser scan data and transforming laser detection points to /map frame so it gives error.

Before using fake localization I was working with alpha/odom data and It was working fine.

I am implementing an algorithm to move a robot. first I was using odom data, but now I want to use fake_localization to find the exact position of robot. In my case robot is not publishing odom data, when I try to use fake_localization. Is it my implementation mistake or fake_localization has this kind of behaviour?

edit retag close merge delete

( 2012-06-26 12:07:52 -0500 )edit

Sort by » oldest newest most voted

fake_localization should provide /map->/odom, so you should not get /map->base_link from that unless you misconfigured it manually. Alternatively someone else is publishing the other transform.

Are you sure there is someone directly doing /map->/base_link? Then disable that.

more

I think that I have got the problem. When we are using /odom data tf works well i.e. transformation from base_link to map is simple

But when we are using fake localization It gives direct transform from base_link to map. So at one time we have two transforms

and

due to these two transforms, I was getting error in tf from base_link -> map. That's why I was getting two different values.

more

Thanks, I have not changed anything. I just add fake_localization node. Its working with one robot as there is only one transform /odom -> /base_link. But When there are multiple robots and you have a map frame then It gives error.

Yes. One thing I am doing is that, I have a node that is continuously giving a transform between /odom and /map. Im doing this.

tf::TransformBroadcaster broadcaster;
while(n.ok())
{
broadcaster.sendTransform(tf::StampedTransform(tf::Transform(tf::Quaternion(0,0,0,1), tf::Vector3(x, y, 0.0)), ros::Time::now(), "map", robot_name+"/odom"));

r.sleep();
}


Is it ok? Or I should write tf from /map to /odom in another way, so that fake_localization do not effect.

more

This is the transform that the localization should send and thus you get two results. What is that supposed to be? Odometry should be odom->base_link.

( 2012-06-29 00:10:15 -0500 )edit

Thanks, I was doing a big mistake. I was writing the transform between odom -> map. Now Im not transforming it on my own. Fake localization itself gives a transform between map and odom. So thanks a lot. Due to your reply I was able to do it in right way.

( 2012-06-29 05:14:42 -0500 )edit