# TF Transforming landmarks

Hi All!

Im using StarGazer which is a device that read marks in the ceiling of an environment and give as result the distance in X and Y that the device is from the landmark. Also where is heading the device that goes from [-180;180] (We can think that the landmark is the (0,0) of a 2D coordinate system, and also gives info about where the device is heading with degrees in an xy-plane angle). Each landmark is a coordinate system that is kind of fixed ( south is supposed to be -Y if the landmark is located properly).

Adding to the hardware definition, i have a robot with a cool odometry and laser, so in my runtime we can find AMCL (using a GMapping map), MoveBase with the default planners.

What im trying to do is to store the exact position of a landmark in terms of the /map frame. In order to do that im taking the transformation /map => /base_link (through /odom provided by amcl)and trying to merge that info with the landmark differential readings.

So, what i have is the pose of the robot in an instant, and with that, somehow i need to operate it with the distance to the current landmark. The main problem is that the current landmark does not provide the orientation of the associated coordinate system, just the orientation of the robot respect that landmark.

The problem is that my maths are not good enough to understand the calculations i need to do (or even explain it properly sadly).

What i already tried is to think that the actual orientation of the robot (/base_link), expressed in just one angle (z) is the same as the heading of the device, so if i substract the angle that the device is heading to the /base_link orientation, i should have the relative angle 0 (or 360). But does not work because meanwhile i rotate the robot i should have always the same orientation after the calculations and that is not the result.

In kind of logical notation:

Where O(x) is the orientation

One of the usages i want to give to it is to be able to fix some localization when the robot is under a landmark and the pose throught /map => /odom => /base_link is far from the static /map => /landmark{n}.

Can someone put a bit of light, maybe about how to use TF, or what should i take in care?

edit retag close merge delete

Sort by ยป oldest newest most voted

What you should get from your system is a robot (/base_link) relative pose with a timestamp of a landmark. Ideally you'd put that into a PoseStamped.

In addition, you'd setup amcl to provide (with odom) the /map -> /base_link transform.

If you'd now publish the poses they should already look correct. If you want to maintain and record poses, what you wanna do with tf is transform the poses from their frame (/base_link) into the /map frame and save those poses. They should stay fixed unless updated.

more

Thanks a lot for helping me! I edited adding more data. basically what happens is that i dont understand how to play with the coordinate system of the landmark because i dont understand how to get the relative rotation between this system and the system of /map.

( 2013-08-27 08:38:15 -0500 )edit

I'm not sure what to make of your notation. First: A orientation is only defined between frames, i.e. /base_link doesn't have an orientation, only one to /map or /odom or so.

( 2013-08-28 00:26:47 -0500 )edit

Second: I think what you want is to compute the landmark's pose relative to the robot (/base_link), transform that to /map and later when the robot is somewhere else, retrieve this pose relative to the robot again to check for changes.

( 2013-08-28 00:27:44 -0500 )edit

Sorry, this problem is getting me crazy :), i dont end to understand it completely.But yes, what i want to do is what you tagged as second! (thank you for put it simple)

( 2013-08-28 22:23:40 -0500 )edit

So in that case: Compute the pose from you sensor, relative to that and put that into a PoseStamped. Use the transformPose method from a tf listener to transform that to map and store that. Later, with another observation do that same and compare the two.

( 2013-08-28 23:27:21 -0500 )edit

Dornhege is right; I'll just suggest to give the stargazer a tf frame, so you can get its pose in map frame immediately. Funny, I did a stargazer mapping/localization system 2 years ago, so I can help you if still have difficulties. Btw, do you work in Korea? I thought stargazer is only used here!

( 2013-08-30 17:52:02 -0500 )edit

## Stats

Seen: 650 times

Last updated: Aug 27 '13