Ask Your Question
0

tf_echo error while using fake localization

asked 2012-06-26 10:07:44 -0500

abdullah gravatar image

updated 2012-06-26 15:03:03 -0500

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?

suggestions please. Thanks.

edit retag flag offensive close merge delete

Comments

Please explain what you are doing.. Otherwise we can't help you.

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

3 Answers

Sort by ยป oldest newest most voted
1

answered 2012-06-28 03:00:14 -0500

dornhege gravatar image

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.

edit flag offensive delete link more
0

answered 2012-06-28 02:51:09 -0500

abdullah gravatar image

updated 2012-06-28 02:52:05 -0500

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

map -> odom -> base_link

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

map -> odom -> base_link

and

map -> base_link

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

edit flag offensive delete link more
0

answered 2012-06-28 05:33:18 -0500

abdullah gravatar image

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.

edit flag offensive delete link more

Comments

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.

dornhege gravatar image dornhege  ( 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.

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-06-26 10:07:44 -0500

Seen: 530 times

Last updated: Jun 28 '12