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:
O(/base_link)=O(ReadingDevice-RespectToAnyLandMark) => O(ReadingDevice-RespectParticularLandmark)=0+AngleBetween(landmarkCoordinateSystemZeroAngle, ReadingDevice). => 0=O(/base_link)-AngleBetween(landmarkCoordinateSystemZeroAngle, ReadingDevice) = landmarkCoordinateSystemZeroAngle-InTermsOf-mapframe.
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?